mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-20 19:41:34 +01:00
3c988cae12
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
125 lines
3.7 KiB
Bash
125 lines
3.7 KiB
Bash
#!/bin/bash
|
|
|
|
# Slackware build script for paps
|
|
|
|
# Copyright (c) 2015 Leonard Schmidt <email removed>
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are met:
|
|
# 1.- Redistributions of source code 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.
|
|
|
|
# Now maintained by B. Watson <urchlay@slackware.uk>.
|
|
|
|
# 20230503 bkw: update for v0.8.0.
|
|
# - README.md is back.
|
|
# - fix src-to-paps shebang and path to .outlang file.
|
|
# - document optional dependency source-highlight.
|
|
|
|
# 20210929 bkw: fix build on -current (--disable-Werror).
|
|
# 20191130 bkw: update for v0.7.1. upstream removed README.md and examples.
|
|
|
|
# 20180629 bkw:
|
|
# - Take over maintenance.
|
|
# - Include README.md (not README) in doc dir, since README just says
|
|
# "see README.md". BUILD=2.
|
|
# - Add NEWS and example to docdir.
|
|
# - Mention PDF and SVG in the README, since those are supported output
|
|
# formats, and very useful ones...
|
|
# - Regenerate slack-desc from updated README.
|
|
# - Simplify script a bit.
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
PRGNAM=paps
|
|
VERSION=${VERSION:-0.8.0}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-_SBo}
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i586 ;;
|
|
arm*) ARCH=arm ;;
|
|
*) ARCH=$( uname -m ) ;;
|
|
esac
|
|
fi
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
exit 0
|
|
fi
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
PKG=$TMP/package-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
LIBDIRSUFFIX="64"
|
|
else
|
|
SLKCFLAGS="-O2"
|
|
LIBDIRSUFFIX=""
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
cd $PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
|
|
|
# Fix the shebang: #!/usr/bin/python is still python 2 on Slackware 15.0.
|
|
# Fix the hardcoded path to pango_markup.outlang.
|
|
# Add a few more filename extensions for autodetecting various languages,
|
|
# including ".SlackBuild".
|
|
patch -p1 < $CWD/src-to-paps.diff
|
|
|
|
./autogen.sh
|
|
CFLAGS="$SLKCFLAGS" \
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
./configure \
|
|
--disable-Werror \
|
|
--prefix=/usr \
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \
|
|
--sysconfdir=/etc/paps \
|
|
--mandir=/usr/man \
|
|
--build=$ARCH-slackware-linux
|
|
|
|
make
|
|
make install-strip DESTDIR=$PKG
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
|
|
mkdir -p $PKGDOC
|
|
cp -a AUTHORS COPYING.LIB ChangeLog NEWS README.md $PKGDOC/
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
|
|
|
|
mkdir -p $PKG/install
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cd $PKG
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|