%define Name docbook-dtd31-sgml %define Version 1.0 Name : %{Name} Version : %{Version} Release : 8 Group : Textprocessing/Tools Summary : SGML document type definition for DocBook 3.1. Copyright : 1992, 1993, 1994, 1995, 1996, 1998, 1999 HaL Computer Systems, Inc., O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software Corporation, and the Organization for the Advancement of Structured Information Standards (OASIS); distributable Packager : Eric Bischoff , Mark Galassi URL : http://www.oasis-open.org/docbook/index.html Provides : docbook-dtd-sgml Requires : sgml-common >= 0.2 Prereq : sgml-common BuildRoot : /tmp/%{Name}-%{Version} BuildArch : noarch Source0 : http://www.oasis-open.org/docbook/sgml/3.1/docbk31.zip Source1 : %{Name}-%{Version}.Makefile Patch0 : %{Name}-%{Version}.catalog.patch %Description The DocBook Document Type Definition (DTD) describes the syntax of technical documentation texts (articles, books and manual pages). This syntax is SGML-compliant and is developped by the OASIS consortium. This is the version 3.1 of this DTD. %Prep %setup -c -T unzip %{SOURCE0} if [ `id -u` -eq 0 ]; then chown -R root.root . chmod -R a+rX,g-w,o-w . fi cp %{SOURCE1} Makefile patch -b docbook.cat $RPM_SOURCE_DIR/%{Name}-%{Version}.catalog.patch %Build %Install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$DESTDIR/usr/share/sgml/docbook/sgml-dtd-3.1 %Clean DESTDIR=$RPM_BUILD_ROOT rm -rf $DESTDIR %Files %defattr (-,root,root) %doc *.txt /usr/share/sgml/docbook/sgml-dtd-3.1/*.dcl /usr/share/sgml/docbook/sgml-dtd-3.1/catalog /usr/share/sgml/docbook/sgml-dtd-3.1/*.dtd /usr/share/sgml/docbook/sgml-dtd-3.1/*.mod %Post # Avoid adding things when updating (postuninstall of old package is called *after* postinstall of new package) if [ $1 -gt 1 ]; then exit 0; fi # Update the centralized catalog corresponding to this version of the DTD /usr/bin/install-catalog --add /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/sgml-iso-entities-8879.1986/catalog /usr/bin/install-catalog --add /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/docbook/sgml-dtd-3.1/catalog # The following lines are for the case in which the style sheets were installed after another DTD but before this DTD STYLESHEETS=`rpm -q docbook-style-dsssl 2> /dev/null | sed 's/^docbook-style-dsssl-\(.*\)-.*$/\1/'` if [ -n "$STYLESHEETS" ]; then /usr/bin/install-catalog --add /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/jade-1.2.1/catalog /usr/bin/install-catalog --add /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/docbook/dsssl-stylesheets-$STYLESHEETS/catalog fi # Update the link to the current version of the DTD ln -s -f /etc/sgml/sgml-docbook-3.1.cat /etc/sgml/sgml-docbook.cat %Postun # Avoid removing things when updating (postuninstall of old package is called *after* postinstall of new package) if [ $1 -gt 1 ]; then exit 0; fi # Update the centralized catalog corresponding to this version of the DTD /usr/bin/install-catalog --remove /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/sgml-iso-entities-8879.1986/catalog /usr/bin/install-catalog --remove /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/docbook/sgml-dtd-3.1/catalog # The following lines are for the case in which the style sheets were not uninstalled because there is still another DTD STYLESHEETS=`rpm -q docbook-style-dsssl 2> /dev/null | sed 's/^docbook-style-dsssl-\(.*\)-.*$/\1/'` if [ -n "$STYLESHEETS" ]; then /usr/bin/install-catalog --remove /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/jade-1.2.1/catalog /usr/bin/install-catalog --remove /etc/sgml/sgml-docbook-3.1.cat /usr/share/sgml/docbook/dsssl-stylesheets-$STYLESHEETS/catalog fi # Update the link to the current version of the DTD if [ ! -e /etc/sgml/sgml-docbook-3.1.cat ]; then rm -f /etc/sgml/sgml-docbook.cat OTHERCAT=`ls /etc/sgml/sgml-docbook-?.?.cat 2> /dev/null | head --lines 1` if [ -n "$OTHERCAT" ]; then ln -s $OTHERCAT /etc/sgml/sgml-docbook.cat; fi fi