- Major spec file rewrite (#226559), most visible changes:

- Various XML cataloguing improvements.
- Register to SGML catalogs in addition to XML.
- Install to %{_datadir}/xml per the FHS.
- Sync with Fedora packaging guidelines.
- Silence post-install scriptlet.
This commit is contained in:
Ville Skyttä 2008-02-29 18:16:46 +00:00
parent d1f0406d29
commit 6464538cb7
4 changed files with 165 additions and 93 deletions

View File

@ -0,0 +1,29 @@
--- DTD/xhtml.soc~ 2002-08-01 21:23:08.000000000 +0300
+++ DTD/xhtml.soc 2004-06-20 01:13:52.351585517 +0300
@@ -1,14 +1,24 @@
-OVERRIDE YES
-- Oasis entity catalog for Extensible HTML 1.0 --
+-- Fedora change: use DTDDECLs instead of SGMLDECL to avoid affecting --
+-- other things included in the central system catalog --
+
+OVERRIDE YES
+
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd"
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "xhtml1-frameset.dtd"
+DTDDECL "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1.dcl"
+DTDDECL "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1.dcl"
+DTDDECL "-//W3C//DTD XHTML 1.0 Frameset//EN" "xhtml1.dcl"
-- ISO latin 1 entity set for Extensible HTML (XML 1.0 format) --
PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "xhtml-lat1.ent"
PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" "xhtml-symbol.ent"
PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" "xhtml-special.ent"
+DTDDECL "-//W3C//ENTITIES Latin 1 for XHTML//EN" "xhtml1.dcl"
+DTDDECL "-//W3C//ENTITIES Symbols for XHTML//EN" "xhtml1.dcl"
+DTDDECL "-//W3C//ENTITIES Special for XHTML//EN" "xhtml1.dcl"
-SGMLDECL "xhtml1.dcl"
+-- SGMLDECL "xhtml1.dcl" --

View File

@ -0,0 +1,22 @@
Changes from validator.w3.org's xml.dcl.
diff -up xhtml1-20020801/DTD/xhtml1.dcl.orig xhtml1-20020801/DTD/xhtml1.dcl
--- xhtml1-20020801/DTD/xhtml1.dcl.orig 2002-08-01 21:23:08.000000000 +0300
+++ xhtml1-20020801/DTD/xhtml1.dcl 2008-02-28 22:43:22.000000000 +0200
@@ -22,13 +22,13 @@
13 1 13
14 18 UNUSED
32 95 32
- 127 1 UNUSED
- 128 32 UNUSED
+ 127 1 127 -- DEL, legal in XML 1.0 --
+ 128 32 128 -- C1 controls, legal in XML 1.0 --
160 55136 160
55296 2048 UNUSED -- surrogates --
57344 8190 57344
65534 2 UNUSED -- FFFE and FFFF --
- 65536 1048576 65536
+ 65536 1048576 65536 -- 16 planes outside BMP --
CAPACITY NONE -- Capacities are not restricted in XML --

14
xhtml1-dtds.catalog.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="-//W3C//DTD XHTML 1.0 Strict//EN" uri="xhtml1-strict.dtd"/>
<public publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" uri="xhtml1-transitional.dtd"/>
<public publicId="-//W3C//DTD XHTML 1.0 Frameset//EN" uri="xhtml1-frameset.dtd"/>
<public publicId="-//W3C//ENTITIES Latin 1 for XHTML//EN" uri="xhtml-lat1.ent"/>
<public publicId="-//W3C//ENTITIES Special for XHTML//EN" uri="xhtml-special.ent"/>
<public publicId="-//W3C//ENTITIES Symbols for XHTML//EN" uri="xhtml-symbol.ent"/>
<rewriteSystem systemIdStartString="http://www.w3.org/TR/xhtml1/DTD/" rewritePrefix="./" />
<rewriteSystem systemIdStartString="http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/" rewritePrefix="./" />
<rewriteURI uriStartString="http://www.w3.org/TR/xhtml1/DTD/" rewritePrefix="./" />
<rewriteURI uriStartString="http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/" rewritePrefix="./" />
</catalog>

View File

@ -1,24 +1,28 @@
%define date 20020801
Name: xhtml1-dtds Name: xhtml1-dtds
Version: 1.0 Version: 1.0
Release: 7.1.1 Release: %{date}.1
Summary: XHTML 1.0 document type definitions
Group: Applications/Text Group: Applications/Text
# W3C Software License for DTDs etc:
Summary: XML document type definition for XHTML 1.0 # http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620#DTD
License: W3C
License: W3C IPR URL: http://www.w3.org/TR/2002/REC-xhtml1-%{date}/
URL: http://www.w3.org/TR/xhtml1/ Source0: http://www.w3.org/TR/2002/REC-xhtml1-%{date}/xhtml1.tgz
Source1: %{name}.catalog.xml
PreReq: fileutils Patch0: %{name}-sgml-catalog.patch
PreReq: libxml2 >= 2.4.8 Patch1: %{name}-sgml-dcl.patch
# xml-common for /etc/xml BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
PreReq: xml-common
BuildRequires: libxml2 >= 2.4.8
BuildRoot: %{_tmppath}/%{name}-%{version}
BuildArch: noarch BuildArch: noarch
Source0: http://www.w3.org/TR/xhtml1/xhtml1.tgz BuildRequires: libxml2 >= 2.4.8
BuildRequires: tar Requires: libxml2 >= 2.4.8
Requires: xml-common
Requires: sgml-common
Requires(post): /usr/bin/xmlcatalog
Requires(preun): /usr/bin/xmlcatalog
%description %description
This provides the DTDs of the Second Edition of XHTML 1.0, a reformulation This provides the DTDs of the Second Edition of XHTML 1.0, a reformulation
@ -27,13 +31,12 @@ ones defined by HTML 4. The semantics of the elements and their attributes
are defined in the W3C Recommendation for HTML 4. These semantics provide are defined in the W3C Recommendation for HTML 4. These semantics provide
the foundation for future extensibility of XHTML. the foundation for future extensibility of XHTML.
%prep %prep
%setup -c -T %setup -q -n xhtml1-20020801
tar xvzf %{SOURCE0} %patch0 -p0
if [ `id -u` -eq 0 ]; then %patch1 -p1
chown -R root:root . cp -p %{SOURCE1} DTD/catalog.xml
chmod -R a+rX,g-w,o-w .
fi
%build %build
@ -42,87 +45,91 @@ fi
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
# XHTML 1.0 2nd edition # Note: documentation is not shipped; the W3C Documentation License is not an
DESTDIR=$RPM_BUILD_ROOT/usr/share/sgml/xhtml1/xhtml1-20020801/DTD # acceptable one per Fedora licensing guidelines.
mkdir -p $DESTDIR
install xhtml1-20020801/DTD/*.dtd $DESTDIR
install xhtml1-20020801/DTD/*.ent $DESTDIR
## mkdir -p $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
## Create the XHTML1 XML catalog cp -p DTD/* $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
##
CATALOG=$RPM_BUILD_ROOT/usr/share/sgml/xhtml1/xmlcatalog # XML catalog:
xpkg() {
xmlcatalog --noout --add "$1" "$2" \
file://%{_datadir}/xml/xhtml/1.0/catalog.xml \
$RPM_BUILD_ROOT%{_sysconfdir}/xml/%{name}-%{version}-%{release}.xml
}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/xml
xmlcatalog --noout --create \
$RPM_BUILD_ROOT%{_sysconfdir}/xml/%{name}-%{version}-%{release}.xml
xpkg delegatePublic "-//W3C//DTD XHTML 1.0 "
xpkg delegatePublic "-//W3C//ENTITIES Latin 1 for XHTML"
xpkg delegatePublic "-//W3C//ENTITIES Special for XHTML"
xpkg delegatePublic "-//W3C//ENTITIES Symbols for XHTML"
for i in xhtml1 2002/REC-xhtml1-%{date} ; do
xpkg delegateSystem http://www.w3.org/TR/$i/DTD/
xpkg delegateURI http://www.w3.org/TR/$i/DTD/
done
ln -s %{name}-%{version}-%{release}.xml \
$RPM_BUILD_ROOT%{_sysconfdir}/xml/%{name}.xml
# SGML catalog:
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sgml
cd $RPM_BUILD_ROOT%{_sysconfdir}/sgml
touch %{name}-%{version}-%{release}.soc
ln -s %{name}-%{version}-%{release}.soc %{name}.soc
cd -
/usr/bin/xmlcatalog --noout --create $CATALOG
/usr/bin/xmlcatalog --noout --add "public" \
"-//W3C//DTD XHTML 1.0 Strict//EN" \
"xhtml1-20020801/DTD/xhtml1-strict.dtd" $CATALOG
/usr/bin/xmlcatalog --noout --add "public" \
"-//W3C//DTD XHTML 1.0 Transitional//EN" \
"xhtml1-20020801/DTD/xhtml1-transitional.dtd" $CATALOG
/usr/bin/xmlcatalog --noout --add "public" \
"-//W3C//DTD XHTML 1.0 Frameset//EN" \
"xhtml1-20020801/DTD/xhtml1-frameset.dtd" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteSystem" \
"http://www.w3.org/TR/xhtml1/DTD" \
"xhtml1-20020801/DTD" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteURI" \
"http://www.w3.org/TR/xhtml1/DTD" \
"xhtml1-20020801/DTD" $CATALOG
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root)
/usr/share/sgml/xhtml1
%post %post
CATALOG=/usr/share/sgml/xhtml1/xmlcatalog cd %{_sysconfdir}/xml
# if [ -e catalog ] ; then
# Register it in the super catalog with the appropriate delegates # Clean up possible leftovers from < 1.0-20020801.1
# /usr/bin/xmlcatalog --noout \
ROOTCATALOG=/etc/xml/catalog --del "file://%{_datadir}/sgml/xhtml1/xmlcatalog" catalog
else
if [ ! -r $ROOTCATALOG ] /usr/bin/xmlcatalog --noout --create catalog
then
/usr/bin/xmlcatalog --noout --create $ROOTCATALOG
fi fi
/usr/bin/xmlcatalog --noout --add \
nextCatalog %{name}-%{version}-%{release}.xml "" catalog >/dev/null
cd - >/dev/null
/usr/bin/xmlcatalog --sgml --noout --add \
%{_sysconfdir}/sgml/%{name}-%{version}-%{release}.soc \
%{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
:
if [ -w $ROOTCATALOG ] %preun
then /usr/bin/xmlcatalog --noout --del \
/usr/bin/xmlcatalog --noout --add "delegatePublic" \ %{name}-%{version}-%{release}.xml \
"-//W3C//DTD XHTML 1.0" \ %{_sysconfdir}/xml/catalog >/dev/null
"file://$CATALOG" $ROOTCATALOG /usr/bin/xmlcatalog --sgml --noout --del \
/usr/bin/xmlcatalog --noout --add "delegateSystem" \ %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.soc \
"http://www.w3.org/TR/xhtml1/DTD" \ %{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
"file://$CATALOG" $ROOTCATALOG :
/usr/bin/xmlcatalog --noout --add "delegateURI" \
"http://www.w3.org/TR/xhtml1/DTD" \
"file://$CATALOG" $ROOTCATALOG
fi
%postun
#
# On removal, unregister the xmlcatalog from the supercatalog
#
if [ "$1" = 0 ]; then
CATALOG=/usr/share/sgml/xhtml1/xmlcatalog
ROOTCATALOG=/etc/xml/catalog
if [ -w $ROOTCATALOG ] %files
then %defattr(644,root,root,755)
/usr/bin/xmlcatalog --noout --del \ %ghost %{_sysconfdir}/sgml/%{name}-%{version}-%{release}.soc
"-//W3C//DTD XHTML 1.0" $ROOTCATALOG %{_sysconfdir}/sgml/%{name}.soc
/usr/bin/xmlcatalog --noout --del \ %{_sysconfdir}/xml/%{name}*.xml
"http://www.w3.org/TR/xhtml1/DTD" $ROOTCATALOG %{_datadir}/xml/xhtml/
/usr/bin/xmlcatalog --noout --del \
"http://www.w3.org/TR/xhtml1/DTD" $ROOTCATALOG
fi
fi
%changelog %changelog
* Thu Feb 28 2008 Ville Skyttä <ville.skytta at iki.fi> - 1.0-20020801.1
- Major spec file rewrite (#226559), most visible changes:
- Various XML cataloguing improvements.
- Register to SGML catalogs in addition to XML.
- Install to %%{_datadir}/xml per the FHS.
- Sync with Fedora packaging guidelines.
- Silence post-install scriptlet.
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.0-7.1.1 * Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.0-7.1.1
- rebuild - rebuild
@ -145,8 +152,8 @@ fi
- rebuilt - rebuilt
* Fri Dec 13 2002 Daniel Veillard <veillard@redhat.com> 1.0-4 * Fri Dec 13 2002 Daniel Veillard <veillard@redhat.com> 1.0-4
Prepare for inclusion, Prereq xml-common, fix the uninstall - Prepare for inclusion, Prereq xml-common, fix the uninstall
for upgrades of the package for upgrades of the package
* Thu Dec 12 2002 Daniel Veillard <veillard@redhat.com> 1.0-1 * Thu Dec 12 2002 Daniel Veillard <veillard@redhat.com> 1.0-1
Creation, based on Tim Waugh docbook-dtd package - Creation, based on Tim Waugh docbook-dtd package