2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2014-10-17 23:55:01 +02:00
|
|
|
|
|
|
|
# Slackware build script for jpegoptim
|
2017-03-09 10:58:28 +01:00
|
|
|
|
2021-09-09 23:09:27 +02:00
|
|
|
# Originally written Ryan P.C. McQuen.
|
2022-06-08 18:28:31 +02:00
|
|
|
# Now maintained by B. Watson <urchlay@slackware.uk>.
|
2014-10-17 23:55:01 +02:00
|
|
|
|
2021-09-09 23:09:27 +02:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
2017-03-09 10:58:28 +01:00
|
|
|
|
2023-09-02 23:04:49 +02:00
|
|
|
# 20230902 bkw: update for v1.5.5.
|
2023-07-06 11:20:32 +02:00
|
|
|
# 20230706 bkw: update for v1.5.4.
|
2023-01-05 09:01:09 +01:00
|
|
|
# 20230105 bkw: update for v1.5.1.
|
2022-06-10 20:40:20 +02:00
|
|
|
# 20220610 bkw: update for v1.4.7.
|
|
|
|
|
2021-09-09 23:09:27 +02:00
|
|
|
# 20210909 bkw: BUILD=2
|
|
|
|
# - relicense as WTFPL, with permission from original author.
|
|
|
|
# - expand README and slack-desc.
|
2014-10-17 23:55:01 +02:00
|
|
|
|
2018-06-12 22:37:06 +02:00
|
|
|
# 20180612 bkw: update for v1.4.6.
|
|
|
|
|
2017-03-09 10:58:28 +01:00
|
|
|
# 20170309 bkw:
|
|
|
|
# - take over maintenance
|
|
|
|
# - use long-form github URL
|
|
|
|
# - update configure to match template (actually use SLKCFLAGS).
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2014-10-17 23:55:01 +02:00
|
|
|
PRGNAM=jpegoptim
|
2023-09-02 23:04:49 +02:00
|
|
|
VERSION=${VERSION:-1.5.5}
|
2022-06-10 20:40:20 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2014-10-17 23:55:01 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2014-10-17 23:55:01 +02:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-12-06 07:50:03 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-10-17 23:55:01 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2014-10-17 23:55:01 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-12-06 07:50:03 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2014-10-17 23:55:01 +02:00
|
|
|
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
|
2023-01-05 09:01:09 +01:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
2014-10-17 23:55:01 +02:00
|
|
|
chown -R root:root .
|
2021-09-09 23:09:27 +02:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2014-10-17 23:55:01 +02:00
|
|
|
|
2017-03-09 10:58:28 +01:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2014-10-17 23:55:01 +02:00
|
|
|
./configure \
|
2017-03-09 10:58:28 +01:00
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
2014-10-17 23:55:01 +02:00
|
|
|
make
|
|
|
|
make strip
|
|
|
|
make install DESTDIR=$PKG
|
2017-03-09 10:58:28 +01:00
|
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
2014-10-17 23:55:01 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2022-06-10 20:40:20 +02:00
|
|
|
cp -a LICENSE COPYRIGHT README $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-10-17 23:55:01 +02: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 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|