From: Stefan Schantl Date: Sun, 16 Oct 2011 17:15:44 +0000 (+0200) Subject: docbook-dtds: Rework package. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29ce5abfce7145528160bbd7f4d594b2273a7f99;p=ipfire-3.x.git docbook-dtds: Rework package. * Change package arch to noarch. * Remove a lot of unnedet stuff. * Fix scriptlet and dependencies. Reference #74 --- diff --git a/docbook-dtds/docbook-dtds.nm b/docbook-dtds/docbook-dtds.nm index 079058d11..b99a09892 100644 --- a/docbook-dtds/docbook-dtds.nm +++ b/docbook-dtds/docbook-dtds.nm @@ -5,7 +5,8 @@ name = docbook-dtds version = 1.0 -release = 1 +release = 2 +arch = noarch groups = Applications/Text url = http://www.oasis-open.org/docbook/ @@ -56,7 +57,7 @@ directories = \ build requires dos2unix - unzip>=6.0-2 + unzip>=6.0-3 end prepare @@ -96,6 +97,7 @@ build build = # Nothing to do install + # Create Symlinks. mkdir -pv %{BUILDROOT}/etc/sgml for fmt in sgml xml; do ln -svf $fmt-docbook-4.5.cat %{BUILDROOT}/etc/sgml/$fmt-docbook.cat @@ -123,15 +125,20 @@ packages openjade=%{version_openjade} end - script postin - set -x + prerequires += \ + libxml2 \ + openjade=%{version_openjade} \ + sgml-common - ## Clean up pre-docbook-dtds mess caused by broken trigger. - for ver in 3.0 3.1 4.0 4.1 4.2; do - if [ -f /etc/sgml/sgml-docbook-${ver}.cat ]; then - /usr/bin/xmlcatalog --noout --sgml --del /etc/sgml/sgml-docbook-${ver}.cat \ - /usr/share/sgml/openjade-%{version_openjade}/catalog 2>/dev/null - fi + script postin + # Install catalog files. + for dir in %{directories}; do + fmt=${dir#*-} + ver=${dir%%-*} + /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \ + /usr/share/sgml/docbook/${fmt}-dtd-${ver}/catalog > /dev/null 2>/dev/null + /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \ + /usr/share/sgml/sgml-iso-entities-8879.1986/catalog > /dev/null 2>/dev/null done # The STYLESHEETS/catalog command is for the case in which the style sheets @@ -148,14 +155,14 @@ packages ## SGML catalog # Update the centralized catalog corresponding to this version of the DTD for cat_dir in /usr/share/sgml/sgml-iso-entities-8879.1986 /usr/share/sgml/docbook/$fmt-dtd-$ver $STYLESHEETS; do - /usr/bin/xmlcatalog --sgml --add /etc/sgml/$fmt-docbook-$ver.cat $cat_dir/catalog + /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$ver.cat $cat_dir/catalog > /dev/null 2>/dev/null done ## XML catalog if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then while read f desc; do case $vers in 4.[45]) f=${f/-/} ;; esac - /usr/bin/xmlcatalog --add public "$desc" /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog + /usr/bin/xmlcatalog --add public "$desc" /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog > /dev/null 2>/dev/null done < /dev/null 2>/dev/null done fi done @@ -207,22 +214,6 @@ packages end script postun - # Redefine directories from package header. Don't forget to update this if there are any changes. - directories=\ - 3.0-sgml \ - 3.1-sgml \ - 4.0-sgml \ - 4.1-sgml \ - 4.1.2-xml \ - 4.2-sgml \ - 4.2-xml \ - 4.3-sgml \ - 4.3-xml \ - 4.4-sgml \ - 4.4-xml \ - 4.5-sgml \ - 4.5-xml - # remove entries only on removal of package if [ "$1" = 0 ]; then @@ -285,5 +276,4 @@ packages fi end end - end