File docbook5-xsl-stylesheets.spec of Package docbook5-xsl-stylesheets

#
# spec file for package docbook5-xsl-stylesheets (Version 1.74.0)
#
# Copyright (c) 2008 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:           docbook5-xsl-stylesheets
BuildRequires:  bzip2 sgml-skel unzip
License:        Public Domain, Freeware
Group:          Productivity/Publishing/DocBook
AutoReqProv:    on
BuildArch:      noarch
Requires:       xmlcharent docbook_5 awk coreutils
%define regcat /usr/bin/sgml-register-catalog
Provides:       docbkxsl
PreReq:         %{regcat} /usr/bin/xmlcatalog
Summary:        XSL Stylesheets for DocBook 5
Version:        1.74.0
Release:        1
Source0:        http://switch.dl.sourceforge.net/sourceforge/docbook/docbook-xsl-ns-%{version}.tar.bz2
### snap
#Source100: docbook-xsl-snapshot.zip
### snap end
#Source0:      http://docbook.sourceforge.net/snapshot/docbook-xsl-snapshot.tar.bz2
#Source10:     http://docbook.sourceforge.net/snapshot/docbook-xsl-doc-snapshot.tar.bz2
#Patch:        manpages-block-sp.patch
#Patch1:       manpages-block-sp-2.patch
# %define pack_vers snapshot
%define pack_vers %{version}
#Source1:        %{name}-README.SuSE
# Patch: docbkxsl.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://www.docbook.org

%description
These are the XSL stylesheets for DocBook. Generally, the stylesheets
are namespace aware and you should use these for DocBook 5 only. The
stylesheets transforms your DocBook 5 document into (X)HTML, Manpages,
XSL-FO (for PDF) and a some 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 theW3C.



Authors:
--------
    Norman Walsh <ndw@nwalsh.com>
    Michael Smith <smith@xml-doc.org>
    Bob Stayton

%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}/docbook
%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}/docbook
%define xml_mod_dtd_dir %{xml_mod_dir}/dtd
%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}/nwalsh5
%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 -q -n docbook-xsl-ns-%{version}
# Make some small modifications:
find . -name .gitignore | xargs %{__rm}
find -name "*.py" | xargs %{__chmod} 0755
find -name "*.rb" | xargs %{__chmod} 0755
[ -f epub/bin/dbtoepub ] &&  %{__chmod} 0755 epub/bin/dbtoepub
%{__chmod} -R a+rX,g-w,o-w .
%{__chmod} -x images/*.{svg,png,gif,tif} images/callouts/*.{svg,png,gif}
# Start cleanup (to avoid warnings for rpmlint
[ -f ./extensions/saxon65/dist/saxon65.jar ] && %{__rm} -rf ./extensions/saxon65/dist/saxon65.jar
[ -f ./extensions/xalan27/dist/xalan27.jar ] && %{__rm} -rf ./extensions/xalan27/dist/xalan27.jar
#x=$(find {lib,html,fo,lib,website,slides/fo,slides/html,roundtrip,manpages}/.[a-zA-Z0-9]* -maxdepth 1 -type f )
#if [ "$x" != '' ]; then 
## rm $x; 
#  for i in $x; do
#     if [ -f $i ]; then
#        rm $i
#     fi
#  done
#fi
# End Cleanup

%build
xmlcatbin=/usr/bin/xmlcatalog
CATALOG=%{name}-%{version}.xml
# file:///usr/share/sgml/docbook/ = %{sgml_mod_dir} map it to
# %{xml_mod_style_prod_dir}/%{version}
$xmlcatbin --noout --create $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteSystem" \
 "http://docbook.sourceforge.net/release/xsl-ns/%{version}" \
 "file://%{xml_mod_style_prod_dir}/%{version}" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteURI" \
 "http://docbook.sourceforge.net/release/xsl-ns/%{version}" \
 "file://%{xml_mod_style_prod_dir}/%{version}" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteSystem" \
 "http://docbook.sourceforge.net/release/xsl-ns/current" \
 "file://%{xml_mod_style_prod_dir}/%{version}" $CATALOG
/usr/bin/xmlcatalog --noout --add "rewriteURI" \
 "http://docbook.sourceforge.net/release/xsl-ns/current" \
 "file://%{xml_mod_style_prod_dir}/%{version}" $CATALOG
%define FOR_ROOT_CAT for-catalog-%{name}-%{version}-%{release}.xml
CATALOG=etc/xml/$CATALOG
%{__rm} -f %{FOR_ROOT_CAT}.tmp
$xmlcatbin --noout --create %{FOR_ROOT_CAT}.tmp
$xmlcatbin --noout --add "delegateSystem" \
  "http://docbook.sourceforge.net/release/xsl-ns/" \
  "file:///$CATALOG" %{FOR_ROOT_CAT}.tmp
# $xmlcatbin --noout --add "delegatePublic" \
#   "-//OASIS//xxx" \
#   "file:///$CATALOG" %{FOR_ROOT_CAT}.tmp
# Create tag
sed '/<catalog/a\
  <group id="%{name}-%{version}-%{release}">
/<\/catalog/i\
  </group>' \
  %{FOR_ROOT_CAT}.tmp > %{FOR_ROOT_CAT}

%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
#export RPM_BUILD_ROOT
#if [ ! "x" = "x$RPM_BUILD_ROOT" ]; then
#  %{__rm} -fr $RPM_BUILD_ROOT
#  %{__mkdir} %{buildroot}
#fi
doc_dir=$RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
%{INSTALL_DIR} $RPM_BUILD_ROOT%{xml_mod_style_prod_dir}/%{version}
%{__cp} -a [[:lower:]]* $RPM_BUILD_ROOT%{xml_mod_style_prod_dir}/%{version}
%{__cp} -a VERSION $RPM_BUILD_ROOT%{xml_mod_style_prod_dir}/%{version}
find $RPM_BUILD_ROOT%{xml_mod_style_prod_dir} -type f -name '*.orig' -exec %{__rm} -f {} \;
%{__rm} -f $RPM_BUILD_ROOT%{xml_mod_style_prod_dir}/%{version}/for-catalog*
: >%{name}_list
{
  pushd $RPM_BUILD_ROOT%{xml_mod_style_prod_dir} >/dev/null
# do not create the current link for snapshots
#  if ! echo %{S:0} | grep -q snapshot; then
    ln -sf %{version} current
    echo %{xml_mod_style_prod_dir}/current
#  fi
  popd >/dev/null
} >%{name}_list
%{INSTALL_DIR} $doc_dir
# documentation
for f in README BUGS TODO WhatsNew RELEASE-NOTES.html; do
  # On snapshots, WhatsNew is missing
  [ -f $f ] && %{INSTALL_DATA} $f $doc_dir/$f
done
#cp -p README.SuSE $doc_dir/README.SuSE
#
{
  LANG=C \
    find %{buildroot}%{xml_mod_style_prod_dir}/%{version} \
    -type d \
    -not -path '%{buildroot}%{xml_mod_style_prod_dir}/%{version}/latex*' \
    | sed 's|%{buildroot}|%dir |'
  LANG=C \
    find %{buildroot}%{xml_mod_style_prod_dir}/%{version} \
    -type f \
    -not -path '%{buildroot}%{xml_mod_style_prod_dir}/%{version}/latex*' \
    | sed 's|%{buildroot}||'
} >> %{_builddir}/%{buildsubdir}/%{name}_list
# pushd %{buildroot}%{xml_mod_style_prod_dir}
#   rm -f docbook-xsl
#   ln -sf docbook-xsl-stylesheets-%{version} docbook-xsl-ns
#   rm -f xsl-stylesheets
#   ln -sf docbook-xsl-stylesheets-%{version} xsl-ns-stylesheets
#   rm -f %{name}
#   ln -sf docbook-xsl-stylesheets-%{version} %{name}
# popd
cat_dir=%{buildroot}/etc/xml
%{INSTALL_DIR} $cat_dir
%{INSTALL_DATA} %{FOR_ROOT_CAT} %{name}-%{version}.xml $cat_dir

%pre
# in case of an update check for old dirs (affected systems =< SL 9.0)
old="docbook-xsl*"
pushd %{sgml_dir}/docbook >/dev/null
{
  for f in $old; do
    [ -d $f ] && echo $f || :
    [ -L $f ] && echo $f || :
  done
} >> /var/adm/SuSEconfig/run-sgmldir-links

%post
# remove empty dir if present (from ghost)
# also remove dangling symlink
D=usr/share/sgml
rmdir $D/docbkxsl >/dev/null 2>&1 || :
test -L $D/docbkxsl -a ! -e $D/docbkxsl && %{__rm} -f $D/docbkxsl
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
  --add /etc/xml/%{FOR_ROOT_CAT}
exit 0

%postun
edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \
  --del %{name}-%{version}-%{release}
exit 0

%clean
%{__rm} -fr $RPM_BUILD_ROOT

%files -f %{name}_list
%defattr(-, root, root)
# compatibility link; will go away with SuSE Linux >= 8.x
%config %{_sysconfdir}/xml/%{name}-%{version}.xml
%config %{_sysconfdir}/xml/%{FOR_ROOT_CAT}
%{_defaultdocdir}/%{name}
# %dir %{xml_dir}
#%dir %{xml_mod_dir}
%dir %{xml_mod_style_dir}
%dir %{xml_mod_style_prod_dir}
# it is now in the list:
# %{xml_mod_style_prod_dir}/current

%changelog
* Thu Jul 24 2008 toms@suse.de
  Updated to version 1.74.0:
  *  Paul Norton (Adobe) and Keith Fahlgren (O'Reilly Media) have donated
  code that generates .epub documents from DocBook input. An
  alpha-reference implementation in Ruby has also been provided.
  .epub is an open standard of the The International Digital Publishing
  Forum (IDPF), a the trade and standards association for the digital
  publishing industry. Read more about this target in epub/README
  * XHTML 1.1 target
  To support .epub output, a strict XHTML 1.1 target has been added.
  The stylesheets for this output are generated and are quite similar to
  the XHTML target.
  * Gentext updates
  A number of locales have been updated.
  * Roundtrip improvements
  Table, figure, template syncronization, and character style improvements
  have been made for WordML & Pages. Support added for OpenOffice.org.
  * First implementation of a libxslt extension
  A stylesheet extension for libxslt, written in Python, has been added.
  The extension is a function for adjusting column widths in CALS tables.
  See extensions/README.LIBXSLT for more information.
  Fixed bugs since the 1.73.2 release:
  [#1838136], #1811721, #1759205, #1797492, #1891965, #1854199,
  [#1669658], #1740964, #1680836, #1888169, #1854199, #1790495,
  [#1680836], #1790495, #1894244, #1858329, #1648360, #1648360,
  [#1648360], #1785224
  See http://docbook.xml-doc.org/snapshots/xsl-ns/RELEASE-NOTES.html#V1.74.0
  for more information.
* Mon Feb 04 2008 toms@suse.de
- Corrected URIs for accessing the DocBook XSL NS stylesheets. Uses
  the "official" URI now:
  http://docbook.sourceforge.net/release/xsl-ns/current/FORMAT/
  (see the "xsl-ns" instead of "xsl". The latter is used by the
  docbook-xsl-stylesheet package.)
* Sat Dec 22 2007 coolo@suse.de
- remove conflict with docbook-xsl-stylesheet as they obsoleted both
  the same
* Mon Aug 20 2007 toms@suse.de
- Update to version 1.73.1, bugfix release:
  Gentext:
  * Mauritz Jeanson: locale/de.xml
  Applied patch #1766009.
  * Michael(tm) Smith: locale/lv.xml
  Added localization for ProductionSet.
  FO:
  * Mauritz Jeanson: table.xsl
  Modified the tgroup template so that, for tables with multiple tgroups,
  a width attribute is output on all corresponding fo:tables. Previously,
  there was a test prohibiting this (and a comment saying that outputting more
  than one width attribute will cause an error). But this seems to be no longer
  relevant; it is not a problem with FOP 0.93 or XEP 4.10. Closes bug #1760559.
  * Mauritz Jeanson: graphics.xsl
  Replaced useless <a> elements with warning messages (textinsert extension).
  * Mauritz Jeanson: admon.xsl
  Enabled generation of ids (on fo:wrapper) for indexterms in admonition titles,
  so that page references in the index can be created. Closes bug #1775086.
  HTML:
  * Mauritz Jeanson: titlepage.xsl
  Added <xsl:call-template name="process.footnotes"/> to abstract template
  so that footnotes in info/abstract are processed. Closes bug #1760907.
  * Michael(tm) Smith: pi.xsl; synop.xsl
  Changed handling of HTML output for the cmdsynopsis and
  funcsynopsis elements, such that a@id instances are generated for
  them if they are descendants of any element containing a dbcmdlist
  or dbfunclist PI. Also, update the embedded reference docs for the
  dbcmdlist and dbfunclist PIs to make it clear that they can be
  used within any element for which cmdsynopsis or funcsynopsis are
  valid children.
  * Michael(tm) Smith: formal.xsl
  Reverted the part of revision 6952 that caused a@id anchors to be
  generated for output of informal objects. Thanks to Sam Steingold
  for reporting.
  * Robert Stayton: glossary.xsl
  Account for a glossary with no glossdiv or glossentry children.
  * Mauritz Jeanson: titlepage.xsl
  Modified legalnotice template so that the base.name parameter is calculated
  in the same way as for revhistory chunks. Using <xsl:apply-templates
  mode="chunk-filename" select="."/> did not work for single-page output since
  the template with that mode is in chunk-code.xsl.
  * Mauritz Jeanson: graphics.xsl
  Updated support for SVG (must be a child of imagedata in DB 5).
  Added support for MathML in imagedata.
  * Mauritz Jeanson: pi.xsl
  Added documentation for the dbhh PI (used for context-sensitive HTML Help).
  (The two templates matching 'dbhh' are still in htmlhelp-common.xsl).
  Manpages:
  * Michael(tm) Smith: endnotes.xsl
  In manpages output, generate warnings about notesources with
  non-para children only if the notesource is a footnote or
  annotation. Thanks to Sam Steingold for reporting problems with
  the existing handling.
  HTMLHelp:
  * Michael(tm) Smith: htmlhelp-common.xsl
  Added single-pass namespace-stripping support to the htmlhelp,
  eclipse, and javahelp stylesheets.
  Eclipse:
  * Michael(tm) Smith: eclipse.xsl
  Added single-pass namespace-stripping support to the htmlhelp,
  eclipse, and javahelp stylesheets.
  JavaHelp:
  * Michael(tm) Smith: javahelp.xsl
  Added single-pass namespace-stripping support to the htmlhelp,
  eclipse, and javahelp stylesheets.
  Roundtrip:
  * Steve Ball: blocks2dbk.xsl; blocks2dbk.dtd; pages2normalise.xsl
  Modularised blocks2dbk to allow customisation,
  Added support for tables to pages2normalise
  Params:
  * Robert Stayton: procedure.properties.xml
  procedure was inheriting keep-together from formal.object.properties, but
  a procedure does not need to be kept together by default.
  * Dave Pawson: title.font.family.xml;
  component.label.includes.part.label.xml; table.frame.b
  Regular formatting re-org.
* Wed Jul 25 2007 toms@suse.de
- New release 1.73.0
  * Added Latvian and Esperanto translation, fixes in other locales
  * Description of all available PIs
  * Fix bug 1668629 valign on tbody not inherited.
  * Added template for xref to area/areaset.
  Part of fix for bug #1675513 (xref to area broken).
  * Fixed bug #1711508 (lists.xsl)
  * Added support for spacing="compact" in variablelist,
  per bug report #1722540.
  * Fixed bug #1669601 (footnote.xsl)
  * Fixed #1680755 (keycombo joinchar default incorrect).
  * Fixed bug 1652360 empty link with xlink:href.
  * Add support for default.table.frame parameter.
  Fix bug 1575446 rowsep last check for @morerows.
  => More in NEWS
* Mon May 07 2007 toms@suse.de
- Corrected BuildRequires
* Thu Mar 15 2007 toms@suse.de
- Fixed installed paths: .../stylesheet5 -> .../stylesheet,
  .../nwalsh -> .../nwalsh5
* Tue Feb 27 2007 toms@suse.de
- First release 1.72.0 of DocBook XSL Stylesheets for DocBook 5
openSUSE Build Service is sponsored by