post and postun scriptlet requires sed (#593078), use standard locations

for catalog.xml(#591173)
This commit is contained in:
Ondrej Vasik 2010-05-18 15:02:49 +00:00
parent fd4324cbd1
commit b98b72be62

View File

@ -3,7 +3,7 @@
Name: docbook-dtds Name: docbook-dtds
Version: 1.0 Version: 1.0
Release: 52%{?dist} Release: 53%{?dist}
Group: Applications/Text Group: Applications/Text
Summary: SGML and XML document type definitions for DocBook Summary: SGML and XML document type definitions for DocBook
@ -36,6 +36,8 @@ Provides: docbook-dtd45-xml = %{version}-%{release}
Requires(post): /usr/bin/xmlcatalog Requires(post): /usr/bin/xmlcatalog
Requires(postun): /usr/bin/xmlcatalog Requires(postun): /usr/bin/xmlcatalog
Requires(post): /bin/chmod Requires(post): /bin/chmod
Requires(post): sed
Requires(postun): sed
Requires: sgml-common Requires: sgml-common
Requires: xml-common Requires: xml-common
@ -185,7 +187,7 @@ rm -rf $RPM_BUILD_ROOT
# Symlinks # Symlinks
mkdir -p $RPM_BUILD_ROOT/etc/sgml mkdir -p $RPM_BUILD_ROOT/etc/sgml
for fmt in sgml xml; do for fmt in sgml xml; do
ln -s $fmt-docbook-4.5-%{version}-%{release}.cat \ ln -s $fmt-docbook-4.5.cat \
$RPM_BUILD_ROOT/etc/sgml/$fmt-docbook.cat $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook.cat
done done
@ -193,8 +195,8 @@ eval set %{version_list}
for dir for dir
do do
cd $dir cd $dir
fmt=${dir#*-} vvr=${dir%%-*}-%{version}-%{release} fmt=${dir#*-} ver=${dir%%-*}
DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/docbook/$fmt-dtd-$vvr DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/docbook/$fmt-dtd-$ver
case $fmt in case $fmt in
sgml) mkdir -p $DESTDIR ; install *.dcl $DESTDIR ;; sgml) mkdir -p $DESTDIR ; install *.dcl $DESTDIR ;;
xml) mkdir -p $DESTDIR/ent ; install ent/* $DESTDIR/ent ;; xml) mkdir -p $DESTDIR/ent ; install ent/* $DESTDIR/ent ;;
@ -203,7 +205,7 @@ do
install docbook.cat $DESTDIR/catalog install docbook.cat $DESTDIR/catalog
cd .. cd ..
# File for %%ghost # File for %%ghost
touch $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook-$vvr.cat touch $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook-$ver.cat
done done
@ -216,10 +218,9 @@ rm -rf $RPM_BUILD_ROOT
#in upstream tarballs there is a lot of files with 0755 permissions #in upstream tarballs there is a lot of files with 0755 permissions
#but they don't need to be, 0644 is enough for every file in tarball #but they don't need to be, 0644 is enough for every file in tarball
%doc --parents 3.1-sgml/ChangeLog 4.1-sgml/ChangeLog */*.txt %doc --parents 3.1-sgml/ChangeLog 4.1-sgml/ChangeLog */*.txt
%config(noreplace) /etc/sgml/sgml-docbook.cat /usr/share/sgml/docbook/*ml-dtd-*
%config(noreplace) /etc/sgml/xml-docbook.cat %config(noreplace) /etc/sgml/*ml-docbook.cat
/usr/share/sgml/docbook/*ml-dtd-*-%{version}-%{release} %ghost %config(noreplace) /etc/sgml/*ml-docbook-*.cat
%ghost %config(noreplace) /etc/sgml/*ml-docbook-*-%{version}-%{release}.cat
%post %post
@ -245,12 +246,12 @@ esac
eval set %{version_list} eval set %{version_list}
for dir for dir
do do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release} fmt=${dir#*-} ver=${dir%%-*}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$ver
## SGML catalog ## SGML catalog
# Update the centralized catalog corresponding to this version of the DTD # Update the centralized catalog corresponding to this version of the DTD
for cat_dir in /usr/share/sgml/sgml-iso-entities-8879.1986 $sgmldir $STYLESHEETS; do for cat_dir in /usr/share/sgml/sgml-iso-entities-8879.1986 $sgmldir $STYLESHEETS; do
$catcmd --sgml --add /etc/sgml/$fmt-docbook-$vvr.cat $cat_dir/catalog $catcmd --sgml --add /etc/sgml/$fmt-docbook-$ver.cat $cat_dir/catalog
done done
## XML catalog ## XML catalog
if [ $fmt = xml -a -w $xmlcatalog ]; then if [ $fmt = xml -a -w $xmlcatalog ]; then
@ -320,9 +321,11 @@ sed -ni '
/bin/chmod a+r /etc/sgml/* /bin/chmod a+r /etc/sgml/*
%postun %postun
catcmd='/usr/bin/xmlcatalog --noout' # remove entries only on removal of package
xmlcatalog=/usr/share/sgml/docbook/xmlcatalog if [ "$1" = 0 ]; then
entities=" catcmd='/usr/bin/xmlcatalog --noout'
xmlcatalog=/usr/share/sgml/docbook/xmlcatalog
entities="
ent/iso-pub.ent ent/iso-pub.ent
ent/iso-grk1.ent ent/iso-grk1.ent
dbpoolx.mod dbpoolx.mod
@ -350,42 +353,43 @@ ent/iso-amsb.ent
ent/iso-lat2.ent ent/iso-lat2.ent
ent/iso-amsr.ent ent/iso-amsr.ent
ent/iso-cyr2.ent ent/iso-cyr2.ent
" "
eval set %{version_list} eval set %{version_list}
for dir for dir
do do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release} fmt=${dir#*-} ver=${dir%%-*}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$ver
## SGML catalog ## SGML catalog
# Update the centralized catalog corresponding to this version of the DTD # Update the centralized catalog corresponding to this version of the DTD
$catcmd --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$vvr.cat $catcmd --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$ver.cat
rm -f /etc/sgml/$fmt-docbook-$vvr.cat rm -f /etc/sgml/$fmt-docbook-$ver.cat
## XML catalog ## XML catalog
if [ $fmt = xml -a -w $xmlcatalog ]; then if [ $fmt = xml -a -w $xmlcatalog ]; then
for f in $entities; do for f in $entities; do
case $ver in 4.[45]) f=${f/-/} ;; esac case $ver in 4.[45]) f=${f/-/} ;; esac
$catcmd --del $sgmldir/$f $xmlcatalog $catcmd --del $sgmldir/$f $xmlcatalog
done done
$catcmd --del $sgmldir $xmlcatalog $catcmd --del $sgmldir $xmlcatalog
fi fi
done done
# See the comment attached to this command in the %%post scriptlet. # See the comment attached to this command in the %%post scriptlet.
sed -ni ' sed -ni '
/xml-docbook/ H /xml-docbook/ H
/xml-docbook/ !p /xml-docbook/ !p
$ { $ {
g g
s/^\n//p s/^\n//p
} }
' /etc/sgml/catalog ' /etc/sgml/catalog
fi
%triggerin -- openjade >= %{openjadever} %triggerin -- openjade >= %{openjadever}
eval set %{version_list} eval set %{version_list}
for dir for dir
do do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release} fmt=${dir#*-} ver=${dir%%-*}
/usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$vvr.cat \ /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$ver.cat \
/usr/share/sgml/openjade-%{openjadever}/catalog /usr/share/sgml/openjade-%{openjadever}/catalog
done done
@ -394,12 +398,16 @@ done
eval set %{version_list} eval set %{version_list}
for dir for dir
do do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release} fmt=${dir#*-} ver=${dir%%-*}
/usr/bin/xmlcatalog --sgml --noout --del /etc/sgml/$fmt-docbook-$vvr.cat \ /usr/bin/xmlcatalog --sgml --noout --del /etc/sgml/$fmt-docbook-$ver.cat \
/usr/share/sgml/openjade-%{openjadever}/catalog /usr/share/sgml/openjade-%{openjadever}/catalog
done done
%changelog %changelog
* Tue May 18 2010 Ondrej Vasik <ovasik@redhat.com> - 1.0-53
- post and postun scriptlet requires sed (#593078)
- use standard locations for catalog.xml(#591173)
* Wed Mar 03 2010 Ondrej Vasik <ovasik@redhat.com> - 1.0-52 * Wed Mar 03 2010 Ondrej Vasik <ovasik@redhat.com> - 1.0-52
- remove explicit lib dependency (#225700) - remove explicit lib dependency (#225700)