slackbuilds/xap/syncthing-gtk/SlackBuild
2018-04-20 23:02:35 +02:00

68 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=cyco
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
VERSION=$(date +%Y.%m.%d_%H.%M)
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG
# mise en place
GIT_URL="https://github.com/syncthing/syncthing-gtk.git"
[ ! -e $REPOSITORY ] && git clone "$GIT_URL" $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
cp -R $REPOSITORY $TMP/$PRGNAM
cd $TMP/$PRGNAM/
python ./setup.py build
# installation
python ./setup.py install --root=$PKG
mkdir -p $PKG/usr/doc/$PRGNAM
cp -R LICENSE README.md $PKG/usr/doc/$PRGNAM
mv $PKG$PREFIX/share/man $PKG$PREFIX/
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM ( GTK3 & python based GUI for Syncthing)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/syncthing/syncthing-gtk
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz