summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Turk <satai@gentoo.org>2003-02-05 08:28:18 +0000
committerMatthew Turk <satai@gentoo.org>2003-02-05 08:28:18 +0000
commit9ac01f92a15eb2818d0dcc186a2092acbbb818ac (patch)
tree58700aeb94994ee4b8a71608a89ffa31f8633669 /app-text/sgml-common
parentmoved inherit to the top of the file and cleaned up description. (diff)
downloadgentoo-2-9ac01f92a15eb2818d0dcc186a2092acbbb818ac.tar.gz
gentoo-2-9ac01f92a15eb2818d0dcc186a2092acbbb818ac.tar.bz2
gentoo-2-9ac01f92a15eb2818d0dcc186a2092acbbb818ac.zip
Changing the way we deal with catalog files.
Diffstat (limited to 'app-text/sgml-common')
-rw-r--r--app-text/sgml-common/ChangeLog10
-rw-r--r--app-text/sgml-common/files/digest-sgml-common-0.6.3-r41
-rw-r--r--app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in163
-rw-r--r--app-text/sgml-common/sgml-common-0.6.3-r4.ebuild83
4 files changed, 256 insertions, 1 deletions
diff --git a/app-text/sgml-common/ChangeLog b/app-text/sgml-common/ChangeLog
index 2d3f19937a32..6154368df651 100644
--- a/app-text/sgml-common/ChangeLog
+++ b/app-text/sgml-common/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-text/sgml-common
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.11 2002/12/31 04:36:56 satai Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/sgml-common/ChangeLog,v 1.12 2003/02/05 08:28:18 satai Exp $
+
+*sgml-common-0.6.3-r4 (05 Feb 2003)
+
+ 05 Feb 2003; Matthew Turk <satai@gentoo.org> :
+ Revision bump. Now the install-catalog program puts quotations around the
+ catalog files, thus fixing sgmltools-lite. Masking in package.mask and
+ ~arch. Also included a script to convert the catalogs into the proper
+ format, with quotation marks. In response to bug 12792.
*sgml-common-0.6.3-r3 (30 Dec 2002)
diff --git a/app-text/sgml-common/files/digest-sgml-common-0.6.3-r4 b/app-text/sgml-common/files/digest-sgml-common-0.6.3-r4
new file mode 100644
index 000000000000..876e0934660f
--- /dev/null
+++ b/app-text/sgml-common/files/digest-sgml-common-0.6.3-r4
@@ -0,0 +1 @@
+MD5 103c9828f24820df86e55e7862e28974 sgml-common-0.6.3.tgz 76783
diff --git a/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in b/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in
new file mode 100644
index 000000000000..71507a327604
--- /dev/null
+++ b/app-text/sgml-common/files/sgml-common-0.6.3-r4-install-catalog.in
@@ -0,0 +1,163 @@
+#!/bin/sh
+# 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.
+
+# Set help message
+SGML_HELP_MESSAGE="Usage: `basename $0` [<option>] <action>\n\
+where <option> is:\n\
+\040 -d|--delegate: \t\t\t Use DELEGATE instead of CATALOG\n\
+and where <action> is:\n\
+\040 -a|--add <centralized> <ordinary>: \t Declare ordinary catalog in the centralized catalog\n\
+\040 -r|--remove <centralized> <ordinary>:\t Remove ordinary catalog from the centralized catalog\n\
+\040 -h, --help: \t\t\t\t Print this help message and exit\n\
+\040 -v, --version: \t\t\t Print the version number and exit\n"
+
+# Set version message
+SGML_VERSION_MESSAGE="sgml-common version @VERSION@ (install-catalog version 1.0)"
+
+# Set type of pointer
+SGML_POINTER="CATALOG"
+
+# Set action to be performed
+SGML_ACTION=""
+
+# Set catalogs
+SGML_CENTRALIZED=""
+SGML_ORDINARY=""
+
+# Process options
+case $1 in
+ -d|--delegate) SGML_POINTER="DELEGATE"
+ shift 1
+ ;;
+esac
+
+# Process actions
+case $1 in
+ -a|--add) SGML_ACTION="addition"
+ SGML_CENTRALIZED=$2
+ SGML_ORDINARY=$3
+ ;;
+ -r|--remove) if [ -z "$3" -o "$3" = "--version" ]
+ then
+ echo "install-catalog: Old syntax; doing nothing"
+ exit 0
+ fi
+ SGML_ACTION="removal"
+ SGML_CENTRALIZED=$2
+ SGML_ORDINARY=$3
+ ;;
+ -h|--help) echo -e $SGML_HELP_MESSAGE
+ exit 0
+ ;;
+ -v|--version) echo -e $SGML_VERSION_MESSAGE
+ exit 0
+ ;;
+ --install) echo "install-catalog: Old syntax; doing nothing"
+ exit 0
+ ;;
+ *) echo -e $SGML_HELP_MESSAGE >&2
+ exit 1
+ ;;
+esac
+
+# Check that the super catalog can be created and changed and deleted
+if [ ! -w ${ROOT}etc/sgml ]
+then
+ echo "`basename $0`: unable to write in ${ROOT}etc/sgml." >&2
+ exit 2
+fi
+case $SGML_ACTION in
+ addition)
+ if [ -e ${ROOT}etc/sgml/catalog -a ! -w ${ROOT}etc/sgml/catalog ]
+ then
+ echo "`basename $0`: can not modify \"${ROOT}etc/sgml/catalog\"." >&2
+ exit 2
+ fi
+ ;;
+ removal)
+ if [ ! -w ${ROOT}etc/sgml/catalog ]
+ then
+ echo "`basename $0`: can not modify \"${ROOT}etc/sgml/catalog\"." >&2
+ exit 2
+ fi
+ ;;
+esac
+
+# Check that the centralized catalog can be created, changed and deleted
+if [ -z "$SGML_CENTRALIZED" ]
+then
+ echo -e $SGML_HELP_MESSAGE >&2
+ exit 1
+fi
+case $SGML_ACTION in
+ addition)
+ if [ -e $SGML_CENTRALIZED -a ! -w $SGML_CENTRALIZED ]
+ then
+ echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+ exit 2
+ fi
+ ;;
+ removal)
+ if [ ! -w $SGML_CENTRALIZED ]
+ then
+ echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+ exit 2
+ fi
+ ;;
+esac
+
+# Check that we have at least one ordinary package to process
+if [ -z "$SGML_ORDINARY" ]
+then
+ echo -e $SGML_HELP_MESSAGE >&2
+ exit 1
+fi
+case $SGML_ACTION in
+ addition)
+ if [ ! -s $SGML_ORDINARY ]
+ then
+ echo "`basename $0`: \"$SGML_ORDINARY\" does not exist or is empty." >&2
+ exit 2
+ fi
+ ;;
+esac
+
+# Installation or removal of pointers
+case $SGML_ACTION in
+ addition)
+ echo "`basename $0`: addition of $SGML_ORDINARY in $SGML_CENTRALIZED"
+ if grep -q $SGML_ORDINARY $SGML_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_CENTRALIZED
+ fi
+ grep -q $SGML_CENTRALIZED ${ROOT}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
+ fi
+ ;;
+ removal)
+ echo "`basename $0`: removal of $SGML_ORDINARY from $SGML_CENTRALIZED"
+ if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null
+ then
+ sed -e "\:$SGML_POINTER \"$SGML_ORDINARY\":d" < $SGML_CENTRALIZED > ${SGML_CENTRALIZED}.new
+ mv ${SGML_CENTRALIZED}.new $SGML_CENTRALIZED
+ else
+ echo "Warning: $SGML_ORDINARY was not found in the centralized catalog $SGML_CENTRALIZED" >&2
+ fi
+ if [ ! -s $SGML_CENTRALIZED ]
+ then
+ rm $SGML_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
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild b/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild
new file mode 100644
index 000000000000..e2f08b36fb42
--- /dev/null
+++ b/app-text/sgml-common/sgml-common-0.6.3-r4.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# 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-r4.ebuild,v 1.1 2003/02/05 08:28:18 satai Exp $
+
+S=${WORKDIR}/${P}
+DESCRIPTION="Base ISO character entities and utilities for SGML"
+SRC_URI="ftp://ftp.kde.org/pub/kde/devel/docbook/SOURCES/${P}.tgz
+ http://download.sourceforge.net/pub/mirrors/kde/devel/docbook/SOURCES/${P}.tgz"
+HOMEPAGE="http://www.iso.ch/cate/3524030.html"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="x86 ppc sparc alpha"
+
+src_unpack() {
+ unpack ${A}
+ # We use a hacked version of install-catalog that supports the ROOT
+ # variable, and puts quotes around the CATALOG files.
+ cp ${FILESDIR}/${PF}-install-catalog.in ${S}/bin/install-catalog.in
+}
+
+src_compile() {
+ econf || die
+ emake || die
+}
+
+src_install () {
+ emake \
+ prefix=${D}/usr \
+ sysconfdir=${D}/etc \
+ mandir=${D}/usr/share/man \
+ docdir=${D}/usr/share/doc \
+ install || die
+}
+
+pkg_postinst() {
+ if [ -x "/usr/bin/install-catalog" ] && [ "$ROOT" = "/" ]
+ then
+ einfo "Installing Catalogs..."
+ install-catalog --add \
+ /etc/sgml/sgml-ent.cat \
+ /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
+
+ install-catalog --add \
+ /etc/sgml/sgml-docbook.cat \
+ /etc/sgml/sgml-ent.cat
+ else
+ ewarn "install-catalog not found! Something went wrong!"
+ die
+ fi
+ for file in `find /etc/sgml/ -name "*.cat"` /etc/sgml/catalog
+ do
+ einfo "Fixing ${file}"
+ awk '/"$/ { print $1 " " $2 }
+ ! /"$/ { print $1 " \"" $2 "\"" }' ${file} > ${file}.new
+ mv ${file}.new ${file}
+ done
+
+}
+
+pkg_prerm() {
+ cp /usr/bin/install-catalog ${T}
+}
+
+pkg_postrm() {
+ if [ ! -x "/usr/bin/install-catalog" ] && [ "$ROOT" = "/" ]
+ then
+ einfo "Removing Catalogs..."
+ if [ -e /etc/sgml/sgml-ent.cat ]
+ then
+ ${T}/install-catalog --remove \
+ /etc/sgml/sgml-ent.cat \
+ /usr/share/sgml/sgml-iso-entities-8879.1986/catalog
+ fi
+
+ if [ -e /etc/sgml/sgml-docbook.cat ]
+ then
+ ${T}/install-catalog --remove \
+ /etc/sgml/sgml-docbook.cat \
+ /etc/sgml/sgml-ent.cat
+ fi
+ fi
+}
+