summaryrefslogtreecommitdiffstats
path: root/src/oh-installdocs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/oh-installdocs.sh')
-rw-r--r--src/oh-installdocs.sh21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/oh-installdocs.sh b/src/oh-installdocs.sh
index f950651..07a458b 100644
--- a/src/oh-installdocs.sh
+++ b/src/oh-installdocs.sh
@@ -34,22 +34,25 @@ fi
# Iterate through packages that have been installed.
for pkgdir in *.data/; do
pkg=${pkgdir%'.data/'}
- mkdir -p ${pkg}.data/usr/share/doc/
+ docdir=${pkgdir}usr/share/doc
+ mkdir -p ${docdir}
if [ ${pkg} = ${1} ]; then
# Make the providing package provide the documentation files.
oh_info 'Installing package documentation into package "%s"...' "${pkg}"
- mkdir -p ${pkg}.data/usr/share/doc/${pkg}
- [ ! -f ../copyright ] && oh_error 'Missing "copyright" file'
- [ ! -f ../changelog ] && oh_error 'Missing "changelog" file'
- cp ../copyright ${pkgdir}/usr/share/doc/${pkg}/copyright || \
- oh_error 'Cannot copy documentation files'
- cp ../changelog ${pkgdir}/usr/share/doc/${pkg}/changelog.dist || \
- oh_error 'Cannot copy documentation files'
+ mkdir -p ${docdir}/${pkg}
+ cp ../copyright ${docdir}/${pkg}/copyright || \
+ oh_error 'Cannot copy "copyright"'
+ cp ../changelog ${docdir}/${pkg}/changelog.dist || \
+ oh_error 'Cannot copy "changelog"'
+ if [ -f ../README ]; then
+ cp ../README ${docdir}/${pkg}/README.dist || \
+ oh_error 'Cannot copy package "README"'
+ fi
else
# Make dependent packages link to the providing package's documentation
# directory.
oh_info 'Making link to documentation in package "%s"...' "${pkg}"
- ln -s /usr/share/doc/${1} ${pkgdir}/usr/share/doc/${pkg} || \
+ ln -s /usr/share/doc/${1} ${docdir}/${pkg} || \
oh_error 'Cannot make link to documentation files'
fi
done