summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/sgml-common')
-rw-r--r--app-text/sgml-common/ChangeLog9
-rw-r--r--app-text/sgml-common/files/sgml-common-0.6.3-install-catalog.in42
-rw-r--r--app-text/sgml-common/files/sgml-common-0.6.3-prefix.patch17
-rw-r--r--app-text/sgml-common/sgml-common-0.6.3-r5.ebuild56
4 files changed, 75 insertions, 49 deletions
diff --git a/app-text/sgml-common/ChangeLog b/app-text/sgml-common/ChangeLog
index 8fc6d912b8d9..6241ce103fba 100644
--- a/app-text/sgml-common/ChangeLog
+++ b/app-text/sgml-common/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-text/sgml-common
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.52 2009/07/19 11:18:02 ssuominen Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.53 2010/04/06 01:26:04 abcd Exp $
+
+ 06 Apr 2010; Jonathan Callen <abcd@gentoo.org>
+ sgml-common-0.6.3-r5.ebuild, files/sgml-common-0.6.3-install-catalog.in,
+ +files/sgml-common-0.6.3-prefix.patch:
+ Bump to EAPI=3, add prefix keywords, more quoting
19 Jul 2009; Samuli Suominen <ssuominen@gentoo.org>
sgml-common-0.6.3-r5.ebuild, +files/sgml-common-0.6.3-man_MANS.patch:
diff --git a/app-text/sgml-common/files/sgml-common-0.6.3-install-catalog.in b/app-text/sgml-common/files/sgml-common-0.6.3-install-catalog.in
index 3102ae8a7ec1..bd261669064e 100644
--- a/app-text/sgml-common/files/sgml-common-0.6.3-install-catalog.in
+++ b/app-text/sgml-common/files/sgml-common-0.6.3-install-catalog.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
# Script to install a catalog in the centralized SGML catalog
# Send any comments to Eric Bischoff <eric@caldera.de>
# This program is under GPL license. See LICENSE file for details.
@@ -32,6 +32,8 @@ SGML_ORDINARY=""
# Default ROOT value (usually defined by portage)
[ -z "$ROOT" ] && ROOT="/"
[[ $ROOT == */ ]] || ROOT="${ROOT}/"
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+EROOT=${ROOT%/}${EPREFIX}/
# Process options
@@ -79,23 +81,23 @@ SGML_ROOT_ORDINARY="${ROOT%/}${SGML_ORDINARY}"
# Check that the super catalog can be created and changed and deleted
-if [ ! -w ${ROOT}etc/sgml ]
+if [ ! -w "${EROOT}etc/sgml" ]
then
- echo "`basename $0`: unable to write in ${ROOT}etc/sgml." >&2
+ echo "`basename $0`: unable to write in ${EROOT}etc/sgml." >&2
exit 2
fi
case $SGML_ACTION in
addition)
- if [ -e ${ROOT}etc/sgml/catalog -a ! -w ${ROOT}etc/sgml/catalog ]
+ if [ -e "${EROOT}etc/sgml/catalog" -a ! -w "${EROOT}etc/sgml/catalog" ]
then
- echo "`basename $0`: can not modify \"${ROOT}etc/sgml/catalog\"." >&2
+ echo "`basename $0`: can not modify \"${EROOT}etc/sgml/catalog\"." >&2
exit 2
fi
;;
removal)
- if [ ! -w ${ROOT}etc/sgml/catalog ]
+ if [ ! -w "${EROOT}etc/sgml/catalog" ]
then
- echo "`basename $0`: can not modify \"${ROOT}etc/sgml/catalog\"." >&2
+ echo "`basename $0`: can not modify \"${EROOT}etc/sgml/catalog\"." >&2
exit 2
fi
;;
@@ -132,7 +134,7 @@ then
fi
case $SGML_ACTION in
addition)
- if [ ! -s $SGML_ROOT_ORDINARY ]
+ if [ ! -s "$SGML_ROOT_ORDINARY" ]
then
echo "`basename $0`: \"$SGML_ROOT_ORDINARY\" does not exist or is empty." >&2
exit 2
@@ -144,35 +146,35 @@ esac
case $SGML_ACTION in
addition)
echo "`basename $0`: addition of $SGML_ORDINARY in $SGML_CENTRALIZED"
- if grep -q $SGML_ORDINARY $SGML_ROOT_CENTRALIZED 2>/dev/null
+ if grep -q "$SGML_ORDINARY" "$SGML_ROOT_CENTRALIZED" 2>/dev/null
then
echo "Warning: $SGML_ORDINARY is already installed in the centralized catalog $SGML_CENTRALIZED" >&2
else
- echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> $SGML_ROOT_CENTRALIZED
+ echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> "$SGML_ROOT_CENTRALIZED"
fi
- grep -q $SGML_CENTRALIZED ${ROOT}etc/sgml/catalog 2>/dev/null
+ grep -q "$SGML_CENTRALIZED" "${EROOT}etc/sgml/catalog" 2>/dev/null
if [ $? -ne 0 ]
then
- echo "`basename $0`: addition of $SGML_CENTRALIZED in ${ROOT}etc/sgml/catalog"
- echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> ${ROOT}etc/sgml/catalog
+ echo "`basename $0`: addition of $SGML_CENTRALIZED in ${EROOT}etc/sgml/catalog"
+ echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> "${EROOT}etc/sgml/catalog"
fi
;;
removal)
echo "`basename $0`: removal of $SGML_ORDINARY from $SGML_CENTRALIZED"
- if grep -q $SGML_ORDINARY $SGML_ROOT_CENTRALIZED 2>/dev/null
+ if grep -q "$SGML_ORDINARY" "$SGML_ROOT_CENTRALIZED" 2>/dev/null
then
sed -e "\:$SGML_POINTER \"$SGML_ORDINARY\":d" < \
- $SGML_ROOT_CENTRALIZED > ${SGML_ROOT_CENTRALIZED}.new
- mv ${SGML_ROOT_CENTRALIZED}.new $SGML_ROOT_CENTRALIZED
+ "$SGML_ROOT_CENTRALIZED" > "${SGML_ROOT_CENTRALIZED}.new"
+ mv "${SGML_ROOT_CENTRALIZED}.new" "$SGML_ROOT_CENTRALIZED"
else
echo "Warning: $SGML_ORDINARY was not found in the centralized catalog $SGML_CENTRALIZED" >&2
fi
if [ ! -s "$SGML_ROOT_CENTRALIZED" ]
then
- rm $SGML_ROOT_CENTRALIZED
- echo "`basename $0`: removal of $SGML_CENTRALIZED from ${ROOT}etc/sgml/catalog"
- sed -e "\:$SGML_POINTER \"$SGML_CENTRALIZED\":d" < ${ROOT}etc/sgml/catalog > ${ROOT}etc/sgml/catalog.new
- mv ${ROOT}etc/sgml/catalog.new ${ROOT}etc/sgml/catalog
+ rm "$SGML_ROOT_CENTRALIZED"
+ echo "`basename $0`: removal of $SGML_CENTRALIZED from ${EROOT}etc/sgml/catalog"
+ sed -e "\:$SGML_POINTER \"$SGML_CENTRALIZED\":d" < "${EROOT}etc/sgml/catalog" > "${EROOT}etc/sgml/catalog.new"
+ mv "${EROOT}etc/sgml/catalog.new" "${EROOT}etc/sgml/catalog"
fi
;;
esac
diff --git a/app-text/sgml-common/files/sgml-common-0.6.3-prefix.patch b/app-text/sgml-common/files/sgml-common-0.6.3-prefix.patch
new file mode 100644
index 000000000000..bfca708799d3
--- /dev/null
+++ b/app-text/sgml-common/files/sgml-common-0.6.3-prefix.patch
@@ -0,0 +1,17 @@
+--- bin/sgmlwhich~ 2007-10-08 04:21:25 +0200
++++ bin/sgmlwhich 2007-10-08 04:21:36 +0200
+@@ -3,5 +3,5 @@
+ # Send any comments to Eric Bischoff <eric@caldera.de>
+ # This program is under GPL license. See LICENSE file for details.
+
+-echo "/etc/sgml/sgml.conf"
++echo "@GENTOO_PORTAGE_EPREFIX@/etc/sgml/sgml.conf"
+ # Simple, isn't it? ;-)
+--- config/sgml.conf~ 2000-11-17 09:36:11 +0100
++++ config/sgml.conf 2007-10-08 04:42:52 +0200
+@@ -1,3 +1,3 @@
+ # /etc/sgml/sgml.conf conformant with LSB
+-SGML_BASE_DIR=/usr/share/sgml
+-SGML_CATALOGS_DIR=/etc/sgml
++SGML_BASE_DIR=@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml
++SGML_CATALOGS_DIR=@GENTOO_PORTAGE_EPREFIX@/etc/sgml
diff --git a/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild b/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild
index 538b959d9254..77c06d8db2ae 100644
--- a/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild
+++ b/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild
@@ -1,8 +1,10 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild,v 1.19 2009/07/19 11:18:02 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/sgml-common-0.6.3-r5.ebuild,v 1.20 2010/04/06 01:26:04 abcd Exp $
-inherit autotools eutils
+EAPI="3"
+
+inherit autotools eutils prefix
DESCRIPTION="Base ISO character entities and utilities for SGML"
HOMEPAGE="http://www.iso.ch/cate/3524030.html"
@@ -10,19 +12,19 @@ SRC_URI="mirror://kde/devel/docbook/SOURCES/${P}.tgz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE=""
-RDEPEND=""
DEPEND=""
+RDEPEND=""
-src_unpack() {
- unpack ${A}
-
+src_prepare() {
# We use a hacked version of install-catalog that supports the ROOT
- # variable, and puts quotes around the CATALOG files.
+ # variable, puts quotes around the CATALOG files, and can be prefixed.
cp "${FILESDIR}/${P}-install-catalog.in" "${S}/bin/install-catalog.in"
- cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-prefix.patch
+ eprefixify bin/install-catalog.in bin/sgmlwhich config/sgml.conf
epatch "${FILESDIR}"/${P}-configure.in.patch
epatch "${FILESDIR}"/${P}-man_MANS.patch
@@ -35,22 +37,22 @@ src_install() {
}
pkg_postinst() {
- local installer="${ROOT}usr/bin/install-catalog"
- if [ ! -x "${installer}" ]; then
+ local installer="${EROOT}usr/bin/install-catalog"
+ if [[ ! -x ${installer} ]]; then
eerror "install-catalog not found! Something went wrong!"
- die
+ die "install-catalog not found! Something went wrong!"
fi
einfo "Installing Catalogs..."
- $installer --add \
- /etc/sgml/sgml-ent.cat \
- /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
- $installer --add \
- /etc/sgml/sgml-docbook.cat \
- /etc/sgml/sgml-ent.cat
+ "$installer" --add \
+ "${EPREFIX}"/etc/sgml/sgml-ent.cat \
+ "${EPREFIX}"/usr/share/sgml/sgml-iso-entities-8879.1986/catalog
+ "$installer" --add \
+ "${EPREFIX}"/etc/sgml/sgml-docbook.cat \
+ "${EPREFIX}"/etc/sgml/sgml-ent.cat
local file
- for file in `find "${ROOT}etc/sgml/" -name "*.cat"` "${ROOT}etc/sgml/catalog"
+ for file in `find "${EROOT}etc/sgml/" -name "*.cat"` "${EROOT}etc/sgml/catalog"
do
einfo "Fixing ${file}"
awk '/"$/ { print $1 " " $2 }
@@ -60,7 +62,7 @@ pkg_postinst() {
}
pkg_prerm() {
- cp "${ROOT}usr/bin/install-catalog" "${T}"
+ cp "${EROOT}usr/bin/install-catalog" "${T}"
}
pkg_postrm() {
@@ -69,15 +71,15 @@ pkg_postrm() {
fi
einfo "Removing Catalogs..."
- if [ -e "${ROOT}etc/sgml/sgml-ent.cat" ]; then
+ if [ -e "${EROOT}etc/sgml/sgml-ent.cat" ]; then
"${T}"/install-catalog --remove \
- /etc/sgml/sgml-ent.cat \
- /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
+ "${EPREFIX}"/etc/sgml/sgml-ent.cat \
+ "${EPREFIX}"/usr/share/sgml/sgml-iso-entities-8879.1986/catalog
fi
- if [ -e "${ROOT}etc/sgml/sgml-docbook.cat" ]; then
+ if [ -e "${EROOT}etc/sgml/sgml-docbook.cat" ]; then
"${T}"/install-catalog --remove \
- /etc/sgml/sgml-docbook.cat \
- /etc/sgml/sgml-ent.cat
+ "${EPREFIX}"/etc/sgml/sgml-docbook.cat \
+ "${EPREFIX}"/etc/sgml/sgml-ent.cat
fi
}