summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ob-installdocs.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh
index c686029..663a29f 100644
--- a/src/ob-installdocs.sh
+++ b/src/ob-installdocs.sh
@@ -32,6 +32,34 @@ main()
ob_init_package '..'
ob_parse_package_metadata -c '.opkbuild.cache'
+ doc_pkg="$(ob_get_doc_package)"
+ if [ ${?} -ne 0 ]; then
+ ob_error "$(ob_get_msg 'cant_get_doc_pkg')"
+ fi
+
+ for pkg in $(ob_get_binary_packages); do
+ doc_dir="${pkg}.data/usr/share/doc/${pkg}"
+ mkdir -p "${doc_dir}" || \
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ if [ "${pkg}" = "${doc_pkg}" ]; then
+ ob_info "$(ob_get_msg 'installing_docs')" "${pkg}"
+ ob_get_doc_files | while read src dest; do
+ if [ -f "${src}" ]; then
+ mkdir -p "${doc_dir}/${dest%/*}" || \
+ ob_error "$(ob_get_msg 'cant_make_doc_dir')"
+ cp -R "${src}" "${doc_dir}/${dest}" || \
+ ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"
+ elif [ -d "${src}" ]; then
+ cp -R "${src}/." "${doc_dir}/${dest}" || \
+ ob_error "$(ob_get_msg 'cant_cp_doc_file')" "${src}"
+ fi
+ done
+ else
+ ob_info "$(ob_get_msg 'linking_docs')" "${pkg}"
+ ln -s "/usr/share/doc/${doc_pkg}" "${doc_dir}" || \
+ ob_error "$(ob_get_msg 'cant_ln_doc_dir')"
+ fi
+ done
}
main "${@}"