From c758a9bdb1fb4ce6959549ab4a585b16b375e18b22034f846f305d06ea4a34df Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Tue, 30 Aug 2016 08:03:34 +0000 Subject: [PATCH] Fix package * Use spec-cleaner * Raise version to 2.0.6.2 * Completely revamp postun and post section with Fabian => the line "if [ ! -f %{_sysconfdir}/xml/%{suse_schemas_catalog}" wasn't correctly resolved due to the undefined macro suse_schemas_catalog OBS-URL: https://build.opensuse.org/package/show/Documentation:Tools/suse-xsl-stylesheets?expand=0&rev=104 --- suse-xsl-stylesheets.spec | 164 ++++++++++++++------------------------ 1 file changed, 61 insertions(+), 103 deletions(-) diff --git a/suse-xsl-stylesheets.spec b/suse-xsl-stylesheets.spec index 8b1d5df..1c94172 100644 --- a/suse-xsl-stylesheets.spec +++ b/suse-xsl-stylesheets.spec @@ -1,7 +1,7 @@ # # spec file for package suse-xsl-stylesheets # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,28 +16,11 @@ # +%define db_xml_dir %{_datadir}/xml/docbook +%define suse_styles_dir %{db_xml_dir}/stylesheet Name: suse-xsl-stylesheets Version: 2.0.6.1 Release: 0 - -############################################################### -# -# ATTENTION: Do NOT edit this file outside of -# https://svn.code.sf.net/p/daps/svn/trunk/daps/\ -# suse/packaging/suse-xsl-stylesheets.spec -# -# Your changes will be lost on the next update -# If you do not have access to the SVN repository, notify -# and -# or send a patch -# -################################################################ - -%define dbstyles %{_datadir}/xml/docbook/stylesheet/nwalsh/current -%define susexsl_catalog catalog-for-%{name}.xml -%define db_xml_dir %{_datadir}/xml/docbook -%define suse_styles_dir %{db_xml_dir}/stylesheet - Summary: SUSE-Branded Stylesheets for DocBook License: GPL-2.0 or GPL-3.0 Group: Productivity/Publishing/XML @@ -45,77 +28,64 @@ Url: http://sourceforge.net/p/daps/suse-xslt Source0: %{name}-%{version}.tar.bz2 Source1: susexsl-fetch-source-git Source2: %{name}.rpmlintrc -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch - BuildRequires: aspell BuildRequires: aspell-en BuildRequires: docbook-xsl-stylesheets >= 1.77 BuildRequires: docbook5-xsl-stylesheets >= 1.77 BuildRequires: fdupes +BuildRequires: fontpackages-devel BuildRequires: libxml2-tools BuildRequires: libxslt BuildRequires: make -# Only needed to fix the "have choice" error between xerces-j2 and crimson -%if 0%{?suse_version} == 1210 -BuildRequires: xerces-j2 -%endif -BuildRequires: fontpackages-devel BuildRequires: trang - -Requires: docbook_4 -Requires: docbook_5 -Requires: docbook-xsl-stylesheets >= 1.77 -Requires: docbook5-xsl-stylesheets >= 1.77 - -Requires: libxslt -Requires: aspell-en - -Recommends: daps - - -#------ -# Fonts -#------ - -# Western fallback: currently necessary for building with XEP, it seems. -Requires: ghostscript-fonts-std - -# Western fallback 2: These should make the Ghostscript fonts unnecessary. -Requires: gnu-free-fonts - -# "Generic" font for use in cases where we don't want one of the gnu-free-fonts -Requires: dejavu-fonts - -# FONTS USED IN "suse" (aka "suse2005") STYLESHEETS -# Proprietary Western: -Recommends: agfa-fonts -# Fallback for proprietary Western: -Requires: liberation-fonts -# Japanese: -Requires: sazanami-fonts -# Korean: -Requires: un-fonts -# Chinese: -Requires: wqy-microhei-fonts - - -# FONTS USED IN "suse2013" STYLESHEETS -# Western fonts: -Requires: google-opensans-fonts -Requires: sil-charis-fonts +# Korean -- un-fonts, already required +# Arabic: +Requires: arabic-amiri-fonts # Monospace -- dejavu-fonts, already required # Western fonts fallback -- gnu-free-fonts, already required # Chinese simplified -- wqy-microhei-fonts, already required # Chinese traditional: Requires: arphic-uming-fonts +Requires: aspell-en +# "Generic" font for use in cases where we don't want one of the gnu-free-fonts +Requires: dejavu-fonts +Requires: docbook-xsl-stylesheets >= 1.77 +Requires: docbook5-xsl-stylesheets >= 1.77 +Requires: docbook_4 +Requires: docbook_5 +#------ +# Fonts +#------ +# Western fallback: currently necessary for building with XEP, it seems. +Requires: ghostscript-fonts-std +# Western fallback 2: These should make the Ghostscript fonts unnecessary. +Requires: gnu-free-fonts +# FONTS USED IN "suse2013" STYLESHEETS +# Western fonts: +Requires: google-opensans-fonts # Japanese: Requires: ipa-pgothic-fonts Requires: ipa-pmincho-fonts -# Korean -- un-fonts, already required -# Arabic: -Requires: arabic-amiri-fonts - +# Fallback for proprietary Western: +Requires: liberation-fonts +Requires: libxslt +# Japanese: +Requires: sazanami-fonts +Requires: sil-charis-fonts +# Korean: +Requires: un-fonts +# Chinese: +Requires: wqy-microhei-fonts +# FONTS USED IN "suse" (aka "suse2005") STYLESHEETS +# Proprietary Western: +Recommends: agfa-fonts +Recommends: daps +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch +# Only needed to fix the "have choice" error between xerces-j2 and crimson +%if 0%{?suse_version} == 1210 +BuildRequires: xerces-j2 +%endif %description These are SUSE-branded XSLT 1.0 stylesheets for DocBook 4 and 5 that are be used @@ -127,64 +97,52 @@ use: The NovDoc DTD, a subset of the DocBook 4 DTD and the SUSEdoc schema, a subset of the DocBook 5 schema. #-------------------------------------------------------------------------- + %prep %setup -q -n %{name} #-------------------------------------------------------------------------- + %build -%__make %{?_smp_mflags} +make %{?_smp_mflags} #-------------------------------------------------------------------------- + %install -make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%_libdir +make install DESTDIR=%{buildroot} LIBDIR=%{_libdir} # create symlinks: -%fdupes -s $RPM_BUILD_ROOT/%{_datadir} +%fdupes -s %{buildroot}/%{_datadir} #---------------------- + %post -# XML Catalogs -# -# remove existing entries first - needed for -# zypper in, since it does not call postun -# delete ... -if [ "2" = "$1" ]; then - edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \ - --del %{name} || true -fi - -# ... and (re)add it again -edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \ - --add %{_sysconfdir}/xml/%{susexsl_catalog} - %reconfigure_fonts_post +if [ ! -f %{_sysconfdir}/xml/suse-catalog.xml -a -x %{_bindir}/edit-xml-catalog ] ; then + # susexsl entry + edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \ + --del %{name} + edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \ + --del suse_schemas +fi exit 0 #---------------------- + %postun -# -# Remove catalog entries -# -# delete catalog entries -# only run if package is really uninstalled ($1 = 0) and not -# in case of an update -# if [ "0" = "$1" ]; then - if [ ! -f %{_sysconfdir}/xml/%{suse_schemas_catalog} -a -x /usr/bin/edit-xml-catalog ] ; then - # susexsl entry - edit-xml-catalog --group --catalog %{_sysconfdir}/xml/suse-catalog.xml \ - --del %{name} - fi %reconfigure_fonts_post fi exit 0 #---------------------- + %posttrans %reconfigure_fonts_posttrans #---------------------- + %files %defattr(-,root,root)