2021-07-04 01:48:15 +08:00
|
|
|
#!/bin/bash
|
2010-05-11 20:55:18 +08:00
|
|
|
|
|
|
|
# Slackware build script for potrace
|
2013-10-28 06:12:24 +08:00
|
|
|
|
2019-03-26 12:07:00 +08:00
|
|
|
# Copyright 2013-2019 Kyle Guinn <elyk03@gmail.com>
|
2013-10-28 06:12:24 +08:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
2015-04-17 11:02:09 +08:00
|
|
|
# notice, this list of conditions and the following disclaimer.
|
2013-10-28 06:12:24 +08:00
|
|
|
#
|
2015-04-17 11:02:09 +08:00
|
|
|
# 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.
|
2010-05-11 20:55:18 +08:00
|
|
|
|
2021-07-04 17:41:06 +08:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-11 20:55:18 +08:00
|
|
|
PRGNAM=potrace
|
2019-09-27 10:20:49 +08:00
|
|
|
VERSION=${VERSION:-1.16}
|
2010-05-11 20:55:18 +08:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 18:23:38 +08:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2010-05-13 06:28:11 +08:00
|
|
|
|
2010-05-23 09:44:19 +08:00
|
|
|
if [ -z "$ARCH" ]; then
|
2015-04-17 11:02:09 +08:00
|
|
|
case "$(uname -m)" in
|
2017-03-06 09:57:17 +08:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 13:05:32 +08:00
|
|
|
arm*) ARCH=arm ;;
|
2015-04-17 11:02:09 +08:00
|
|
|
*) ARCH=$(uname -m) ;;
|
2010-05-23 09:44:19 +08:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 18:23:38 +08:00
|
|
|
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
|
|
|
# the name of the created package would be, and then exit. This information
|
|
|
|
# could be useful to other scripts.
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2010-05-11 20:55:18 +08:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2017-08-09 12:17:08 +08:00
|
|
|
PKG=$TMP/package-$PRGNAM-$VERSION
|
2010-05-11 20:55:18 +08:00
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2015-04-17 11:02:09 +08:00
|
|
|
DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README"
|
2011-01-18 13:57:23 +08:00
|
|
|
|
2010-05-11 20:55:18 +08:00
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2011-01-18 13:57:23 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2017-03-06 09:57:17 +08:00
|
|
|
elif [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:55:18 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2011-01-18 13:57:23 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 06:28:11 +08:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2011-01-18 13:57:23 +08:00
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-23 09:44:19 +08:00
|
|
|
else
|
2011-01-18 13:57:23 +08:00
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:55:18 +08:00
|
|
|
fi
|
|
|
|
|
2010-05-23 09:44:19 +08:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 20:55:18 +08:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
2010-05-12 01:44:53 +08:00
|
|
|
cd $TMP
|
2010-05-11 20:55:18 +08:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-23 09:44:19 +08:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-12 01:44:53 +08:00
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-11 20:55:18 +08:00
|
|
|
chown -R root:root .
|
2015-04-17 11:02:09 +08:00
|
|
|
chmod -R u+w,go-w,a+rX-st .
|
2010-05-12 01:44:53 +08:00
|
|
|
|
|
|
|
# For metric units and papersizes, use the following flags to configure:
|
|
|
|
# --enable-metric Use metric units (centimeters) as default
|
|
|
|
# --enable-a4 Use A4 as the default papersize
|
|
|
|
|
2010-05-11 20:55:18 +08:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2011-01-18 13:57:23 +08:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 20:55:18 +08:00
|
|
|
--sysconfdir=/etc \
|
2010-05-23 09:44:19 +08:00
|
|
|
--localstatedir=/var \
|
2011-01-18 13:57:23 +08:00
|
|
|
--mandir=/usr/man \
|
2017-08-09 12:17:08 +08:00
|
|
|
--infodir=/usr/info \
|
2011-01-18 13:57:23 +08:00
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
2015-04-17 11:02:09 +08:00
|
|
|
--disable-dependency-tracking \
|
2011-09-21 19:45:51 +08:00
|
|
|
--enable-shared \
|
|
|
|
--disable-static \
|
2017-03-06 09:57:17 +08:00
|
|
|
--with-libpotrace \
|
2017-08-09 12:17:08 +08:00
|
|
|
--build=$ARCH-slackware-linux \
|
2017-03-06 09:57:17 +08:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
2010-05-13 06:28:11 +08:00
|
|
|
|
2010-05-12 01:44:53 +08:00
|
|
|
make
|
2015-04-17 11:02:09 +08:00
|
|
|
make check
|
2010-05-12 01:44:53 +08:00
|
|
|
make install-strip DESTDIR=$PKG
|
2010-05-11 20:55:18 +08:00
|
|
|
|
2015-04-17 11:02:09 +08:00
|
|
|
find $PKG/usr/lib${LIBDIRSUFFIX} -name '*.la' -delete
|
|
|
|
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} +
|
2010-05-11 20:55:18 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-01-18 13:57:23 +08:00
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-11 20:55:18 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 18:23:38 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|