slackbuilds_ponce/desktop/xpenguins/xpenguins.SlackBuild
B. Watson 45f679b708
desktop/xpenguins: Remove INSTALL from doc dir.
Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-12-31 09:14:56 +07:00

106 lines
2.4 KiB
Bash

#!/bin/bash
# Slackware build script for xpenguins
# Originally written by Steven Pledger
# Updated and now maintained by B. Watson <urchlay@slackware.uk>
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20221229 bkw: BUILD=2, get rid of useless INSTALL from doc dir.
# 20220207 bkw:
# - take over maintenance.
# - update for v3.2.1.
# - i486 => i586.
# - new-style icons.
# - add doinst.sh.
# - misc cleanups/fixes.
# The new 3.x version is actually a fork. The original (2.x) hadn't
# been updated in 20+ years.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=xpenguins
VERSION=${VERSION:-3.2.1}
BUILD=${BUILD:-2}
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 {} \+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--mandir=/usr/man \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
gzip -9 $PKG/usr/man/man*/*
for px in 16 32 48 64 128; do
size=${px}x${px}
dir=$PKG/usr/share/icons/hicolor/$size/apps
mkdir -p $dir
convert -resize $size $PKG/usr/share/pixmaps/$PRGNAM.xpm \
-background none -gravity center -extent $size \
$dir/$PRGNAM.png
done
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a AUTHORS COPYING NEWS README $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE