slackbuilds/ap/fet/SlackBuild
2020-07-12 09:22:26 +02:00

80 lines
2.1 KiB
Bash
Executable file

#!/bin/sh
PRGNAM=fet
VERSION=${VERSION:-5.37.2}
BUILD=${BUILD:-1}
ARCH=$(uname -m)
LIBSUFFIX=$(echo $ARCH | grep -o 64)
CWD=$(pwd)
TAG=gwh
TMP=${TMP:-/tmp/$TAG}
PKG=${PKG:-$TMP/pkg-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
PREFIX=${PREFIX:-/usr}
# Cleaning
rm -fr $TMP/$PRGNAM-$VERSION
rm -fr $PKG
[ ! -e $TMP/ ] && mkdir -p $TMP
# Fetching sources
cd $TMP
[ ! -e $CWD/$PRGNAM-$VERSION.tar.?z* ] && \
wget -c https://lalescu.ro/liviu/fet/download/$PRGNAM-$VERSION.tar.bz2 -O $CWD/$PRGNAM-$VERSION.tar.bz2
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
# Preparation
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Building
qmake-qt5
make
# Installation
make install INSTALL_ROOT=$PKG
mv $PKG$PREFIX/share/man $PKG$PREFIX/
# Cleaning
cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find ./man -type f -name "*.?" -exec gzip -9 {} \;
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Packaging
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (Free Timetabling Software)
$PRGNAM:
$PRGNAM: FET is open source free software for automatically scheduling the
$PRGNAM: timetable of a school, high-school or university. It uses a fast
$PRGNAM: and efficient timetabling algorithm. It is licensed under the GNU
$PRGNAM: Affero General Public License version 3 or later.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://lalescu.ro/liviu/fet/
$PRGNAM:
EOF
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz