daps/daps-fetch-source
Frank Sundermeyer fc2e98f6b1 Version 1.0beta1:
* Rebuild large parts to make DAPS distribution-independent.
  - rewrote Makefile for automake/autoconf
    => configure; make; make install is now supported
  - thorough cross-distribution testing is still needed, basic tests
    have been run on RedHat, Debian and Ubuntu
* removal of custom stylesheets
  DAPS no longer uses the SUSE stylesheets as a default. It even no
  longer contains the SUSE stylesheets - they are now available as a
  separate package (suse-xsl-stylesheets in Documentation:Tools).
  - By default DAPS uses the generic DocBook stylesheets now
  - Custom stylesheets such as the SUSE stylesheets can be used by
    specifying up to four parameters on the command line/the config
    files:
    * Styleroot:
      Directory containing the custom stylesheets. Must have the same
      directory structure as the original DocBook stylesheet root
      directory. Does _not_ need to contain stylesheets for all output
      formats. If stylesheets are not found, DAPS will automatically
      fall back to the DocBook stylesheets.
      - Variable: STYLEROOT
      - Parameter: --styleroot
      - Value: absolute path to directory
    * Fallback styleroot
      Custom fallback styleroot. If DAPS cannot find styles for the
      given output format, it will automatically fall back to the
      DocBook stylesheets. This config option will add a custom
      fallback directory with higher priority. The DocBook stylesheets
      will remain as a last resort, however.
      - Variable: FALLBACK_STYLEROOT

OBS-URL: https://build.opensuse.org/package/show/Documentation:Tools/daps?expand=0&rev=79
2012-03-08 11:17:04 +00:00

86 lines
2.0 KiB
Bash

#!/bin/bash
#
#
# Create DAPS source tarball from SVN
#
# Copyright (C) 2004 - 2011 SUSE Linux Products GmbH
#
# Author:
# Frank Sundermeyer <fsundermeyer at opensuse dot org>
#
#set -x
NAME=daps
VERSION=
SPECFILE=${NAME}.spec
SVNPATH=https://svn.code.sf.net/p/daps/svn/trunk/daps
TMPDIR=$(mktemp -q -d --tmpdir daps_XXXXXXXX)
EXCLUDES=${TMPDIR}/${NAME}/packaging/exclude-files_for_daps_package.txt
#----------
# Functions
#----------
# exit on error
#
function exit_on_error {
echo -e "$1"
rm -rf $TMPDIR
exit 1
}
#-----
# MAIN
#-----
#
# This script needs to be called from the daps osc checkout directory, so
# lets check whethter we are in the correct directory
#
if [[ ! -s daps.spec && ! -d .osc ]]; then
echo "Looks like you are not in the daps checkout directory."
read -p "Continue anyway (y/n) [n]: " CONT
if [[ n = $CONT || N = $CONT ]]; then
exit_on_error "Aborted by user."
fi
fi
#
# Export daps from SVN
#
svn export -q $SVNPATH ${TMPDIR}/${NAME} || exit_on_error "SVN export failed"
#
# Get the version number
#
VERSION=$(egrep "^Version:\s*" ${TMPDIR}/${NAME}/packaging/$SPECFILE | sed 's/^Version:\s*//')
if [[ -z $VERSION ]]; then
exit_on_error "Couldn't get version number from spec-file."
fi
#
# Create the tarball
#
export BZIP2=--best
tar chf ${NAME}-${VERSION}.tar -C ${TMPDIR} \
--exclude-from=$EXCLUDES ${NAME} || exit_on_error "Failed to create the tarball."
tar rhf ${NAME}-${VERSION}.tar -C ${TMPDIR} ${NAME}/suse/xslt \
|| exit_on_error "Failed to add suse/xslt to the tarball."
bzip2 -9f ${NAME}-${VERSION}.tar
echo "Successfully wrote source tarball ${NAME}-${VERSION}.tar.bz2"
#
# Copy the spec file if necessary
#
diff -q $SPECFILE ${TMPDIR}/${NAME}/packaging/$SPECFILE >/dev/null
if [[ 0 = $? ]]; then
echo "spec file is up-to-date"
else
cp ${TMPDIR}/${NAME}/packaging/$SPECFILE . || exit_on_error "Failed to copy the specfile."
echo "Successfully updated the spec file."
fi
rm -rf ${TMPDIR}
exit 0