# $Id$ PNAME="sgml-common" PVER="0.6.3" PBUILD="r7" PCAT="app-text" DESCRIPTION="Base ISO character entities and utilities for SGML." HOMEPAGE="ftp://ftp.kde.org/pub/kde/devel/docbook/SOURCES/" DEPEND="" SRCFILE="${PNAME}-${PVER}.tgz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mbuild SRC_URI=( ftp://ftp.kde.org/pub/kde/devel/docbook/SOURCES/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-${PVER}-install-catalog.in mirror://${PNAME}/${PNAME}-${PVER}-configure.in.patch mirror://${PNAME}/${PNAME}-${PVER}-manpage-1.patch ) UP2DATE="updatecmd ${HOMEPAGE} | grep ${PNAME}- | lasttarball tgz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # we use a hacked version of install-catalog that supports the ROOT # variable, and puts quotes around the CATALOG files. # - taken from gentoo cp ${SOURCEDIR}/${PNAME}/${PNAME}-${PVER}-install-catalog.in \ ${SRCDIR}/bin/install-catalog.in # fix docdir location mpatch ${PNAME}-${PVER}-configure.in.patch || die # fix glitch in manpage installation with newer automake mpatch ${PNAME}-${PVER}-manpage-1.patch || die # fix some missing files and rebuild makefiles export WANT_AUTOCONF=2.5 export WANT_AUTOMAKE=1.9 mautoreconf || die } postinstall() { echo "Installing Catalogs..." ${MROOT}/usr/bin/install-catalog --add \ /etc/sgml/sgml-ent.cat \ /usr/share/sgml/sgml-iso-entities-8879.1986/catalog ${MROOT}/usr/bin/install-catalog --add \ /etc/sgml/sgml-docbook.cat \ /etc/sgml/sgml-ent.cat local file for file in $(find ${MROOT}/etc/sgml/ -name "*.cat") ${MROOT}/etc/sgml/catalog do echo "Fixing ${file}" awk '/"$/ { print $1 " " $2 } ! /"$/ { print $1 " \"" $2 "\"" }' ${file} > ${file}.new mv ${file}.new ${file} done } preremove() { cp ${MROOT}/usr/bin/install-catalog ${BUILDDIR} } postremove() { [ ! -x ${BUILDDIR}/install-catalog ] && return echo "Removing Catalogs..." if [[ -e ${MROOT}/etc/sgml/sgml-ent.cat ]] then ${BUILDDIR}/install-catalog --remove \ /etc/sgml/sgml-ent.cat \ /usr/share/sgml/sgml-iso-entities-8879.1986/catalog fi if [[ -e ${MROOT}/etc/sgml/sgml-docbook.cat ]] then ${BUILDDIR}/install-catalog --remove \ /etc/sgml/sgml-docbook.cat \ /etc/sgml/sgml-ent.cat fi if [ -x ${BUILDDIR}/install-catalog ] then rm ${BUILDDIR}/install-catalog fi }