dev-qt/qtopengl: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / app-text / docbook-xsl-ns-stylesheets / docbook-xsl-ns-stylesheets-1.78.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 DOCBOOKDIR="/usr/share/sgml/${PN/-//}"
7 MY_PN="${PN%-stylesheets}"
8 MY_P="${MY_PN}-${PV}"
9
10 DESCRIPTION="XSL Stylesheets for Docbook"
11 HOMEPAGE="https://github.com/docbook/wiki/wiki"
12 SRC_URI="mirror://sourceforge/docbook/${MY_P}.tar.bz2"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86"
17 IUSE="ruby"
18
19 RDEPEND=">=app-text/build-docbook-catalog-1.4
20         ruby? ( dev-lang/ruby )"
21 DEPEND=""
22
23 S="${WORKDIR}/${MY_P}"
24
25 # Makefile is broken since 1.76.0
26 RESTRICT=test
27
28 # The makefile runs tests, not builds.
29 src_compile() { :; }
30
31 src_test() {
32         emake check
33 }
34
35 src_install() {
36         # The changelog is now zipped, and copied as the RELEASE-NOTES, so we
37         # don't need to install it
38         dodoc AUTHORS BUGS NEWS README RELEASE-NOTES.txt TODO
39
40         insinto ${DOCBOOKDIR}
41         doins VERSION VERSION.xsl
42
43         local i
44         for i in $(find . -maxdepth 1 -mindepth 1 -type d -exec basename {} \;); do
45                 [[ "$i" == "epub" ]] && ! use ruby && continue
46
47                 cd "${S}"/${i}
48                 for doc in ChangeLog README; do
49                         if [ -e "$doc" ]; then
50                                 mv ${doc} ${doc}.${i}
51                                 dodoc ${doc}.${i}
52                                 rm ${doc}.${i}
53                         fi
54                 done
55
56                 doins -r "${S}"/${i}
57         done
58
59         if use ruby; then
60                 local cmd="dbtoepub${MY_PN#docbook-xsl}"
61
62                 # we can't use a symlink or it'll look for the library in the
63                 # wrong path.
64                 dodir /usr/bin
65                 cat - > "${D}"/usr/bin/${cmd} <<EOF
66 #!/usr/bin/env ruby
67
68 load "${DOCBOOKDIR}/epub/bin/dbtoepub"
69 EOF
70                 fperms 0755 /usr/bin/${cmd}
71         fi
72 }
73
74 pkg_postinst() {
75         build-docbook-catalog
76 }
77
78 pkg_postrm() {
79         build-docbook-catalog
80 }