2010-05-12 23:29:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for fontmatrix
|
2012-02-22 01:05:52 +01:00
|
|
|
# Written by Larry Hajali
|
2013-11-22 08:34:22 +01:00
|
|
|
# Maintained by Klaatu <klaatu@member.fsf.org>
|
2010-05-12 23:29:42 +02:00
|
|
|
|
|
|
|
PRGNAM=fontmatrix
|
2016-12-19 00:37:47 +01:00
|
|
|
VERSION=${VERSION:-20161216}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-05-12 23:29:42 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:05:15 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-12-19 00:37:47 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:05:15 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-12 23:29:42 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-12-19 00:37:47 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-12 23:29:42 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:05:15 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2016-12-19 00:37:47 +01:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
unzip $CWD/$PRGNAM-$VERSION.zip
|
|
|
|
cd $PRGNAM-$VERSION
|
2010-05-12 23:29:42 +02:00
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2016-12-19 00:37:47 +01:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-12 23:29:42 +02:00
|
|
|
|
2010-05-13 00:27:53 +02:00
|
|
|
sed -i 's|share/man|man|' CMakeLists.txt
|
2012-09-17 20:23:17 +02:00
|
|
|
|
2010-05-13 00:27:53 +02:00
|
|
|
# Cmake uses the static python lib. Let's use the shared lib instead.
|
|
|
|
PYVER=$(python -c 'import sys; print sys.version[:3]')
|
|
|
|
PY_LIB_SHARED="/usr/lib${LIBDIRSUFFIX}/libpython${PYVER}.so"
|
|
|
|
|
2010-05-12 23:29:42 +02:00
|
|
|
mkdir build && cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
|
2010-05-13 00:27:53 +02:00
|
|
|
-DWANT_M17N:BOOL=true \
|
2016-12-19 00:37:47 +01:00
|
|
|
-DWANT_PODOFO:BOOL=true \
|
2010-05-12 23:29:42 +02:00
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
2010-05-13 00:27:53 +02:00
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release ..
|
|
|
|
|
|
|
|
# Remove -O3 flag.
|
|
|
|
for i in $(find . -name "flags.make"); do
|
|
|
|
sed -i 's|-O3||g' $i
|
2016-12-19 00:37:47 +01:00
|
|
|
done || echo "not needed"
|
2010-05-12 23:29:42 +02:00
|
|
|
|
2010-05-13 00:27:53 +02:00
|
|
|
make VERBOSE=1
|
2010-05-12 23:29:42 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
|
|
|
|
2012-09-17 20:23:17 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-05-19 08:34:56 +02:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-12 23:29:42 +02:00
|
|
|
|
2012-09-17 20:23:17 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-05-13 00:27:53 +02:00
|
|
|
|
2010-05-12 23:29:42 +02:00
|
|
|
rm -rf $PKG/usr/share/icons
|
|
|
|
for i in 16 22 32 48 64 128; do
|
|
|
|
mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps
|
|
|
|
install -m 0644 src/icons/application-fontmatrix_${i}.png \
|
|
|
|
$PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
2012-09-17 20:23:17 +02:00
|
|
|
COPYING ChangeLog TODO harfbuzz/{COPYING.*,README,AUTHORS} \
|
2010-05-12 23:29:42 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat harfbuzz/COPYING > $PKG/usr/doc/$PRGNAM-$VERSION/COPYING.harfbuzz
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
chmod 0644 $PKG/usr/doc/$PRGNAM-$VERSION/*
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:27:53 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|