2017-11-27 09:12:46 +00:00
#
# spec file for package docbook-xsl
#
2023-04-19 15:56:46 +00:00
# Copyright (c) 2023 SUSE LLC
2017-11-27 09:12:46 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2023-04-19 15:56:46 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-11-27 09:12:46 +00:00
#
2023-04-19 15:56:46 +00:00
%define realversion 1.79.2
2017-11-27 09:12:46 +00:00
#
%define db4rootdir %{_datadir}/xml/docbook/stylesheet/nwalsh
%define db4package docbook-xsl-stylesheets
%define db4style_catalog %{db4package}.xml
#
%define db5rootdir %{_datadir}/xml/docbook/stylesheet/nwalsh5
%define db5package docbook5-xsl-stylesheets
%define db5style_catalog %{db5package}.xml
#
%define etcxmlcatalogd %{_sysconfdir}/xml/catalog.d
#
Name : docbook-xsl
2023-11-15 09:32:02 +00:00
Version : 1.79.2.2
2017-11-27 09:12:46 +00:00
Release : 0
Summary : XSL Stylesheets for DocBook
2023-04-19 15:56:46 +00:00
License : MIT AND MPL-1.1
2017-11-27 09:12:46 +00:00
Group : Productivity/Publishing/DocBook
2023-04-19 15:56:46 +00:00
URL : https://github.com/docbook/xslt10-stylesheets
2023-04-24 07:35:06 +00:00
Source0 : https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{realversion} /docbook-xsl-%{realversion} .tar.bz2
Source1 : https://github.com/docbook/xslt10-stylesheets/releases/download/release/%{realversion} /docbook-xsl-doc-%{realversion} .tar.bz2
2017-11-27 09:12:46 +00:00
Source2 : %{db4style_catalog}
Source3 : %{db5style_catalog}
# Build scripts
Source10 : dbxslt-install.sh
Source11 : xslnons-build
2023-11-15 09:32:02 +00:00
#
Source20 : assemble.xsl
Source21 : effectivity.xsl
2017-11-27 09:12:46 +00:00
## PATCH-FIX-OPENSUSE docbook-xsl-stylesheets-dbtoepub.patch Fixed dirname
Patch0 : %{name} -dbtoepub.patch
## PATCH-FIX-OPENSUSE docbook-xsl-stylesheets-non-recursive_string_subst.patch Use EXSLT replace function to avoid recursive implementation of string.subst
Patch1 : %{name} -non-recursive_string_subst.patch
2023-11-15 09:32:02 +00:00
2017-11-27 09:12:46 +00:00
BuildRequires : fdupes
BuildRequires : sgml-skel >= 0.7
BuildRequires : unzip
Requires : docbook_4
Requires : sgml-skel >= 0.7
Requires : xmlcharent
Requires(post) : sgml-skel >= 0.7
2023-04-19 15:56:46 +00:00
Requires(postun) : sgml-skel >= 0.7
2017-11-27 09:12:46 +00:00
Requires(pre) : %{_bindir} /xmlcatalog
BuildArch : noarch
#--------------------------------------------------------------------------
%description
%{summary} .
Wrapper package for DocBook 4 and 5 stylesheets.
%package -n %{db4package}
Summary : XSL Stylesheets for DocBook 4
Group : Productivity/Publishing/XML
Requires : docbook_4
Requires : sgml-skel >= 0.7
Requires : xmlcharent
Requires(post) : sgml-skel >= 0.7
2023-04-19 15:56:46 +00:00
Requires(postun) : sgml-skel >= 0.7
2017-11-27 09:12:46 +00:00
Suggests : rubygem(dbtoepub)
%description -n %{db4package}
These are the XSL stylesheets for DocBook XML and " S i m p l i f i e d " DocBook
DTDs. Use these stylesheets for documents based on DocBook 4 and
earlier; they are not aware of the namespace feature.
The stylesheets transform DocBook 4 documents into HTML, XHTML, Manpages,
XSL-FO (for PDF), and a few other formats.
XSL is a standard W3C stylesheet language for both print and online
rendering. For more information about XSL, see the XSL page at the W3C:
http://www.w3.org/Style/XSL/
%package -n docbook5-xsl-stylesheets
Summary : XSL Stylesheets for DocBook 5
Group : Productivity/Publishing/XML
Requires : docbook_5
Requires : sgml-skel >= 0.7
Requires : xmlcharent
Requires(post) : sgml-skel >= 0.7
2023-04-19 15:56:46 +00:00
Requires(postun) : sgml-skel >= 0.7
2017-11-27 09:12:46 +00:00
Suggests : rubygem(dbtoepub)
%description -n docbook5-xsl-stylesheets
These are the XSL stylesheets for DocBook 5 XML and " S i m p l i f i e d " DocBook 5.
Use these stylesheets for documents based on DocBook 5; they are aware
of the namespace feature.
The stylesheets transform DocBook 5 documents into HTML, XHTML, Manpages,
XSL-FO (for PDF), and a few other formats.
XSL is a standard W3C stylesheet language for both print and online
rendering. For more information about XSL, see the XSL page at the W3C:
http://www.w3.org/Style/XSL/
%package pdf2index
# License: MPL-1.1 and MIT
Summary : Script to create Indices for FOP
Group : Productivity/Publishing/XML
Requires : ImageMagick
Requires : perl
%description pdf2index
Contains the script pdf2index which creates indices for FOP.
%prep
# %%setup -q -n docbook-xsl-%%{realversion} -b1
%setup -q -c -T -n docbook-xsl
# Prepare directories:
mkdir docbook-xsl-%{realversion} -ns docbook-xsl-%{realversion} -nons
# Copy all source files and make scripts executable:
cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} .
chmod +x $(basename %{SOURCE10} ) $(basename %{SOURCE11} )
# Replace version in XML catalog files
db4=$(basename %{SOURCE2} )
db5=$(basename %{SOURCE3} )
2018-04-03 10:46:26 +00:00
sed --in-place 's/@VERSION@/%{realversion}/g' $db4
sed --in-place 's/@VERSION@/%{realversion}/g' $db5
2017-11-27 09:12:46 +00:00
# Unpack stylesheet and doc sources into the correct directory:
tar xf %{SOURCE0} -C docbook-xsl-%{realversion} -ns --strip-components 1
tar xf %{SOURCE1} -C docbook-xsl-%{realversion} -ns --strip-components 1
# Patch the orginal source and remove unnecessary files:
(cd docbook-xsl-%{realversion} -ns
%patch0 -p1
%patch1 -p1
2023-11-15 09:32:02 +00:00
# %%patch2 -p1
2017-11-27 09:12:46 +00:00
# Remove some Python and Java extensions
# Remove dbtoepub Ruby script. This has been moved to devel:languages:ruby:extensions
# see rubygem-dbtoepub
rm -rf extensions/*.py extensions/saxon65.jar extensions/xalan27.jar \
extensions/build.xml epub/bin
)
%build
pushd docbook-xsl-%{realversion} -ns
find slides -regex " . * \ . \ ( x m l \ | h t c \ | \ | h u \ | j s \ | s v g \ | c s s \ | h t m l \ . * \ | t x t \ | r n c \ | x h t m l \ ) " \
-exec sed -i 's/\r//' {} \;
# Fix wrong end-of-line encoding:
sed -i 's/\r//' params/*
# Correct file and directory properties:
find -type f -exec chmod 644 {} \;
find -type d -exec chmod 755 {} \;
# Remove any .htaccess files:
find -type f -name " \ . h t a c c e s s " -exec rm {} \;
popd
# Create the non-NS variant from the NS original source:
./xslnons-build docbook-xsl-%{realversion} -ns docbook-xsl-%{realversion} -nons
%install
mkdir -p %{buildroot} %{_sysconfdir} /xml/catalog.d \
2018-04-03 10:46:26 +00:00
%{buildroot} %{rb_libdir} /
2017-11-27 09:12:46 +00:00
./dbxslt-install.sh --debug --buildroot=%{buildroot} \
--package-version=%{realversion} \
--package-name=%{db4package} \
--sourcedir=docbook-xsl-%{realversion} -nons
./dbxslt-install.sh --debug --buildroot=%{buildroot} \
--package-version=%{realversion} \
--package-name=%{db5package} \
--db-xsl-suffix=nwalsh5 \
--sourcedir=docbook-xsl-%{realversion} -ns
# The directory is already available at this point:
install -m644 %{db4style_catalog} %{db5style_catalog} %{buildroot} %{etcxmlcatalogd}
2023-11-15 09:32:02 +00:00
# Overwrite our files from assembly directory
cp %{SOURCE20} %{SOURCE21} %{buildroot} %{db5rootdir} /%{realversion} /assembly/
2017-11-27 09:12:46 +00:00
%fdupes -s %{buildroot}
%post -n %{db4package}
update-xml-catalog
%postun -n %{db4package}
update-xml-catalog
%post -n %{db5package}
update-xml-catalog
%postun -n %{db5package}
update-xml-catalog
%files -n %{db4package}
%config %{_sysconfdir} /xml/catalog.d/%{db4style_catalog}
%doc docbook-xsl-%{realversion} -nons/BUGS docbook-xsl-%{realversion} -nons/NEWS
%doc docbook-xsl-%{realversion} -nons/README docbook-xsl-%{realversion} -nons/RELEASE-NOTES.*
%doc docbook-xsl-%{realversion} -nons/TODO
%dir %{_datadir} /xml/docbook/stylesheet
%dir %{db4rootdir}
%dir %{db4rootdir} /%{realversion}
%exclude %{db4rootdir} /%{realversion} /fo/pdf2index
%{db4rootdir} /current
%{db4rootdir} /%{realversion} /*
%files -n %{db5package}
%config %{_sysconfdir} /xml/catalog.d/%{db5style_catalog}
%doc docbook-xsl-%{realversion} -ns/BUGS docbook-xsl-%{realversion} -ns/NEWS
%doc docbook-xsl-%{realversion} -ns/README docbook-xsl-%{realversion} -ns/RELEASE-NOTES.*
%doc docbook-xsl-%{realversion} -ns/TODO
%dir %{_datadir} /xml/docbook/stylesheet
%dir %{db5rootdir}
%dir %{db5rootdir} /%{realversion}
%exclude %{db5rootdir} /%{realversion} /fo/pdf2index
%{db5rootdir} /current
%{db5rootdir} /%{realversion} /*
%files pdf2index
%attr (0755,root,root) %{_bindir} /pdf2index
%changelog