1 |
commit: ee43e4381d4f125f90e678ab339117c16ecda3db |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 3 19:15:45 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 11 17:57:17 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee43e438 |
7 |
|
8 |
app-text/sgml-common: EAPI 7, major cleanup |
9 |
|
10 |
Bump to EAPI 7. Remove old catalog cleanup code, and switch |
11 |
to sgml-catalog-r1 for regen. Correct LICENSE. Own /etc/sgml/catalog. |
12 |
|
13 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
14 |
|
15 |
app-text/sgml-common/sgml-common-0.6.3-r7.ebuild | 94 ++++++++++++++++++++++++ |
16 |
1 file changed, 94 insertions(+) |
17 |
|
18 |
diff --git a/app-text/sgml-common/sgml-common-0.6.3-r7.ebuild b/app-text/sgml-common/sgml-common-0.6.3-r7.ebuild |
19 |
new file mode 100644 |
20 |
index 00000000000..a9d675c8206 |
21 |
--- /dev/null |
22 |
+++ b/app-text/sgml-common/sgml-common-0.6.3-r7.ebuild |
23 |
@@ -0,0 +1,94 @@ |
24 |
+# Copyright 1999-2019 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=7 |
28 |
+ |
29 |
+inherit prefix sgml-catalog-r1 |
30 |
+ |
31 |
+DESCRIPTION="Base ISO character entities and utilities for SGML" |
32 |
+HOMEPAGE="https://www.iso.org/standard/16387.html" |
33 |
+SRC_URI="https://dev.gentoo.org/~floppym/dist/${PN}/${P}-gentoo.tar.gz" |
34 |
+ |
35 |
+# install-catalog is GPL |
36 |
+LICENSE="FDL-1.1+ GPL-2" |
37 |
+SLOT="0" |
38 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
39 |
+IUSE="" |
40 |
+ |
41 |
+DEPEND="" |
42 |
+RDEPEND="" |
43 |
+ |
44 |
+PATCHES=( "${FILESDIR}"/${P}-prefix.patch ) |
45 |
+ |
46 |
+src_prepare() { |
47 |
+ # We use a hacked version of install-catalog that supports the ROOT |
48 |
+ # variable, puts quotes around the CATALOG files, and can be prefixed. |
49 |
+ cp "${FILESDIR}/${P}-install-catalog.in" "${S}/bin/install-catalog.in" \ |
50 |
+ || die "Copy of install-catalog.in failed" |
51 |
+ |
52 |
+ default |
53 |
+ eprefixify bin/install-catalog.in bin/sgmlwhich config/sgml.conf |
54 |
+} |
55 |
+ |
56 |
+src_install() { |
57 |
+ default |
58 |
+ |
59 |
+ # own /etc/sgml/catalog |
60 |
+ insinto /etc/sgml |
61 |
+ newins - catalog <<<'' |
62 |
+ newins - sgml-ent.cat <<-EOF |
63 |
+ CATALOG "${EPREFIX}/usr/share/sgml/sgml-iso-entities-8879.1986/catalog" |
64 |
+ EOF |
65 |
+ newins - sgml-docbook.cat <<-EOF |
66 |
+ CATALOG "${EPREFIX}/etc/sgml/sgml-ent.cat" |
67 |
+ EOF |
68 |
+} |
69 |
+ |
70 |
+pkg_preinst() { |
71 |
+ # preserve old files |
72 |
+ local f |
73 |
+ for f in /etc/sgml/{catalog,sgml-docbook.cat}; do |
74 |
+ if [[ -s ${EROOT}${f} ]]; then |
75 |
+ cp "${EROOT}${f}" "${ED}${f}" || die |
76 |
+ fi |
77 |
+ done |
78 |
+ |
79 |
+ # and back them up in case postrm killed them |
80 |
+ for f in sgml-ent.cat sgml-docbook.cat; do |
81 |
+ cp "${ED}/etc/sgml/${f}" "${T}" || die |
82 |
+ done |
83 |
+} |
84 |
+ |
85 |
+pkg_postinst() { |
86 |
+ # restore backed up files if necessary |
87 |
+ for f in sgml-ent.cat sgml-docbook.cat; do |
88 |
+ if [[ ! -s ${EROOT}/etc/sgml/${f} ]]; then |
89 |
+ cp "${T}/${f}" "${EROOT}"/etc/sgml/ || die |
90 |
+ fi |
91 |
+ done |
92 |
+ |
93 |
+ # re-append sgml-ent.cat if necessary |
94 |
+ if ! grep -q -s sgml-ent.cat "${EROOT}/etc/sgml/sgml-docbook.cat"; then |
95 |
+ ebegin "Adding sgml-ent.cat to /etc/sgml/sgml-docbook.cat" |
96 |
+ cat >> "${EROOT}/etc/sgml/sgml-docbook.cat" <<-EOF |
97 |
+ CATALOG "${EPREFIX}/etc/sgml/sgml-ent.cat" |
98 |
+ EOF |
99 |
+ eend |
100 |
+ fi |
101 |
+ |
102 |
+ sgml-catalog-r1_pkg_postinst |
103 |
+} |
104 |
+ |
105 |
+pkg_postrm() { |
106 |
+ if [[ -z ${REPLACED_BY_VERSION} ]]; then |
107 |
+ ebegin "Removing sgml-ent.cat from /etc/sgml/sgml-docbook.cat" |
108 |
+ sed -i -e '/sgml-ent\.cat/d' \ |
109 |
+ "${EROOT}"/etc/sgml/sgml-docbook.cat |
110 |
+ eend |
111 |
+ if [[ ! -s ${EROOT}/etc/sgml/sgml-docbook.cat ]]; then |
112 |
+ rm -f "${EROOT}"/etc/sgml/sgml-docbook.cat |
113 |
+ fi |
114 |
+ fi |
115 |
+ |
116 |
+ sgml-catalog-r1_pkg_postrm |
117 |
+} |