Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.6 KiB

#!/bin/bash
# Build script for Slackware
# Copyright (C) 2010,2011,2013,2019,2020 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest docbook sourcecode is available at:
# <http://docbook.sourceforge.net/>.
# Source package infos
DBVERSION=5.1
DBARCHIVE=docbook-v$DBVERSION-os.zip
DBURL=https://docbook.org/xml/$DBVERSION/$DBARCHIVE
XSLVERSION=1.79.2
XSLARCHIVE=docbook-xsl-$XSLVERSION.tar.gz
XSLURL=https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F$XSLVERSION/$XSLARCHIVE
# Build infos
NAMEPKG=${NAMEPKG:-docbook}
VERSION=$DBVERSION
BUILD=${BUILD:-2GGD}
ARCH=noarch
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exist or is not a directory!"
exit 1
fi
# Get and verify the source archives
if [ ! -r $DBARCHIVE ]; then
wget -c -O $DBARCHIVE.part "$DBURL"
mv $DBARCHIVE.part $DBARCHIVE
fi
if [ ! -r $XSLARCHIVE ]; then
wget -c -O $XSLARCHIVE.part "$XSLURL"
mv $XSLARCHIVE.part $XSLARCHIVE
fi
sha256sum -c checksums
# Install DocBook schemas
mkdir -p $TMP/docbook-$DBVERSION
cd $TMP/docbook-$DBVERSION
unzip $CWD/$DBARCHIVE
mkdir -p $PKG/usr/share/xml/docbook
cp -a schemas $PKG/usr/share/xml/docbook-$DBVERSION
mkdir -p $PKG/usr/doc/docbook-$DBVERSION
install -m 644 docbook-v$DBVERSION-os.pdf $PKG/usr/doc/docbook-$DBVERSION
# Install XSL stylesheets
cd $TMP
tar xf $CWD/$XSLARCHIVE
cd docbook-xsl-$XSLVERSION
mkdir -p $PKG/usr/share/xml/docbook/xsl-stylesheets-ns-$XSLVERSION
cp -a assembly common eclipse epub epub3 extensions fo highlighting html \
htmlhelp images javahelp lib manpages params profiling roundtrip \
slides template tools webhelp website xhtml xhtml-1_1 xhtml5 VERSION{,.xsl} \
$PKG/usr/share/xml/docbook/xsl-stylesheets-ns-$XSLVERSION
install -m 644 AUTHORS BUGS COPYING NEWS* README RELEASE-NOTES* \
TODO $PKG/usr/doc/docbook-$DBVERSION
cp -a docsrc $PKG/usr/doc/docbook-$DBVERSION/xsl-doc
# Install updated XML catalog
install -D -m 644 $CWD/catalog.xml $PKG/etc/xml/docbook5.xml
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/docbook-$DBVERSION
rm -rf $TMP/docbook-xsl-$XSLVERSION
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi