diff options
author | P. J. McDermott <pjm@nac.net> | 2012-04-25 00:28:38 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-04-25 00:28:38 (EDT) |
commit | d252d67d4885448939f9957c5dcd4864becd7a8c (patch) | |
tree | d1c1191e70e8a1cf753362d138c4bf89367717a8 /src | |
parent | cde5b6b6c6f036e0cee19a60219bc1bf57ffbc95 (diff) |
Clean up oh-installdocs and install a "README".
Diffstat (limited to 'src')
-rw-r--r-- | src/oh-installdocs.sh | 21 |
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 |