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
Version: 1.0
Release: 52%{?dist}
Release: 53%{?dist}
Group: Applications/Text
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(postun): /usr/bin/xmlcatalog
Requires(post): /bin/chmod
Requires(post): sed
Requires(postun): sed
Requires: sgml-common
Requires: xml-common
@ -185,7 +187,7 @@ rm -rf $RPM_BUILD_ROOT
# Symlinks
mkdir -p $RPM_BUILD_ROOT/etc/sgml
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
done
@ -193,8 +195,8 @@ eval set %{version_list}
for dir
do
cd $dir
fmt=${dir#*-} vvr=${dir%%-*}-%{version}-%{release}
DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/docbook/$fmt-dtd-$vvr
fmt=${dir#*-} ver=${dir%%-*}
DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/docbook/$fmt-dtd-$ver
case $fmt in
sgml) mkdir -p $DESTDIR ; install *.dcl $DESTDIR ;;
xml) mkdir -p $DESTDIR/ent ; install ent/* $DESTDIR/ent ;;
@ -203,7 +205,7 @@ do
install docbook.cat $DESTDIR/catalog
cd ..
# File for %%ghost
touch $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook-$vvr.cat
touch $RPM_BUILD_ROOT/etc/sgml/$fmt-docbook-$ver.cat
done
@ -216,10 +218,9 @@ rm -rf $RPM_BUILD_ROOT
#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
%doc --parents 3.1-sgml/ChangeLog 4.1-sgml/ChangeLog */*.txt
%config(noreplace) /etc/sgml/sgml-docbook.cat
%config(noreplace) /etc/sgml/xml-docbook.cat
/usr/share/sgml/docbook/*ml-dtd-*-%{version}-%{release}
%ghost %config(noreplace) /etc/sgml/*ml-docbook-*-%{version}-%{release}.cat
/usr/share/sgml/docbook/*ml-dtd-*
%config(noreplace) /etc/sgml/*ml-docbook.cat
%ghost %config(noreplace) /etc/sgml/*ml-docbook-*.cat
%post
@ -245,12 +246,12 @@ esac
eval set %{version_list}
for dir
do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr
fmt=${dir#*-} ver=${dir%%-*}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$ver
## 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 $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
## XML catalog
if [ $fmt = xml -a -w $xmlcatalog ]; then
@ -320,9 +321,11 @@ sed -ni '
/bin/chmod a+r /etc/sgml/*
%postun
catcmd='/usr/bin/xmlcatalog --noout'
xmlcatalog=/usr/share/sgml/docbook/xmlcatalog
entities="
# remove entries only on removal of package
if [ "$1" = 0 ]; then
catcmd='/usr/bin/xmlcatalog --noout'
xmlcatalog=/usr/share/sgml/docbook/xmlcatalog
entities="
ent/iso-pub.ent
ent/iso-grk1.ent
dbpoolx.mod
@ -350,42 +353,43 @@ ent/iso-amsb.ent
ent/iso-lat2.ent
ent/iso-amsr.ent
ent/iso-cyr2.ent
"
eval set %{version_list}
for dir
do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$vvr
## SGML catalog
# Update the centralized catalog corresponding to this version of the DTD
$catcmd --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$vvr.cat
rm -f /etc/sgml/$fmt-docbook-$vvr.cat
## XML catalog
if [ $fmt = xml -a -w $xmlcatalog ]; then
for f in $entities; do
case $ver in 4.[45]) f=${f/-/} ;; esac
$catcmd --del $sgmldir/$f $xmlcatalog
done
$catcmd --del $sgmldir $xmlcatalog
fi
done
"
eval set %{version_list}
for dir
do
fmt=${dir#*-} ver=${dir%%-*}
sgmldir=/usr/share/sgml/docbook/$fmt-dtd-$ver
## SGML catalog
# Update the centralized catalog corresponding to this version of the DTD
$catcmd --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$ver.cat
rm -f /etc/sgml/$fmt-docbook-$ver.cat
## XML catalog
if [ $fmt = xml -a -w $xmlcatalog ]; then
for f in $entities; do
case $ver in 4.[45]) f=${f/-/} ;; esac
$catcmd --del $sgmldir/$f $xmlcatalog
done
$catcmd --del $sgmldir $xmlcatalog
fi
done
# See the comment attached to this command in the %%post scriptlet.
sed -ni '
# See the comment attached to this command in the %%post scriptlet.
sed -ni '
/xml-docbook/ H
/xml-docbook/ !p
$ {
g
s/^\n//p
}
' /etc/sgml/catalog
' /etc/sgml/catalog
fi
%triggerin -- openjade >= %{openjadever}
eval set %{version_list}
for dir
do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
/usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$vvr.cat \
fmt=${dir#*-} ver=${dir%%-*}
/usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/$fmt-docbook-$ver.cat \
/usr/share/sgml/openjade-%{openjadever}/catalog
done
@ -394,12 +398,16 @@ done
eval set %{version_list}
for dir
do
fmt=${dir#*-} ver=${dir%%-*} vvr=$ver-%{version}-%{release}
/usr/bin/xmlcatalog --sgml --noout --del /etc/sgml/$fmt-docbook-$vvr.cat \
fmt=${dir#*-} ver=${dir%%-*}
/usr/bin/xmlcatalog --sgml --noout --del /etc/sgml/$fmt-docbook-$ver.cat \
/usr/share/sgml/openjade-%{openjadever}/catalog
done
%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
- remove explicit lib dependency (#225700)