sgml-common/sgml-common.spec

224 lines
7.6 KiB
RPMSpec

%global xmlxsdver 2009/01
Name: sgml-common
Version: 0.6.3
Release: 6mamba
Summary: Common SGML catalog and DTD files
Group: Applications/Text
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://www.iso.org/cate/3524030.html
Source0: ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/%{name}-%{version}.tgz
Source1: xml.dcl
Source2: xml.soc
Source3: html.dcl
Source4: html.soc
Source5: http://www.w3.org/%{xmlxsdver}/xml.xsd
Source6: http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd
Source7: http://www.w3.org/2001/XMLSchema.dtd
Source8: http://www.w3.org/2001/datatypes.dtd
Source9: sgmlwhich.1
Source10: sgml.conf.5
Source20: sgml-common-CHANGES
Source21: sgml-common-automake.tar.gz
Patch0: sgml-common-umask.patch
Patch1: sgml-common-xmldir.patch
Patch2: sgml-common-quotes.patch
Patch10: sgml-common-automake.patch
Patch11: sgml-common-0.6.3-docdir.patch
License: GPL
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRequires: libxml2 >= 2.6.17
BuildRequires: make
BuildRequires: automake
Requires: %{_bindir}/basename
%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: https://www.iso.org/cate/3524030.html
Requires(pre): %{_bindir}/xmlcatalog
%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 %{SOURCE21}
%patch10 -p1 -b .automake
%patch11 -p1 -b .docdir
aclocal
automake --add-missing --copy
%build
%configure \
--with-docdir=%{_docdir}
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall htmldir='%{_datadir}/doc'
#docdir=%{_docdir} top_builddir=`pwd`
mkdir %{buildroot}%{_sysconfdir}/xml
mkdir -p %{buildroot}%{_sysconfdir}/sgml/docbook
mkdir -p %{buildroot}%{_datadir}/sgml/docbook
# Touch SGML catalog
touch %{buildroot}%{_sysconfdir}/sgml/catalog
# Create an empty XML catalog.
XMLCATALOG=%{buildroot}%{_sysconfdir}/xml/catalog
%{_bindir}/xmlcatalog --noout --create $XMLCATALOG
# ...and add xml.xsd in it
for type in system uri ; do
for path in 2001 %{xmlxsdver} ; do
%{_bindir}/xmlcatalog --noout --add $type \
"http://www.w3.org/$path/xml.xsd" \
"file://%{_datadir}/xml/xml.xsd" $XMLCATALOG
done
# Add xmldsig-core-schema.xsd to catalog
%{_bindir}/xmlcatalog --noout --add $type \
"http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" \
"file://%{_datadir}/xml/xmldsig-core-schema.xsd" $XMLCATALOG
done
# Now put the common DocBook entries in it
%{_bindir}/xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//ENTITIES DocBook XML" \
"file://%{_sysconfdir}/sgml/docbook/xmlcatalog" $XMLCATALOG
%{_bindir}/xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//DTD DocBook XML" \
"file://%{_sysconfdir}/sgml/docbook/xmlcatalog" $XMLCATALOG
%{_bindir}/xmlcatalog --noout --add "delegatePublic" \
"ISO 8879:1986" \
"file://%{_sysconfdir}/sgml/docbook/xmlcatalog" $XMLCATALOG
%{_bindir}/xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/" \
"file://%{_sysconfdir}/sgml/docbook/xmlcatalog" $XMLCATALOG
%{_bindir}/xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/" \
"file://%{_sysconfdir}/sgml/docbook/xmlcatalog" $XMLCATALOG
for public in "-//W3C//DTD XMLSchema 200102//EN" "-//W3C//DTD XMLSCHEMA 200102//EN" ; do
%{_bindir}/xmlcatalog --noout --add "public" \
"$public" \
"file://%{_datadir}/xml/XMLSchema.dtd" $XMLCATALOG
done
%{_bindir}/xmlcatalog --noout --add "system" \
"http://www.w3.org/2001/XMLSchema.dtd" \
"file://%{_datadir}/xml/XMLSchema.dtd" $XMLCATALOG
# Also create the common DocBook catalog
%{_bindir}/xmlcatalog --noout --create \
%{buildroot}%{_sysconfdir}/sgml/docbook/xmlcatalog
ln -sf %{_sysconfdir}/sgml/docbook/xmlcatalog\
%{buildroot}%{_datadir}/sgml/docbook/xmlcatalog
rm -f %{buildroot}%{_datadir}/sgml/xml.dcl
install -p -m0644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \
%{buildroot}%{_datadir}/sgml
rm -rf %{buildroot}%{_datadir}/xml/*
install -p -m0644 %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} \
%{buildroot}%{_datadir}/xml
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_mandir}/man5
install -p -m0644 %{SOURCE9} %{buildroot}%{_mandir}/man1
install -p -m0644 %{SOURCE10} %{buildroot}%{_mandir}/man5
# remove installed doc file and prepare installation with %%doc
rm %{buildroot}%{_datadir}/doc/*.html
rm -rf __dist_doc/html/
mkdir -p __dist_doc/html/
cp -p doc/HTML/*.html __dist_doc/html/
%clean
DESTDIR=%{buildroot}
rm -rf $DESTDIR
%pre -n xml-common
if [ $1 -gt 1 ] && [ -e %{_sysconfdir}/xml/catalog ]; then
for type in system uri ; do
for path in 2001 %{xmlxsdver} ; do
%{_bindir}/xmlcatalog --noout --add $type \
"http://www.w3.org/$path/xml.xsd" \
"file://%{_datadir}/xml/xml.xsd" \
%{_sysconfdir}/xml/catalog
done
%{_bindir}/xmlcatalog --noout --add $type \
"http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd" \
"file://%{_datadir}/xml/xmldsig-core-schema.xsd" %{_sysconfdir}/xml/catalog
done
for public in "-//W3C//DTD XMLSchema 200102//EN" "-//W3C//DTD XMLSCHEMA 200102//EN" ; do
%{_bindir}/xmlcatalog --noout --add "public" \
"$public" \
"file://%{_datadir}/xml/XMLSchema.dtd" %{_sysconfdir}/xml/catalog
done
fi
:
%files
%defattr (-,root,root)
%dir %{_sysconfdir}/sgml
%config(noreplace) %{_sysconfdir}/sgml/sgml.conf
%ghost %verify(not md5 size mtime) %config(noreplace,missingok) %{_sysconfdir}/sgml/catalog
%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}/man8/install-catalog.8*
%{_mandir}/man1/sgmlwhich.1*
%{_mandir}/man5/sgml.conf.5*
%doc AUTHORS COPYING
%files -n xml-common
%defattr (-,root,root)
%dir %{_sysconfdir}/xml
%dir %{_sysconfdir}/sgml
%dir %{_sysconfdir}/sgml/docbook
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/xml/catalog
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sgml/docbook/xmlcatalog
%dir %{_datadir}/sgml
%dir %{_datadir}/sgml/docbook
%{_datadir}/sgml/docbook/xmlcatalog
%dir %{_datadir}/xml
%{_datadir}/xml/xml.xsd
%{_datadir}/xml/xmldsig-core-schema.xsd
%{_datadir}/xml/XMLSchema.dtd
%{_datadir}/xml/datatypes.dtd
%doc AUTHORS COPYING
%changelog
* Wed Jun 02 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 0.6.3-6mamba
- generic fixes by resyncing with Fedora recipe
* Fri Nov 27 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 0.6.3-5mamba
- specfile fix with rpm4
* Fri May 02 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.6.3-4mamba
- don't own /etc/xml/catalog and update it in %post script
* Tue Aug 27 2013 Automatic Build System <autodist@mambasoft.it> 0.6.3-3mamba
- automatic rebuild by autodist
* Tue Sep 23 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.6.3-2mamba
- specfile updated
* Sun Feb 27 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 0.6.3-2qilnx
- rebuilt and moved to devel repository
* Thu Sep 23 2004 Matteo Bernasconi <voyagernm@virgilio.it> 0.6.3-1qilnx
- First Build