Hello community,

here is the log from the commit of package docbook-xsl-stylesheets for 
openSUSE:Factory checked in at 2013-10-01 08:10:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/docbook-xsl-stylesheets (Old)
 and      /work/SRC/openSUSE:Factory/.docbook-xsl-stylesheets.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "docbook-xsl-stylesheets"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/docbook-xsl-stylesheets/docbook-xsl-stylesheets.changes
  2013-07-11 13:27:43.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.docbook-xsl-stylesheets.new/docbook-xsl-stylesheets.changes
     2013-10-01 08:10:49.000000000 +0200
@@ -1,0 +2,5 @@
+Mon Sep 23 13:51:41 UTC 2013 - [email protected]
+
+- Moved installation procedure into dbxslt-install.sh Shell script
+
+-------------------------------------------------------------------

New:
----
  dbxslt-install.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ docbook-xsl-stylesheets.spec ++++++
--- /var/tmp/diff_new_pack.ovAQmj/_old  2013-10-01 08:11:01.000000000 +0200
+++ /var/tmp/diff_new_pack.ovAQmj/_new  2013-10-01 08:11:01.000000000 +0200
@@ -29,6 +29,7 @@
 BuildRequires:  fdupes
 BuildRequires:  sgml-skel
 BuildRequires:  unzip
+# BuildRequires:  dos2unix
 BuildArch:      noarch
 Requires:       docbook_4
 Requires:       xmlcharent
@@ -37,6 +38,7 @@
 Release:        0
 Source0:        
http://switch.dl.sourceforge.net/sourceforge/docbook/docbook-xsl-%{version}.tar.bz2
 Source1:        
http://switch.dl.sourceforge.net/sourceforge/docbook/docbook-xsl-doc-%{version}.tar.bz2
+Source10:       dbxslt-install.sh
 Patch0:         %{name}-dbtoepub.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Url:            http://sourceforge.net/projects/docbook/
@@ -78,69 +80,29 @@
 %prep
 %setup -q -n docbook-xsl-%{version} -b1
 %patch0 -p1
+cp %{S:10} .
 
 #--------------------------------------------------------------------------
 %build
-
 #
-# Creating catalog entries
 #
+find slides -regex 
".*\.\(xml\|htc\|\|hu\|js\|svg\|css\|html\.*\|txt\|rnc\|xhtml\)" \
+   -exec sed -i 's/\r//' {} \;
+
+# Fix wrong end-of-line encoding
+sed -i 's/\r//' params/*
 
 #
-# /etc/xml/docbook-xsl-stylesheets.xml
-#
-%{xmlcatalog} --noout --create %{dbstyle_catalog}
-%{xmlcatalog} --noout --add "rewriteSystem" \
- "http://docbook.sourceforge.net/release/xsl/%{version}"; \
- "file://%{dbstyle_dir}/%{version}" %{dbstyle_catalog}
-%{xmlcatalog} --noout --add "rewriteURI" \
- "http://docbook.sourceforge.net/release/xsl/%{version}"; \
- "file://%{dbstyle_dir}/%{version}" %{dbstyle_catalog}
-%{xmlcatalog} --noout --add "rewriteSystem" \
- "http://docbook.sourceforge.net/release/xsl/current"; \
- "file://%{dbstyle_dir}/%{version}" %{dbstyle_catalog}
-%{xmlcatalog} --noout --add "rewriteURI" \
- "http://docbook.sourceforge.net/release/xsl/current"; \
- "file://%{dbstyle_dir}/%{version}" %{dbstyle_catalog}
-
-#
-# temporary file that is added to /etc/xml/suse-catalog.xml
-# during post
-#
-%{xmlcatalog} --noout --create %{dbstyle_catalog_entry}
-%{xmlcatalog} --noout --add "delegateSystem" \
-  "http://docbook.sourceforge.net/release/xsl/"; \
-  "file:///etc/xml/%{dbstyle_catalog}" %{dbstyle_catalog_entry}
-%__sed -i -e '/<catalog/a\ <group id="%{name}">' \
-       -e '/<\/catalog/i\ </group>' %{dbstyle_catalog_entry}
+find -type f -exec chmod 644 {} \;
+find -type d -exec chmod 755 {} \;
+chmod 755 extensions/xslt.py
 
 #--------------------------------------------------------------------------
 %install
 
-# Create directories
-%__mkdir_p -m755 %{buildroot}%{_bindir}
-%__mkdir_p -m755 %{buildroot}%{dbstyle_dir}/%{version}
-%__mkdir_p -m755 %{buildroot}%{_defaultdocdir}/%{name}/html
-%__mkdir_p -m755 %{buildroot}%{_sysconfdir}/xml
-
-# Install scripts
-%__install -m755 fo/pdf2index       %{buildroot}%{_bindir}
-%__install -m755 epub/bin/dbtoepub  %{buildroot}%{_bindir}
-%__install -m755 slides/images/callouts/gen.sh 
%{buildroot}%{_bindir}/callout-gen
-rm slides/images/callouts/gen.sh
-
-# VERSION.xsl
-%__install -m644 VERSION.xsl %{buildroot}%{dbstyle_dir}/%{version}
-
-# all the rest is located in subdirectories, exclude some subdirectories with
-# stuff not needed
-for DIR in $(find -maxdepth 1 -mindepth 1 -type d \( -name "tools" -o -name 
"doc" -o -name "docsrc" -o -name "tests" \) -prune -o -type d -print ); do
-    %__tar c $DIR | (cd %{buildroot}%{dbstyle_dir}/%{version}; %__tar xp);
-done
+sh ./dbxslt-install.sh --package-version=%{version} --buildroot=%{buildroot}
+
 # fixing permission errors from sources
-find %{buildroot}%{dbstyle_dir}/%{version} -type f -exec %__chmod 644 {} \;
-find %{buildroot}%{dbstyle_dir}/%{version} -type d -exec %__chmod 755 {} \;
-%__chmod 755 %{buildroot}%{dbstyle_dir}/%{version}/extensions/xslt.py
 
 # create current link
 # but not for snapshots
@@ -151,13 +113,7 @@
     popd >/dev/null
 fi
 
-# install the catalog files
-#
-%__install -m644 %{dbstyle_catalog} %{buildroot}%{_sysconfdir}/xml
-%__install -m644 %{dbstyle_catalog_entry} %{buildroot}%{_sysconfdir}/xml
-
 # the docs come last
-#
 %__tar c -C doc . | (cd %{buildroot}%{_defaultdocdir}/%{name}/html; %__tar xp);
 
 %fdupes -s %{buildroot}
@@ -203,6 +159,7 @@
 
 %exclude %{dbstyle_dir}/%{version}/slides/slidy/.htaccess
 %exclude %{dbstyle_dir}/%{version}/slides/slidy/*/.htaccess
+# %%exclude %%{dbstyle_dir}/svn-commit.tmp
 
 %config %{_sysconfdir}/xml/*.xml
 
@@ -213,6 +170,8 @@
 
 %files scripts
 %defattr(-, root, root)
-%{_bindir}/*
+%{_bindir}/callout-gen
+%{_bindir}/dbtoepub
+%{_bindir}/pdf2index
 
 %changelog

++++++ dbxslt-install.sh ++++++
#!/bin/bash
#
# Installs the DocBook XSL Stylesheets on openSUSE systems
#
# Author: Thomas Schraitle
# Copyright (C) 2013 [email protected]
#

# set -x

ME=${0##*/}
PACKAGE=docbook-xsl-stylesheets
PACKAGE_DIR=docbook-xsl
PACKAGE_VERSION=@VERSION@

#----------------------------------------------------------------------
# System variables
BUILDROOT=
PREFIX=/usr
BINDIR=bin
DATAROOTDIR=share
DATADIR=$DATAROOTDIR
DOCDIR=$DATAROOTDIR/doc/packages
SYSCONFDIR=/etc
XMLCONFDIR=$SYSCONFDIR/xml
XMLDIR=$DATAROOTDIR/xml
DBSTYLE_CATALOG=$PACKAGE.xml
DBSTYLE_DIR=$XMLDIR/docbook/stylesheet/nwalsh
ORIG_DBSTYLE_DIR=$PREFIX/$DBSTYLE_DIR

function exit_on_error() {
   local result
   result=${2:-1}
   echo "ERROR: ${1}" >&2
   exit $result;
}


function my_debug() {
# Syntax: my_debug "MESSAGE" [MORE ARGUMENTS...]
# Prints debug messages, if DEBUG_SCRIPT is non-empty
    if [[ "$DEBUG_SCRIPT" ]]; then
        echo -e "[debug] ${0}: $@\n" >&2;
    fi
}

function usage() {
   cat << EOF
Installs the DocBook XSL Stylesheets

Usage:
$ME [OPTIONS]

Fine tuning of the installation directories:
  --buildroot=DIR         build root directory []
  --prefix=DIR              [/usr]
  --bindir=DIR            user executables [PREFIX/bin]
  --sysconfdir=DIR        read-only single-machine data [/etc]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/packages]

Package options:
  --package-name=NAME         name of the package [$PACKAGE]
  --package-dir=NAME          name of the package directory [$PACKAGE_DIR]
  --package-version=VERSION   version of the package [$PACKAGE_VERSION]

EOF
}

function printvariables() {
cat << EOF
package=$PACKAGE
package-version=$PACKAGE_VERSION
buildroot=$BUILDROOT
prefix=$PREFIX
bindir=$BINDIR
datarootdir=$DATAROOTDIR
datadir=$DATADIR
sysconfdir=$SYSCONFDIR
xmlconfdir=$XMLCONFDIR
docdir=$DOCDIR
xmldir=$XMLDIR
xsltrootdir=$XSLTROOTDIR
dbstyle_catalog=$DBSTYLE_CATALOG
dbstyle_catalog_entry=${DBSTYLE_CATALOG_ENTRY}
dbstyle_dir=$DBSTYLE_DIR
EOF
}

#----------------------------------------------------------------------
# 
DEBUG_SCRIPT=
DB4_XSLT_URL="http://docbook.sourceforge.net/release/xsl/";
DB5_XSLT_URL="http://docbook.sourceforge.net/release/xsl-ns/";
# Installation directories
DBXSLT_DIRS="assembly common eclipse epub epub3 extensions fo highlighting \
html htmlhelp lib javahelp manpages profiling roundtrip slides \
webhelp website xhtml xhtml-1_1 xhtml5"
DBXSLT_FILES="catalog.xml VERSION VERSION.xsl REVISION"
# Without INSTALL
DBXSLT_DOCFILES="params AUTHORS BUGS COPYING NEWS.html NEWS.xml README REVISION 
TODO \
RELEASE-NOTES.html RELEASE-NOTES.pdf RELEASE-NOTES.txt RELEASE-NOTES.xml"


#----------------------------------------------------------------------
# printing help / catching errors
#

if [[ -z "$1" ]]; then
  usage
  printvariables
  exit
fi


longopt="help,debug,package-name:,package-version:,\
bindir:,prefix:,datarootdir:,datadir:,docdir:,sysconfdir:,buildroot:"

export POSIXLY_CORRECT=1
ARGS=$(getopt -o h,d -l $longopt -n $ME -- "$@")
eval set -- "$ARGS"
while true ; do
   case "$1" in
      -h|--help)
         usage
         # printvariables
         exit
         ;;
      -d|--debug)
         DEBUG_SCRIPT=1
         shift
         ;;
      # 
      --package-name)
         PACKAGE=$2
         shift 2
         ;;
      --package-version)
         PACKAGE_VERSION="$2"
         shift 2
         ;;
      #
      --buildroot)
         BUILDROOT=$2
         shift 2
         ;;
      --bindir)
         BINDIR=$2
         shift 2
         ;;
      --prefix)
         PREFIX=$2
         shift 2
         ;;
      --datarootdir)
         DATAROOTDIR=$2
         shift 2
         ;;
      --datadir)
         DATADIR=$2
         shift 2
         ;;
      --docdir)
         DOCDIR=$2
         shift 2
         ;;
      --sysconfdir)
         SYSCONFDIR=$2
         shift 2
         ;;
      --printvariables)
         printvariables
         exit
         ;;
      --)
         break
         ;;
   esac
done
unset POSIXLY_CORRECT

PREFIX=$BUILDROOT$PREFIX
BINDIR=$PREFIX/$BINDIR
DATAROOTDIR=$PREFIX/$DATAROOTDIR
DATADIR=$PREFIX/$DATADIR
DOCDIR=$PREFIX/$DOCDIR
SYSCONFDIR=$BUILDROOT$SYSCONFDIR
XMLCONFDIR=$BUILDROOT/$XMLCONFDIR
XMLDIR=$PREFIX/$XMLDIR
XSLTROOTDIR=$PREFIX/$XSLTROOTDIR
# XSLTDIR=$PREFIX/$XSLTDIR

DBSTYLE_CATALOG=$PACKAGE.xml
DBSTYLE_CATALOG_ENTRY=for-catalog-${PACKAGE}-${PACKAGE_VERSION}.xml
DBSTYLE_DIR=$XMLDIR/docbook/stylesheet/nwalsh

printvariables

#----------------------------------------------------------------------
# 
#
function create_directory_structure() {
   local i
   my_debug "\n\n=== Create directory structure ==="
   for i in $PREFIX $BINDIR $DATAROOTDIR $DATADIR $XMLCONFDIR 
$DOCDIR/$PACKAGE/html $DBSTYLE_DIR/$PACKAGE_VERSION; do
      mkdir ${DEBUG_SCRIPT:+-v} -p $i
      [[ $? -ne 0 ]] && exit_on_error "Could not create $i directory"
   done
}


#----------------------------------------------------------------------
# 
#
function install_dbxsltdirs() {
   my_debug "\n\n=== Install all DocBook XSL stylesheet directories ==="
   
   cp ${DEBUG_SCRIPT:+-v} -a $DBXSLT_DIRS  $DBSTYLE_DIR/$PACKAGE_VERSION
}


function create_link() {
   my_debug "\n\n=== Create link ==="

   pushd $DBSTYLE_DIR 2>/dev/null
      ln -s $PACKAGE_VERSION current
   popd
}

function install_scripts() {
   my_debug "\n\n=== Install scripts ==="
   
   install ${DEBUG_SCRIPT:+-v} -m755 fo/pdf2index       $BINDIR
   install ${DEBUG_SCRIPT:+-v} -m755 epub/bin/dbtoepub  $BINDIR
   install ${DEBUG_SCRIPT:+-v} -m755 slides/images/callouts/gen.sh 
$BINDIR/callout-gen
   
#   rm fo/pdf2index epub/bin/dbtoepub slides/images/callouts/gen.sh
}

function install_dbxsltfiles() {
   my_debug "\n\n=== Install other files ==="
   
   cp ${DEBUG_SCRIPT:+-v} -a $DBXSLT_FILES $DBSTYLE_DIR/$PACKAGE_VERSION
}

function install_dbxsltdocfiles() {
   my_debug "\n\n=== Install documentation ==="
   my_debug "    Current dir: $PWD"
   
   
   for i in "$DBXSLT_DOCFILES"; do
      cp ${DEBUG_SCRIPT:+-v} -a $i  $DOCDIR/$PACKAGE
   done
}


function create_dbxslt_catalog() {
   my_debug "\n\n=== Create catalog file ==="
   
   # /etc/xml/docbook-xsl-stylesheets.xml
   xmlcatalog --noout --create $XMLCONFDIR/$DBSTYLE_CATALOG
}

function create_dbxslt_addentries() {
   my_debug "\n\n=== Create entries in the catalog file ==="
   
   xmlcatalog --noout --add "rewriteSystem" \
      "${DB4_XSLT_URL}${PACKAGE_VERSION}" \
      "file://$ORIG_DBSTYLE_DIR/${PACKAGE_VERSION}" $XMLCONFDIR/$DBSTYLE_CATALOG
   xmlcatalog --noout --add "rewriteURI" \
      "${DB4_XSLT_URL}${PACKAGE_VERSION}" \
      "file://$ORIG_DBSTYLE_DIR/$PACKAGE_VERSION" $XMLCONFDIR/$DBSTYLE_CATALOG
   xmlcatalog --noout --add "rewriteSystem" \
      "${DB4_XSLT_URL}current" \
      "file://$ORIG_DBSTYLE_DIR/current" $XMLCONFDIR/$DBSTYLE_CATALOG
   xmlcatalog --noout --add "rewriteURI" \
      "${DB4_XSLT_URL}current" \
      "file://$ORIG_DBSTYLE_DIR/current" $XMLCONFDIR/$DBSTYLE_CATALOG
   
   #
   # temporary file that is added to /etc/xml/suse-catalog.xml
   # during post
   #
   xmlcatalog --noout --create $XMLCONFDIR/${DBSTYLE_CATALOG_ENTRY}
   xmlcatalog --noout --add "delegateSystem" \
      "${DB4_XSLT_URL}" \
      "file:///etc/xml/${DBSTYLE_CATALOG}" $XMLCONFDIR/${DBSTYLE_CATALOG_ENTRY}
   sed -i -e "/<catalog/a\ <group id=\"${PACKAGE}\">" \
       -e '/<\/catalog/i\ </group>' $XMLCONFDIR/${DBSTYLE_CATALOG_ENTRY}
}


function cleanup_buildroot() {
   rm $DBSTYLE_DIR/$PACKAGE_VERSION/fo/pdf2index \
      $DBSTYLE_DIR/$PACKAGE_VERSION/epub/bin/dbtoepub \
      $DBSTYLE_DIR/$PACKAGE_VERSION/slides/images/callouts/gen.sh
}

#----------------------------------------------------------------------
# MAIN
#

# [[ -e "$PACKAGE_DIR-$PACKAGE_VERSION" ]] || exit_on_error "Could not find 
directory $PACKAGE_DIR-$PACKAGE_VERSION"
#
# cd $PACKAGE_DIR-$PACKAGE_VERSION
create_directory_structure
# create_link
install_dbxsltdirs
install_dbxsltfiles
install_scripts
install_dbxsltdocfiles
#
create_dbxslt_catalog
create_dbxslt_addentries
cleanup_buildroot

# EOF--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to