xhtml1-dtds/xhtml1-dtds.spec

89 lines
3.3 KiB
RPMSpec
Raw Normal View History

2020-02-12 21:29:56 +08:00
#Basic Information
2019-12-23 17:15:39 +08:00
Name: xhtml1-dtds
Version: 1.0
2020-02-12 21:29:56 +08:00
Release: 20020801.15
2019-12-23 17:15:39 +08:00
Summary: Definitions for XHTML 1.0 document type
License: W3C
URL: http://www.w3.org/TR/2002/REC-xhtml1-20020801/
Source0: xhtml1-dtds-20020801.tar.xz
Source1: xhtml1-dtds.catalog.xml
Patch0000: xhtml1-dtds-sgml-catalog.patch
Patch0001: xhtml1-dtds-sgml-dcl.patch
BuildArch: noarch
2020-02-12 21:29:56 +08:00
#Dependency
2019-12-23 17:15:39 +08:00
BuildRequires: libxml2 >= 2.4.8
Requires: libxml2 >= 2.4.8 xml-common sgml-common
Requires(post): libxml2
Requires(preun): libxml2
%description
These DTDs and entity sets form a normative part of this specification.
The complete set of DTD files together with an XML declaration and SGML
Open Catalog is included in the zip file and the gzip'd tar file for this
specification. Users looking for local copies of the DTDs to work with
should download and use those archives rather than using the specific
DTDs referenced below.
2020-02-12 21:29:56 +08:00
#Build sections
2019-12-23 17:15:39 +08:00
%prep
%autosetup -n xhtml1-20020801 -p1
cp -p %{SOURCE1} DTD/catalog.xml
%build
%install
install -d $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
cp -p DTD/* $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
install -d $RPM_BUILD_ROOT%{_sysconfdir}/xml
xmlcatalog --noout --create $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
for i in "-//W3C//DTD XHTML 1.0 " "-//W3C//ENTITIES Latin 1 for XHTML" "-//W3C//ENTITIES Special for XHTML" \
"-//W3C//ENTITIES Symbols for XHTML" ; do
xmlcatalog --noout --add "delegatePublic" "$i" file://%{_datadir}/xml/xhtml/1.0/catalog.xml \
$RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
done
for i in xhtml1 2002/REC-xhtml1-20020801 ; do
xmlcatalog --noout --add "delegateSystem" "http://www.w3.org/TR/$i/DTD/" file://%{_datadir}/xml/xhtml/1.0/catalog.xml \
$RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
2020-02-12 21:29:56 +08:00
xmlcatalog --noout --add "delegateURI" "http://www.w3.org/TR/$i/DTD/" file://%{_datadir}/xml/xhtml/1.0/catalog.xml \
2019-12-23 17:15:39 +08:00
$RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
done
2020-02-12 21:29:56 +08:00
2019-12-23 17:15:39 +08:00
ln -s xhtml1-dtds-%{version}-%{release}.xml $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds.xml
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sgml
2020-02-12 21:29:56 +08:00
pushd $RPM_BUILD_ROOT%{_sysconfdir}/sgml
2019-12-23 17:15:39 +08:00
touch xhtml1-dtds-%{version}-%{release}.soc
ln -s xhtml1-dtds-%{version}-%{release}.soc xhtml1-dtds.soc
2020-02-12 21:29:56 +08:00
popd
2019-12-23 17:15:39 +08:00
2020-02-12 21:29:56 +08:00
#Install and uninstall scripts
2019-12-23 17:15:39 +08:00
%post
2020-02-12 21:29:56 +08:00
pushd %{_sysconfdir}/xml
[ -e catalog ] || xmlcatalog --noout --create catalog
xmlcatalog --noout --add nextCatalog xhtml1-dtds-%{version}-%{release}.xml "" catalog >/dev/null
popd
xmlcatalog --sgml --noout --add %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \
2019-12-23 17:15:39 +08:00
%{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
%preun
2020-02-12 21:29:56 +08:00
xmlcatalog --noout --del xhtml1-dtds-%{version}-%{release}.xml \
2019-12-23 17:15:39 +08:00
%{_sysconfdir}/xml/catalog >/dev/null
2020-02-12 21:29:56 +08:00
xmlcatalog --sgml --noout --del %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \
2019-12-23 17:15:39 +08:00
%{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
2020-02-12 21:29:56 +08:00
#Files list
2019-12-23 17:15:39 +08:00
%files
%ghost %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc
%{_sysconfdir}/sgml/xhtml1-dtds.soc
%{_sysconfdir}/xml/xhtml1-dtds*.xml
%{_datadir}/xml/xhtml/
%changelog
2020-02-12 21:29:56 +08:00
* Wed Feb 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.0-20020801.15
2019-12-23 17:15:39 +08:00
- Package init
2020-02-12 21:29:56 +08:00