From 8509bc854c18ec73f0b506f278a306e6409d75a0 Mon Sep 17 00:00:00 2001 From: Heng Qi Date: Sat, 15 Apr 2023 13:46:10 +0800 Subject: [PATCH] Refactor the spec file Signed-off-by: Heng Qi --- docbook5-style-xsl.spec | 77 ++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/docbook5-style-xsl.spec b/docbook5-style-xsl.spec index bb5c776..42505ac 100644 --- a/docbook5-style-xsl.spec +++ b/docbook5-style-xsl.spec @@ -1,33 +1,28 @@ -%define anolis_release 2 +%define anolis_release 3 + +%global xnstyle_sheets xsl-ns-stylesheets Name: docbook5-style-xsl +Summary: Norman Walsh's XSL stylesheets for DocBook 5.X Version: 1.79.2 Epoch: 1 Release: %{anolis_release}%{?dist} - -Summary: Norman Walsh's XSL stylesheets for DocBook 5.X - -# Package is licensed as MIT/X (http://wiki.docbook.org/topic/DocBookLicense), -# some .js files under ./slides/browser/ are licensed MPLv1.1 License: MIT and MPLv1.1 -URL: https://github.com/docbook/xslt10-stylesheets - Provides: docbook-xsl-ns = %{version} -# xml-common was using /usr/share/xml until 0.6.3-8. Requires: xml-common >= 0.6.3 -# libxml2 required because of usage of /usr/bin/xmlcatalog Requires(post): libxml2 >= 2.4.8 Requires(postun): libxml2 >= 2.4.8 Conflicts: passivetex < 1.21 - BuildArch: noarch +URL: https://github.com/docbook/xslt10-stylesheets Source0: https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F{%version}/docbook-xsl-%{version}.tar.bz2 %description -These XSL namespace aware stylesheets allow you to transform any -DocBook 5 document to other formats, such as HTML, manpages, FO, -XHMTL and other formats. They are highly customizable. For more -information see W3C page about XSL. +XSLT 1.0 stylesheets are a set of XML files that define rules for transforming XML +documents into other formats, such as HTML, XHTML, or plain text. They are written in XSLT, +a declarative language for manipulating XML data. These stylesheets enable developers to +separate the presentation of the data from the data itself, allowing for greater flexibility +and reusability of data. They are widely used in web development and publishing industries. %package doc Summary: Documentation files for %{name} @@ -35,73 +30,67 @@ Requires: %{name} = %{EVR} BuildArch: noarch %description doc -The %{name}-doc package contains documentation files for %{name}. +The document package provides documentation files for %{name}. %prep -%setup -q -n docbook-xsl-%{version} -#remove .gitignore files -rm -rf $(find -name '.gitignore' -type f) -#make ruby scripts executable +%autosetup -n docbook-xsl-%{version} chmod +x epub/bin/dbtoepub +rm -rf $(find -name '.gitignore' -type f) %build %install DESTDIR=$RPM_BUILD_ROOT -mkdir -p $DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%version -cp -a [[:lower:]]* $DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%version/ -cp -a VERSION $DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%version/VERSION.xsl -ln -s VERSION.xsl \ -$DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%version/VERSION -ln -s xsl-ns-stylesheets-%{version} \ - $DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets +mkdir -p $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%version +cp -a VERSION $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%version/VERSION.xsl +cp -a [[:lower:]]* $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%version/ -# Don't ship install shell script. -rm -rf $DESTDIR%{_datadir}/sgml/docbook/xsl-ns-stylesheets/install.sh +ln -s VERSION.xsl $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%version/VERSION +ln -s %{xnstyle_sheets}-%{version} $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets} +rm -rf $DESTDIR%{_datadir}/sgml/docbook/%{xnstyle_sheets}/install.sh %post CATALOG=%{_sysconfdir}/xml/catalog %{_bindir}/xmlcatalog --noout --add "rewriteSystem" \ "http://cdn.docbook.org/release/xsl/%{version}" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %{_bindir}/xmlcatalog --noout --add "rewriteURI" \ "http://cdn.docbook.org/release/xsl/%{version}" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %{_bindir}/xmlcatalog --noout --add "rewriteSystem" \ "http://cdn.docbook.org/release/xsl/current/" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %{_bindir}/xmlcatalog --noout --add "rewriteURI" \ "http://cdn.docbook.org/release/xsl/current/" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %{_bindir}/xmlcatalog --noout --add "rewriteSystem" \ "http://docbook.sourceforge.net/release/xsl-ns/current" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %{_bindir}/xmlcatalog --noout --add "rewriteURI" \ "http://docbook.sourceforge.net/release/xsl-ns/current" \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG %postun -# remove entries only on removal of package if [ "$1" = 0 ]; then CATALOG=%{_sysconfdir}/xml/catalog %{_bindir}/xmlcatalog --noout --del \ - "file://%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}" $CATALOG + "file://%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}" $CATALOG fi %files %license COPYING -%{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version} -%{_datadir}/sgml/docbook/xsl-ns-stylesheets -%exclude %{_datadir}/sgml/docbook/xsl-ns-stylesheets-%{version}/extensions +%{_datadir}/sgml/docbook/%{xnstyle_sheets} +%{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version} +%exclude %{_datadir}/sgml/docbook/%{xnstyle_sheets}-%{version}/extensions %files doc -%doc BUGS -%doc README -%doc TODO NEWS -%doc RELEASE-NOTES.* +%doc BUGS README TODO NEWS RELEASE-NOTES.* %changelog +* Sat Apr 15 2023 Heng Qi - 1.2.1-2 +- Refactor the spec file + * Mon Feb 13 2023 happy_orange - 1:1.79.2-2 - add doc package -- Gitee