From 67c659d6fb02d9d6414f307714221f199f1076a6 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:46:06 +0100 Subject: [PATCH] don't own /etc/xml/catalog and update it in %post script [release 0.6.3-4mamba;Fri May 02 2014] --- README.md | 3 + html.dcl | 88 ++++++++++++++++ html.soc | 31 ++++++ sgml-common-0.6.3-docdir.patch | 11 ++ sgml-common-CHANGES | 15 +++ sgml-common-automake.patch | 6 ++ sgml-common-quotes.patch | 94 +++++++++++++++++ sgml-common-umask.patch | 12 +++ sgml-common-xmldir.patch | 8 ++ sgml-common.spec | 150 +++++++++++++++++++++++++++ xml.dcl | 179 +++++++++++++++++++++++++++++++++ xml.soc | 1 + 12 files changed, 598 insertions(+) create mode 100644 html.dcl create mode 100644 html.soc create mode 100644 sgml-common-0.6.3-docdir.patch create mode 100644 sgml-common-CHANGES create mode 100644 sgml-common-automake.patch create mode 100644 sgml-common-quotes.patch create mode 100644 sgml-common-umask.patch create mode 100644 sgml-common-xmldir.patch create mode 100644 sgml-common.spec create mode 100644 xml.dcl create mode 100644 xml.soc diff --git a/README.md b/README.md index 51376dc..5b5b2c9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # sgml-common +The sgml-common package contains a collection of entities and DTDs that are useful for processing SGML, but that don't need to be included in multiple packages. +Sgml-common also includes an up-to-date Open Catalog file. + diff --git a/html.dcl b/html.dcl new file mode 100644 index 0000000..c1545df --- /dev/null +++ b/html.dcl @@ -0,0 +1,88 @@ + + diff --git a/html.soc b/html.soc new file mode 100644 index 0000000..0e9c836 --- /dev/null +++ b/html.soc @@ -0,0 +1,31 @@ + -- catalog: SGML Open style entity catalog for HTML -- + -- $Id: html.soc,v 1.1.1.2 1999/05/02 15:41:46 Avi Exp $ -- + -- Hacked by jjc -- + + -- Ways to refer to Level 2: most general to most specific -- +PUBLIC "-//IETF//DTD HTML//EN" html.dtd +PUBLIC "-//IETF//DTD HTML 2.0//EN" html.dtd +PUBLIC "-//IETF//DTD HTML Level 2//EN" html.dtd +PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN" html.dtd + + -- Ways to refer to Level 1: most general to most specific -- +PUBLIC "-//IETF//DTD HTML Level 1//EN" html-1.dtd +PUBLIC "-//IETF//DTD HTML 2.0 Level 1//EN" html-1.dtd + + -- Ways to refer to + Strict Level 2: most general to most specific -- +PUBLIC "-//IETF//DTD HTML Strict//EN" html-s.dtd +PUBLIC "-//IETF//DTD HTML 2.0 Strict//EN" html-s.dtd +PUBLIC "-//IETF//DTD HTML Strict Level 2//EN" html-s.dtd +PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//EN" html-s.dtd + + -- Ways to refer to + Strict Level 1: most general to most specific -- +PUBLIC "-//IETF//DTD HTML Strict Level 1//EN" html-1s.dtd +PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN" html-1s.dtd + + -- ISO latin 1 entity set for HTML -- +PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML" ISOlat1.sgm + +SGMLDECL html.dcl +DOCTYPE html html.dtd diff --git a/sgml-common-0.6.3-docdir.patch b/sgml-common-0.6.3-docdir.patch new file mode 100644 index 0000000..fc960ad --- /dev/null +++ b/sgml-common-0.6.3-docdir.patch @@ -0,0 +1,11 @@ +--- sgml-common-0.6.3/configure.in.docdir 2002-10-23 12:07:31.000000000 +0100 ++++ sgml-common-0.6.3/configure.in 2002-10-23 12:08:10.000000000 +0100 +@@ -4,6 +4,8 @@ + AM_INIT_AUTOMAKE(sgml-common, 0.6.3) + + docdir='$(prefix)/doc' ++AC_ARG_WITH(docdir, [ -with-docdir=DOCDIR documentation directory], ++ docdir=$withval) + AC_SUBST(docdir) + + dnl Checks for programs. diff --git a/sgml-common-CHANGES b/sgml-common-CHANGES new file mode 100644 index 0000000..cccc290 --- /dev/null +++ b/sgml-common-CHANGES @@ -0,0 +1,15 @@ + o Linux Standard Base SGML & XML adherence -- DocBook packages + which adhere to the LSB addendum concerning SGML & XML are now + included. This means that catalog files are now located in a + different place than they were in previous releases. + + There is now a super catalog, /etc/sgml/catalog, which contains + entries for a number of centralised catalogs, in /etc/sgml. The + centralised catalogs contain entries for DTD-specific files, + which are located in subdirectories in /usr/share/sgml (instead + of /usr/lib/sgml as in previous releases). + + The utility names for converting DocBook documents to other + formats are now named (for example) docbook2ps instead of db2ps; + the old names are provided for compatibility with previous + releases, but may be removed at a future date. diff --git a/sgml-common-automake.patch b/sgml-common-automake.patch new file mode 100644 index 0000000..034af8d --- /dev/null +++ b/sgml-common-automake.patch @@ -0,0 +1,6 @@ +--- sgml-common-0.6.3/doc/man/Makefile.am.automake Wed Apr 24 11:58:17 2002 ++++ sgml-common-0.6.3/doc/man/Makefile.am Wed Apr 24 11:59:02 2002 +@@ -1,2 +1,2 @@ + man8dir = $(mandir)/man8 +-man8_DATA = *.8 ++man8_MANS = install-catalog.8 diff --git a/sgml-common-quotes.patch b/sgml-common-quotes.patch new file mode 100644 index 0000000..c901b9e --- /dev/null +++ b/sgml-common-quotes.patch @@ -0,0 +1,94 @@ +--- sgml-common-0.6.3/bin/install-catalog.in.quotes Mon Nov 5 11:19:23 2001 ++++ sgml-common-0.6.3/bin/install-catalog.in Mon Nov 5 11:20:12 2001 +@@ -39,8 +39,8 @@ + # Process actions + case $1 in + -a|--add) SGML_ACTION="addition" +- SGML_CENTRALIZED=$2 +- SGML_ORDINARY=$3 ++ SGML_CENTRALIZED="$2" ++ SGML_ORDINARY="$3" + ;; + -r|--remove) if [ -z "$3" -o "$3" = "--version" ] + then +@@ -48,8 +48,8 @@ + exit 0 + fi + SGML_ACTION="removal" +- SGML_CENTRALIZED=$2 +- SGML_ORDINARY=$3 ++ SGML_CENTRALIZED="$2" ++ SGML_ORDINARY="$3" + ;; + -h|--help) echo -e $SGML_HELP_MESSAGE + exit 0 +@@ -96,14 +96,14 @@ + fi + case $SGML_ACTION in + addition) +- if [ -e $SGML_CENTRALIZED -a ! -w $SGML_CENTRALIZED ] ++ if [ -e "$SGML_CENTRALIZED" -a ! -w "$SGML_CENTRALIZED" ] + then + echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2 + exit 2 + fi + ;; + removal) +- if [ ! -w $SGML_CENTRALIZED ] ++ if [ ! -w "$SGML_CENTRALIZED" ] + then + echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2 + exit 2 +@@ -119,7 +119,7 @@ + fi + case $SGML_ACTION in + addition) +- if [ ! -s $SGML_ORDINARY ] ++ if [ ! -s "$SGML_ORDINARY" ] + then + echo "`basename $0`: \"$SGML_ORDINARY\" does not exist or is empty." >&2 + exit 2 +@@ -131,33 +131,33 @@ + case $SGML_ACTION in + addition) + echo "`basename $0`: addition of $SGML_ORDINARY in $SGML_CENTRALIZED" +- if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null ++ if grep -q "$SGML_ORDINARY" "$SGML_CENTRALIZED" 2>/dev/null + then + echo "Warning: $SGML_ORDINARY is already installed in the centralized catalog $SGML_CENTRALIZED" >&2 + else +- echo "$SGML_POINTER $SGML_ORDINARY" >> $SGML_CENTRALIZED ++ echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> "$SGML_CENTRALIZED" + fi +- grep -q $SGML_CENTRALIZED /etc/sgml/catalog 2>/dev/null ++ grep -q "$SGML_CENTRALIZED" /etc/sgml/catalog 2>/dev/null + if [ $? -ne 0 ] + then + echo "`basename $0`: addition of $SGML_CENTRALIZED in /etc/sgml/catalog" +- echo "$SGML_POINTER $SGML_CENTRALIZED" >> /etc/sgml/catalog ++ echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> /etc/sgml/catalog + fi + ;; + removal) + echo "`basename $0`: removal of $SGML_ORDINARY from $SGML_CENTRALIZED" +- if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null ++ if grep -q "$SGML_ORDINARY" "$SGML_CENTRALIZED" 2>/dev/null + then +- sed -e "\:$SGML_POINTER $SGML_ORDINARY:d" < $SGML_CENTRALIZED > ${SGML_CENTRALIZED}.new +- mv ${SGML_CENTRALIZED}.new $SGML_CENTRALIZED ++ sed -e "\:$SGML_POINTER \"\\?$SGML_ORDINARY\"\\?:d" < "$SGML_CENTRALIZED" > "${SGML_CENTRALIZED}.new" ++ mv "${SGML_CENTRALIZED}.new" "$SGML_CENTRALIZED" + else + echo "Warning: $SGML_ORDINARY was not found in the centralized catalog $SGML_CENTRALIZED" >&2 + fi +- if [ ! -s $SGML_CENTRALIZED ] ++ if [ ! -s "$SGML_CENTRALIZED" ] + then +- rm $SGML_CENTRALIZED ++ rm "$SGML_CENTRALIZED" + echo "`basename $0`: removal of $SGML_CENTRALIZED from /etc/sgml/catalog" +- sed -e "\:$SGML_POINTER $SGML_CENTRALIZED:d" < /etc/sgml/catalog > /etc/sgml/catalog.new ++ sed -e "\:$SGML_POINTER \"\\?$SGML_CENTRALIZED\"\\?:d" < /etc/sgml/catalog > /etc/sgml/catalog.new + mv /etc/sgml/catalog.new /etc/sgml/catalog + fi + ;; diff --git a/sgml-common-umask.patch b/sgml-common-umask.patch new file mode 100644 index 0000000..ce13a15 --- /dev/null +++ b/sgml-common-umask.patch @@ -0,0 +1,12 @@ +--- sgml-common-0.6.3/bin/install-catalog.in.umask Mon May 21 11:48:37 2001 ++++ sgml-common-0.6.3/bin/install-catalog.in Mon May 21 12:00:34 2001 +@@ -13,6 +13,9 @@ + \040 -h, --help: \t\t\t\t Print this help message and exit\n\ + \040 -v, --version: \t\t\t Print the version number and exit\n" + ++# We need the files we create to be world readable ++umask 022 ++ + # Set version message + SGML_VERSION_MESSAGE="sgml-common version 0.2 (install-catalog version 1.0)" + diff --git a/sgml-common-xmldir.patch b/sgml-common-xmldir.patch new file mode 100644 index 0000000..b7b6abb --- /dev/null +++ b/sgml-common-xmldir.patch @@ -0,0 +1,8 @@ +--- sgml-common-0.6.3/xml-iso-entities/Makefile.am.xmldir Fri Oct 5 16:37:43 2001 ++++ sgml-common-0.6.3/xml-iso-entities/Makefile.am Fri Oct 5 16:37:57 2001 +@@ -1,4 +1,4 @@ +-isoentdir = $(prefix)/share/sgml/xml-iso-entities-8879.1986 ++isoentdir = $(prefix)/share/xml/xml-iso-entities-8879.1986 + isoent_DATA = ISOamsa.ent ISOamsb.ent ISOamsc.ent ISOamsn.ent ISOamso.ent ISOamsr.ent \ + ISObox.ent ISOcyr1.ent ISOcyr2.ent ISOdia.ent ISOgrk1.ent ISOgrk2.ent \ + ISOgrk3.ent ISOgrk4.ent ISOlat1.ent ISOlat2.ent ISOnum.ent ISOpub.ent \ diff --git a/sgml-common.spec b/sgml-common.spec new file mode 100644 index 0000000..6e532a5 --- /dev/null +++ b/sgml-common.spec @@ -0,0 +1,150 @@ +Name: sgml-common +Version: 0.6.3 +Release: 4mamba +Summary: Common SGML catalog and DTD files +Group: Applications/Text +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.iso.ch/cate/3524030.html +Source0: ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/%{name}-%{version}.tgz +Source1: sgml-common-CHANGES +Source2: sgml-common-automake.tar.gz +Source3: xml.dcl +Source4: xml.soc +Source5: html.dcl +Source6: html.soc +Patch0: sgml-common-umask.patch +Patch1: sgml-common-xmldir.patch +Patch2: sgml-common-quotes.patch +Patch3: sgml-common-automake.patch +Patch4: sgml-common-0.6.3-docdir.patch +License: GPL +## AUTOBUILDREQ-BEGIN +## AUTOBUILDREQ-END +BuildRequires: libxml2 >= 2.6.17 +#Requires: sh-utils fileutils textutils grep +BuildRoot: %{_tmppath}/%{name}-%{version}-root +# From openjade: + +%description +The sgml-common package contains a collection of entities and DTDs that are useful for processing SGML, but that don't need to be included in multiple packages. +Sgml-common also includes an up-to-date Open Catalog file. + +%package -n xml-common +Group: Applications/Text +Summary: Common XML catalog and DTD files. +License: GPL +URL: http://www.iso.ch/cate/3524030.html +#Requires: #sh-utils fileutils textutils grep + +%description -n xml-common +The xml-common package contains a collection of entities and DTDs that are useful for processing XML, but that don't need to be included in multiple packages. + + +%prep +%setup -q +%patch0 -p1 -b .umask +%patch1 -p1 -b .xmldir +%patch2 -p1 -b .quotes +rm install-sh missing mkinstalldirs +tar zxf %{SOURCE2} +%patch3 -p1 -b .automake +%patch4 -p1 -b .docdir +aclocal +automake --add-missing --copy + +%build +%configure \ + --with-docdir=%{_docdir} + +%install +DESTDIR=%{buildroot} +rm -rf $DESTDIR +%makeinstall docdir=%{_docdir} top_builddir=`pwd` +cp %{SOURCE1} CHANGES +mkdir %{buildroot}/etc/xml +mkdir %{buildroot}/usr/share/sgml/docbook + +rm -f %{buildroot}/usr/share/sgml/xml.dcl +install -m0644 %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} \ + %{buildroot}/usr/share/sgml +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"/usr/share/xml/* + +%clean +DESTDIR=%{buildroot} +rm -rf $DESTDIR + +%post -n xml-common +if [ $1 -ge 1 ]; then + # Create an empty XML catalog. + XMLCATALOG=/etc/xml/catalog + [ -e $XMLCATALOG ] || /usr/bin/xmlcatalog --noout --create $XMLCATALOG + + # Now put the common DocBook entries in it + /usr/bin/xmlcatalog --noout --add "delegatePublic" \ + "-//OASIS//ENTITIES DocBook XML" \ + "file:///usr/share/sgml/docbook/xmlcatalog" $XMLCATALOG + /usr/bin/xmlcatalog --noout --add "delegatePublic" \ + "-//OASIS//DTD DocBook XML" \ + "file:///usr/share/sgml/docbook/xmlcatalog" $XMLCATALOG + /usr/bin/xmlcatalog --noout --add "delegatePublic" \ + "ISO 8879:1986" \ + "file:///usr/share/sgml/docbook/xmlcatalog" $XMLCATALOG + /usr/bin/xmlcatalog --noout --add "delegateSystem" \ + "http://www.oasis-open.org/docbook/" \ + "file:///usr/share/sgml/docbook/xmlcatalog" $XMLCATALOG + /usr/bin/xmlcatalog --noout --add "delegateURI" \ + "http://www.oasis-open.org/docbook/" \ + "file:///usr/share/sgml/docbook/xmlcatalog" $XMLCATALOG + + # Also create the common DocBook catalog + [ -e /usr/share/sgml/docbook/xmlcatalog ] || \ + /usr/bin/xmlcatalog --noout --create \ + %{_datadir}/sgml/docbook/xmlcatalog +fi +: + +%posttrans -n xml-common +[ -e /etc/xml/catalog.rpmsave -a ! -e /etc/xml/catalog ] && \ + mv /etc/xml/catalog.rpmsave /etc/xml/catalog +: + +%files +%defattr (-,root,root) +%dir %{_sysconfdir}/sgml +%config(noreplace) %{_sysconfdir}/sgml/sgml.conf +%dir %{_datadir}/sgml +%dir %{_datadir}/sgml/sgml-iso-entities-8879.1986 +%{_datadir}/sgml/sgml-iso-entities-8879.1986/* +%{_datadir}/sgml/xml.dcl +%{_datadir}/sgml/xml.soc +%{_datadir}/sgml/html.dcl +%{_datadir}/sgml/html.soc +%{_bindir}/sgmlwhich +%{_bindir}/install-catalog +%{_mandir}/*/* +%{_datadir}/doc/%{name}-%{version}/html/* + +%files -n xml-common +%defattr (-,root,root) +%dir %{_sysconfdir}/xml +%dir %{_datadir}/sgml +%dir %{_datadir}/sgml/docbook +%dir %{_datadir}/xml + +%changelog +* Fri May 02 2014 Silvan Calarco 0.6.3-4mamba +- don't own /etc/xml/catalog and update it in %post script + +* Tue Aug 27 2013 Automatic Build System 0.6.3-3mamba +- automatic rebuild by autodist + +* Tue Sep 23 2008 Silvan Calarco 0.6.3-2mamba +- specfile updated + +* Sun Feb 27 2005 Silvan Calarco 0.6.3-2qilnx +- rebuilt and moved to devel repository + +* Thu Sep 23 2004 Matteo Bernasconi 0.6.3-1qilnx +- First Build diff --git a/xml.dcl b/xml.dcl new file mode 100644 index 0000000..fed2103 --- /dev/null +++ b/xml.dcl @@ -0,0 +1,179 @@ +" + PIC "?>" + SHORTREF NONE + + NAMES + SGMLREF + + QUANTITY NONE + + ENTITIES + "amp" 38 + "lt" 60 + "gt" 62 + "quot" 34 + "apos" 39 + + FEATURES + MINIMIZE + DATATAG NO + OMITTAG NO + RANK NO + SHORTTAG + STARTTAG + EMPTY NO + UNCLOSED NO + NETENABL IMMEDNET + ENDTAG + EMPTY NO + UNCLOSED NO + ATTRIB + DEFAULT YES + OMITNAME NO + VALUE NO + EMPTYNRM YES + IMPLYDEF + ATTLIST NO + DOCTYPE NO + ELEMENT NO + ENTITY NO + NOTATION NO + LINK + SIMPLE NO + IMPLICIT NO + EXPLICIT NO + OTHER + CONCUR NO + SUBDOC NO + FORMAL NO + URN NO + KEEPRSRE YES + VALIDITY TYPE + ENTITIES + REF ANY + INTEGRAL YES + APPINFO NONE + SEEALSO "ISO 8879:1986//NOTATION + Extensible Markup Language (XML) 1.0//EN" +> diff --git a/xml.soc b/xml.soc new file mode 100644 index 0000000..278c6f3 --- /dev/null +++ b/xml.soc @@ -0,0 +1 @@ +SGMLDECL "xml.dcl"