rewrite spec

This commit is contained in:
Grooooot 2020-02-12 21:29:56 +08:00
parent 211b822598
commit 0dd0adbbde
2 changed files with 20 additions and 36 deletions

View File

@ -1,20 +0,0 @@
#!/bin/sh
set -e
# Prune content from upstream tarball:
# https://www.redhat.com/archives/fedora-legal-list/2009-February/msg00015.html
# While at it, prune docs as well; the W3C Documentation License is not an
# acceptable one per Fedora licensing guidelines.
date="20020801"
url="http://www.w3.org/TR/2002/REC-xhtml1-$date/xhtml1.tgz"
curl -O $url
tar zxf $(basename $url)
find xhtml1-$date -type f | grep -vF /DTD/ | xargs rm
rm $(basename $url)
tar Jcvf xhtml1-dtds-$date.tar.xz xhtml1-$date
rm -r xhtml1-$date

View File

@ -1,15 +1,17 @@
#Basic Information
Name: xhtml1-dtds Name: xhtml1-dtds
Version: 1.0 Version: 1.0
Release: 20020801.14 Release: 20020801.15
Summary: Definitions for XHTML 1.0 document type Summary: Definitions for XHTML 1.0 document type
License: W3C License: W3C
URL: http://www.w3.org/TR/2002/REC-xhtml1-20020801/ URL: http://www.w3.org/TR/2002/REC-xhtml1-20020801/
Source0: xhtml1-dtds-20020801.tar.xz Source0: xhtml1-dtds-20020801.tar.xz
Source1: xhtml1-dtds.catalog.xml Source1: xhtml1-dtds.catalog.xml
Source2: xhtml1-dtds-prepare-tarball.sh
Patch0000: xhtml1-dtds-sgml-catalog.patch Patch0000: xhtml1-dtds-sgml-catalog.patch
Patch0001: xhtml1-dtds-sgml-dcl.patch Patch0001: xhtml1-dtds-sgml-dcl.patch
BuildArch: noarch BuildArch: noarch
#Dependency
BuildRequires: libxml2 >= 2.4.8 BuildRequires: libxml2 >= 2.4.8
Requires: libxml2 >= 2.4.8 xml-common sgml-common Requires: libxml2 >= 2.4.8 xml-common sgml-common
Requires(post): libxml2 Requires(post): libxml2
@ -23,13 +25,13 @@ specification. Users looking for local copies of the DTDs to work with
should download and use those archives rather than using the specific should download and use those archives rather than using the specific
DTDs referenced below. DTDs referenced below.
#Build sections
%prep %prep
%autosetup -n xhtml1-20020801 -p1 %autosetup -n xhtml1-20020801 -p1
cp -p %{SOURCE1} DTD/catalog.xml cp -p %{SOURCE1} DTD/catalog.xml
%build %build
%install %install
install -d $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0 install -d $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
cp -p DTD/* $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0 cp -p DTD/* $RPM_BUILD_ROOT%{_datadir}/xml/xhtml/1.0
@ -46,33 +48,34 @@ done
for i in xhtml1 2002/REC-xhtml1-20020801 ; do 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 \ 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 $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
xmlcatalog --noout --add "delegateURI" "http://www.w3.org/TR/$i/DTD/" file://%{_datadir}/xml/xhtml/1.0/catalog.xml \ xmlcatalog --noout --add "delegateURI" "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 $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds-%{version}-%{release}.xml
done done
ln -s xhtml1-dtds-%{version}-%{release}.xml $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds.xml ln -s xhtml1-dtds-%{version}-%{release}.xml $RPM_BUILD_ROOT%{_sysconfdir}/xml/xhtml1-dtds.xml
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sgml install -d $RPM_BUILD_ROOT%{_sysconfdir}/sgml
cd $RPM_BUILD_ROOT%{_sysconfdir}/sgml pushd $RPM_BUILD_ROOT%{_sysconfdir}/sgml
touch xhtml1-dtds-%{version}-%{release}.soc touch xhtml1-dtds-%{version}-%{release}.soc
ln -s xhtml1-dtds-%{version}-%{release}.soc xhtml1-dtds.soc ln -s xhtml1-dtds-%{version}-%{release}.soc xhtml1-dtds.soc
cd - popd
#Install and uninstall scripts
%post %post
cd %{_sysconfdir}/xml pushd %{_sysconfdir}/xml
[ -e catalog ] || /usr/bin/xmlcatalog --noout --create catalog [ -e catalog ] || xmlcatalog --noout --create catalog
/usr/bin/xmlcatalog --noout --add nextCatalog xhtml1-dtds-%{version}-%{release}.xml "" catalog >/dev/null xmlcatalog --noout --add nextCatalog xhtml1-dtds-%{version}-%{release}.xml "" catalog >/dev/null
cd - >/dev/null popd
/usr/bin/xmlcatalog --sgml --noout --add %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \ xmlcatalog --sgml --noout --add %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \
%{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null %{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
:
%preun %preun
/usr/bin/xmlcatalog --noout --del xhtml1-dtds-%{version}-%{release}.xml \ xmlcatalog --noout --del xhtml1-dtds-%{version}-%{release}.xml \
%{_sysconfdir}/xml/catalog >/dev/null %{_sysconfdir}/xml/catalog >/dev/null
/usr/bin/xmlcatalog --sgml --noout --del %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \ xmlcatalog --sgml --noout --del %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc \
%{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null %{_datadir}/xml/xhtml/1.0/xhtml.soc >/dev/null
:
#Files list
%files %files
%ghost %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc %ghost %{_sysconfdir}/sgml/xhtml1-dtds-%{version}-%{release}.soc
%{_sysconfdir}/sgml/xhtml1-dtds.soc %{_sysconfdir}/sgml/xhtml1-dtds.soc
@ -80,5 +83,6 @@ cd - >/dev/null
%{_datadir}/xml/xhtml/ %{_datadir}/xml/xhtml/
%changelog %changelog
* Fri Dec 20 2019 wutao <wutao61@huawei.com> - 1.0-20020801.14 * Wed Feb 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.0-20020801.15
- Package init - Package init