sys-apps/groff: handle missing pdf examples #602020
authorMike Frysinger <vapier@gentoo.org>
Fri, 9 Dec 2016 04:14:25 +0000 (23:14 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 9 Dec 2016 04:20:26 +0000 (23:20 -0500)
If ghostscript isn't available, groff won't build its pdf examples.

sys-apps/groff/groff-1.22.2.ebuild
sys-apps/groff/groff-1.22.3.ebuild

index e731d95545cea7bfbe0f5fd565f40050a68061ac..de668f383538115dd8d642d745654a316a0449cd 100644 (file)
@@ -84,9 +84,12 @@ src_install() {
        dosym tbl /usr/bin/gtbl
 
        if ! use examples ; then
-               # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
-               rm -f "${ED}"/usr/share/doc/${PF}/pdf/mom-pdf.pdf
-               mv "${ED}"/usr/share/doc/${PF}/{examples/mom,pdf}/mom-pdf.pdf || die
+               # The pdf files might not be generated if ghostscript is unavailable. #602020
+               local pdf="${ED}/usr/share/doc/${PF}/examples/mom/mom-pdf.pdf"
+               if [[ -e ${pdf} ]] ; then
+                       # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
+                       mv "${pdf}" "${ED}"/usr/share/doc/${PF}/pdf/ || die
+               fi
                rm -rf "${ED}"/usr/share/doc/${PF}/examples
        fi
 }
index 712f51ff7945b7c30402177e9ba18dd58ec35377..4007d84cf4589c9bd77e9261c34e46581915c3d3 100644 (file)
@@ -75,9 +75,12 @@ src_install() {
        dosym tbl /usr/bin/gtbl
 
        if ! use examples ; then
-               # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
-               rm -f "${ED}"/usr/share/doc/${PF}/pdf/mom-pdf.pdf
-               mv "${ED}"/usr/share/doc/${PF}/{examples/mom,pdf}/mom-pdf.pdf || die
+               # The pdf files might not be generated if ghostscript is unavailable. #602020
+               local pdf="${ED}/usr/share/doc/${PF}/examples/mom/mom-pdf.pdf"
+               if [[ -e ${pdf} ]] ; then
+                       # Keep mom-pdf.pdf since it's more of a manual than an example. #454196 #516732
+                       mv "${pdf}" "${ED}"/usr/share/doc/${PF}/pdf/ || die
+               fi
                rm -rf "${ED}"/usr/share/doc/${PF}/examples
        fi
 }