info sgml-common.spec
ziembor@FAQ-bot.ZiemBor.Waw.PL
ziembor w FAQ-bot.ZiemBor.Waw.PL
Pon, 28 Wrz 1998, 12:16:30 CEST
byc moze wartoby zmienic troche skrypt... ale ogolnie ready.
-------------- następna część ---------
Summary: Common SGML catalog and DTD files
Summary(pl): Opisane w normie ISO 8879/1986 katalogi i DTD SGMLowe
Name: sgml-common
version: 0.0
release: 6
Vendor: Cygnus Solutions -- UNSUPPORTED
URL: ftp://ftp.ifi.uio.no/pub/SGML/ENTITIES
Source: sgml-common.tgz
Copyright: (C) International Organization for Standardization 1986
Group: Utilities/Text/SGML
BuildArchitectures: noarch
provides: iso-entitles, iso-entities-8879.1986, sgml-catalog
BuildRoot: /tmp/%{name}-%{version}-%{release}-root
%define sgmlbase /usr
%description
sgml-common is a collection of entities and dtds that are useful for
SGML processing, but shouldn't need to be included in multiple packages.
It also includes an up-to-date Open Catalog file.
%description -l pl
sgml-common jest zestawem wspólnych dla wiekszości aplikacji SGMLa
(bo opisanych w normie ISO 8879/1986) encji i DTD.
Poza tym zawiera aktualizowany przy dodawaniu nowych pakietów
plik CATALOG oraz instalator nowych DTD.
%prep
%setup -c -q
%build
gawk --posix '/Typical invocation:/,/\-\-\>/ { print }' sgml-common/* |
gawk --posix '/PUBLIC/ { sys=$3 }
/8879:1986.*\"\>/ { saveline=""; print "PUBLIC " $0 " " sys; next }
/8879:1986[^>]*$/ { saveline = $0; next }
/\"\>/ { print "PUBLIC " saveline $0 " " sys; saveline="";next }
' |
sed 's/\">/\"/' > newcat
cat > install-catalog << '__EOF__'
#!/bin/bash
set -e
sgmlbase=/usr/share/sgml
state=""
package=""
version=""
for i in $*; do
case $state in
"")
case $i in
--install) state="--install" ; action="install";;
--remove) state="--remove" ; action="remove";;
--sgmlbase) state="--sgmlbase" ;;
--version) state="--version" ;;
*) cat <<__USAGE__
Usage:
--install pkg: installs pkg.cat in CATALOG
--remove pkg: removes pkg.cat from CATALOG
--version ver: qualify version of package
--sgmlbase path: changes directory for pkg.cat and CATALOG
__USAGE__
exit 0
;;
esac
;;
--install) state="" ; package=$i ;;
--remove) state="" ; package=$i ;;
--sgmlbase) state="" ; sgmlbase=$i;;
--version) state="" ; version=$i ;;
esac
done
echo "install-catalog: $action of $package DTD"
cat=$sgmlbase/CATALOG
SBEG=" -- start $package $version"
SEND=" -- end $package $version"
case $action in
install)
if grep -q "$SBEG" $cat
then
echo "$package DTD already in catalog"
else
echo "adding $package DTD to catalog"
(echo "$SBEG -- ";
cat $sgmlbase/$package.cat ;
echo "$SEND -- ") >> $cat
fi
;;
remove)
if grep -q "$SBEG" $cat
then
echo "removing $package$version DTD from catalog"
sed -e "/$SBEG/,/$SEND/d" < $cat > ${cat}.new
mv ${cat}.new ${cat}
else
echo "No $package$version DTD found in catalog"
fi
;;
*) echo "install-catalog: Invalid action $action"; exit 1 ;;
esac
__EOF__
chmod +x install-catalog
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share/sgml/iso-entities-8879.1986
install sgml-common/* $RPM_BUILD_ROOT/usr/share/sgml/iso-entities-8879.1986
perl -pe 's#(.+?) "(.+?)" (.+?)#$1 "$2" iso-entities-8879.1986/$3#' newcat > $RPM_BUILD_ROOT/usr/share/sgml/sgml-common.cat
touch $RPM_BUILD_ROOT/usr/share/sgml/CATALOG
mkdir -p $RPM_BUILD_ROOT/usr/bin
cp install-catalog $RPM_BUILD_ROOT/usr/bin
%post
touch /usr/share/sgml/CATALOG
# since old-postun is run *after* new-post, we must always cycle.
V=%{version}-%{release}
install-catalog --install sgml-common --version $V
%preun
# since old-postun is run *after* new-post, we must always cycle.
V=%{version}-%{release}
install-catalog --remove sgml-common --version $V
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644, root, root, 755)
/usr/share/sgml/iso-entities-8879.1986
/usr/share/sgml/*.cat
%attr(0755, root, root) /usr/bin/install-catalog
#%ghost %config /usr/share/sgml/CATALOG
%changelog
* Sun Sep 28 1998 Ziemek Borowski <ziembor w faq-bot.ziembor.waw.pl>
[0.0-6]
- moved ISO-entitles to subdirectory
* Mon Sep 07 1998 Ziemek Borowski <ziembor w faq-bot.ziembor.waw.pl>
[0.0-5]
- added Polish .spec translation
- relocated libraries to /usr/share
- normalized .spec
* Mon Sep 07 1998 Mark Galassi <rosalia w cygnus.com>
[0.0-4]
- first release
Więcej informacji o liście dyskusyjnej pld-devel-pl