forked from pool/svg-schema
223 lines
7.5 KiB
RPMSpec
223 lines
7.5 KiB
RPMSpec
|
#
|
||
|
# spec file for package svg-schema (Version 20030114)
|
||
|
#
|
||
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||
|
# This file and all modifications and additions to the pristine
|
||
|
# package are under the same license as the package itself.
|
||
|
#
|
||
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||
|
#
|
||
|
|
||
|
# norootforbuild
|
||
|
|
||
|
Name: svg-schema
|
||
|
BuildRequires: sgml-skel unzip
|
||
|
Summary: SVG DTDs and Documentation
|
||
|
Version: 20030114
|
||
|
Release: 1
|
||
|
Group: Productivity/Graphics/Other
|
||
|
BuildArchitectures: noarch
|
||
|
Provides: svg-dtd
|
||
|
Obsoletes: svg-dtd
|
||
|
Requires: sgml-skel libxml2
|
||
|
%define regcat /usr/bin/sgml-register-catalog
|
||
|
PreReq: %{regcat} /usr/bin/xmlcatalog /usr/bin/edit-xml-catalog
|
||
|
PreReq: sed grep awk
|
||
|
#Provides:
|
||
|
License: BSD License and BSD-like
|
||
|
URL: http://www.w3.org/Graphics/SVG/
|
||
|
Source0: http://www.w3.org/TR/2001/REC-SVG-20010904/REC-SVG-20010904.zip
|
||
|
Source1: http://www.w3.org/TR/SVG11/REC-SVG11-20030114.zip
|
||
|
Source2: CATALOG.svg-1.0
|
||
|
Source3: CATALOG.svg-1.1
|
||
|
Source4: svg-1.0.xml
|
||
|
Source5: svg-1.1.xml
|
||
|
Source10: http://www.w3.org/Graphics/SVG/1.1/rng/rng.zip
|
||
|
#Patch:
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||
|
|
||
|
%description
|
||
|
Contains the following DTDs:
|
||
|
|
||
|
* "Scalable Vector Graphics" (SVG) 1.0 Specification, W3C
|
||
|
Recommendation 04 September 2001.
|
||
|
|
||
|
* "Scalable Vector Graphics" (SVG) 1.1 Specification, W3C
|
||
|
Recommendation 14 January 2003
|
||
|
|
||
|
|
||
|
|
||
|
%define INSTALL install -m755 -s
|
||
|
%define INSTALL_DIR install -d -m755
|
||
|
%define INSTALL_DATA install -m644
|
||
|
%define INSTALL_SCRIPT install -m755 -o root -g root
|
||
|
%define sgml_dir %{_datadir}/sgml
|
||
|
%define sgml_var_dir /var/lib/sgml
|
||
|
%define sgml_mod_dir %{sgml_dir}/svg
|
||
|
%define sgml_mod_dtd_dir %{sgml_mod_dir}/dtd
|
||
|
%define sgml_mod_custom_dir %{sgml_mod_dir}/custom
|
||
|
%define sgml_mod_style_dir %{sgml_mod_dir}/stylesheet
|
||
|
%define xml_dir %{_datadir}/xml
|
||
|
%define xml_mod_dir %{xml_dir}/svg
|
||
|
%define xml_mod_dtd_dir %{xml_mod_dir}/schema/dtd
|
||
|
%define xml_mod_rng_dir %{xml_mod_dir}/schema/rng
|
||
|
%define xml_mod_custom_dir %{xml_mod_dir}/custom
|
||
|
%define xml_mod_style_dir %{xml_mod_dir}/stylesheet
|
||
|
%define xml_mod_style_prod_dir %{xml_mod_style_dir}
|
||
|
%define sgml_config_dir /var/lib/sgml
|
||
|
%define sgml_sysconf_dir %{_sysconfdir}/sgml
|
||
|
%define xml_config_dir /var/lib/xml
|
||
|
%define xml_sysconf_dir %{_sysconfdir}/xml
|
||
|
%prep
|
||
|
%setup -c -T
|
||
|
unzip -q -a %{S:1}
|
||
|
mkdir svg-dtd-20010904
|
||
|
cd svg-dtd-20010904
|
||
|
unzip -q -a %{S:0}
|
||
|
cd ..
|
||
|
mkdir rng11
|
||
|
cd rng11
|
||
|
unzip -q -a %{S:10}
|
||
|
cd ..
|
||
|
cp %{S:2} %{S:3} %{S:4} %{S:5} .
|
||
|
find -type d | xargs chmod 755
|
||
|
find -type f | xargs chmod 644
|
||
|
|
||
|
%build
|
||
|
|
||
|
%install
|
||
|
[ -d %{buildroot} -a "%{buildroot}" != "" ] && rm -rf %{buildroot}
|
||
|
#RNG
|
||
|
%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_mod_rng_dir}/1.1
|
||
|
cp rng11/* $RPM_BUILD_ROOT%{xml_mod_rng_dir}/1.1
|
||
|
#DTD
|
||
|
%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_mod_dtd_dir}/1.{0,1} \
|
||
|
$RPM_BUILD_ROOT%{sgml_var_dir} $RPM_BUILD_ROOT%{sgml_dir} \
|
||
|
$RPM_BUILD_ROOT%{_docdir}/%{name}/{1.0,1.1}
|
||
|
%{INSTALL_DATA} CATALOG.* $RPM_BUILD_ROOT%{sgml_var_dir}
|
||
|
%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_sysconf_dir}
|
||
|
%{INSTALL_DATA} svg-1.[01].xml $RPM_BUILD_ROOT%{xml_sysconf_dir}
|
||
|
pushd REC-SVG11-20030114
|
||
|
cp -a * $RPM_BUILD_ROOT%{_docdir}/%{name}/1.1
|
||
|
rm -fr $RPM_BUILD_ROOT%{_docdir}/%{name}/1.1/{DTD,zip}
|
||
|
ln -sf %{xml_mod_dtd_dir}/1.1 $RPM_BUILD_ROOT%{_docdir}/%{name}/1.1/DTD
|
||
|
cp -a DTD/[a-su-z][!C]* $RPM_BUILD_ROOT%{xml_mod_dtd_dir}/1.1
|
||
|
#
|
||
|
popd
|
||
|
pushd svg-dtd-20010904
|
||
|
cp -a * $RPM_BUILD_ROOT%{_docdir}/%{name}/1.0
|
||
|
rm -fr $RPM_BUILD_ROOT%{_docdir}/%{name}/1.0/{DTD,zip}
|
||
|
ln -sf %{xml_mod_dtd_dir}/1.0 $RPM_BUILD_ROOT%{_docdir}/%{name}/1.0/DTD
|
||
|
cp -a DTD/[a-su-z][!C]* $RPM_BUILD_ROOT%{xml_mod_dtd_dir}/1.0
|
||
|
pushd $RPM_BUILD_ROOT%{sgml_dir}
|
||
|
for c in ../../../var/lib/sgml/CATALOG.*; do
|
||
|
ln -sf $c .
|
||
|
done
|
||
|
popd
|
||
|
xmlcatbin=/usr/bin/xmlcatalog
|
||
|
%define FOR_ROOT_CAT for-catalog-%{name}-%{version}-%{release}.xml
|
||
|
rm -f %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --create %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegatePublic" "-//W3C//DTD SVG 1.0//EN" \
|
||
|
"file:///etc/xml/svg-1.0.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegateSystem" \
|
||
|
"http://www.w3.org/Graphics/SVG/1.0/DTD" \
|
||
|
"file:///etc/xml/svg-1.0.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegatePublic" "-//W3C//DTD SVG 1.1" \
|
||
|
"file:///etc/xml/svg-1.1.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegatePublic" "-//W3C//ENTITIES SVG 1.1" \
|
||
|
"file:///etc/xml/svg-1.1.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegatePublic" "-//W3C//ELEMENTS SVG 1.1" \
|
||
|
"file:///etc/xml/svg-1.1.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
$xmlcatbin --noout --add "delegateSystem" \
|
||
|
"http://www.w3.org/Graphics/SVG/1.1/" \
|
||
|
"file:///etc/xml/svg-1.1.xml" %{FOR_ROOT_CAT}.tmp
|
||
|
# PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN"
|
||
|
# SYSTEM "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
|
||
|
# RNG
|
||
|
$xmlcatbin --noout --add "uri" \
|
||
|
"http://www.w3.org/Graphics/SVG/1.1/rng/svg11.rng" \
|
||
|
"file://%{xml_mod_rng_dir}/1.1/svg11.rng" %{FOR_ROOT_CAT}.tmp
|
||
|
# Create tag
|
||
|
sed '/<catalog/a\
|
||
|
<group id="%{name}-%{version}-%{release}">
|
||
|
/<\/catalog/i\
|
||
|
</group>' \
|
||
|
%{FOR_ROOT_CAT}.tmp > %{FOR_ROOT_CAT}
|
||
|
cat_dir=%{buildroot}/etc/xml
|
||
|
%{INSTALL_DIR} $cat_dir
|
||
|
%{INSTALL_DATA} %{FOR_ROOT_CAT} $cat_dir
|
||
|
%define all_cat svg-1.0 svg-1.1
|
||
|
|
||
|
%post
|
||
|
if [ -x %{regcat} ]; then
|
||
|
for c in %{all_cat}; do
|
||
|
grep -q -e "%{sgml_dir}/CATALOG.$c\\>" /etc/sgml/catalog \
|
||
|
|| %{regcat} -a %{sgml_dir}/CATALOG.$c >/dev/null 2>&1 || :
|
||
|
done
|
||
|
fi
|
||
|
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
|
||
|
--add /etc/xml/%{FOR_ROOT_CAT}
|
||
|
|
||
|
%postun
|
||
|
if [ "$1" = "0" -a -x %{regcat} ]; then
|
||
|
for c in %{all_cat}; do
|
||
|
%{regcat} -r %{sgml_dir}/CATALOG.$c >/dev/null 2>&1 || :
|
||
|
done
|
||
|
fi
|
||
|
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
|
||
|
--del %{name}-%{version}-%{release}
|
||
|
exit 0
|
||
|
|
||
|
%clean
|
||
|
rm -fr $RPM_BUILD_ROOT
|
||
|
|
||
|
%files
|
||
|
%defattr(-, root, root)
|
||
|
# %doc copyright-software.html
|
||
|
%config %{sgml_var_dir}/CATALOG.*
|
||
|
%config /etc/xml/*.xml
|
||
|
%doc %{_docdir}/%{name}
|
||
|
%{sgml_dir}/CATALOG.*
|
||
|
%{xml_mod_dir}
|
||
|
|
||
|
%changelog
|
||
|
* Wed May 02 2007 - ke@suse.de
|
||
|
- Rename svg-dtd to svg-schema
|
||
|
- Add RNG schema files as proposed by Thomas Schraitle.
|
||
|
* Thu Mar 29 2007 - ke@suse.de
|
||
|
- Add BuildRequires: unzip
|
||
|
* Tue Feb 27 2007 - ke@suse.de
|
||
|
- Fix fix typo in postun script; reported by Florian La Roche [#
|
||
|
249023].
|
||
|
* Thu Jan 11 2007 - ke@suse.de
|
||
|
- Remove /usr/share/xml from the files list.
|
||
|
* Wed Jan 25 2006 - mls@suse.de
|
||
|
- converted neededforbuild to BuildRequires
|
||
|
* Wed Jun 29 2005 - ke@suse.de
|
||
|
- Provide XML catalog entries for "-//W3C//ENTITIES SVG 1.1" and
|
||
|
"-//W3C//ELEMENTS SVG 1.1"; reported by Berthold Gunreben.
|
||
|
* Tue Jun 28 2005 - ke@suse.de
|
||
|
- Remove wrong references in svg-1.1.xml catalog file.
|
||
|
* Tue Jun 28 2005 - ke@suse.de
|
||
|
- Add systemIds to the catalog files.
|
||
|
- Stop creating compat links.
|
||
|
* Mon Feb 23 2004 - hmacht@suse.de
|
||
|
- added option # norootforbuild in specfile
|
||
|
* Thu Feb 12 2004 - ke@suse.de
|
||
|
- Adjust directories according to FHS 2.3:
|
||
|
* Move DTDs to /usr/share/xml/svg/schema/dtd.
|
||
|
* Provide compatibility links for SL =< 9.0 (log this info in
|
||
|
/var/adm/SuSEconfig/run-sgmldir-links for later processing).
|
||
|
* Thu Jan 22 2004 - ro@suse.de
|
||
|
- added "exit 0" as temporary workaround to postinstall
|
||
|
* Fri Jun 06 2003 - ke@suse.de
|
||
|
- Add version 1.1.
|
||
|
- Use absolute links.
|
||
|
- Use edit-xml-catalog to register xml catalog fragments.
|
||
|
* Mon Feb 24 2003 - ke@suse.de
|
||
|
- In %%post drop brain dead file check which cause re-creation of an
|
||
|
empty xml catalog file; reported by Thomas Schraitle [# 24186].
|
||
|
* Fri Dec 06 2002 - ke@suse.de
|
||
|
- New package: SVG 1.0; cf. [# 12050].
|