slackbuilds_ponce/graphics/fontmatrix/fontmatrix.SlackBuild

105 lines
2.8 KiB
Text
Raw Normal View History

#!/bin/sh
# Slackware build script for fontmatrix
# Written by Larry Hajali
# Maintained by Klaatu <klaatu@member.fsf.org>
PRGNAM=fontmatrix
VERSION=${VERSION:-20161216}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
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
unzip $CWD/$PRGNAM-$VERSION.zip
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -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 {} \;
sed -i 's|share/man|man|' CMakeLists.txt
# 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"
mkdir build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DWANT_M17N:BOOL=true \
-DWANT_PODOFO:BOOL=true \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-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
done || echo "not needed"
make VERBOSE=1
make install DESTDIR=$PKG
cd ..
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
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
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 \
COPYING ChangeLog TODO harfbuzz/{COPYING.*,README,AUTHORS} \
$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
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}