added syncthing related scripts

This commit is contained in:
Gwenhael Le Moine 2018-03-11 14:54:26 +01:00
parent f85bf2248f
commit a30cdd210c
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 143 additions and 0 deletions

View file

@ -0,0 +1,76 @@
#!/bin/sh
# Slackware build script for <appname>
# Copyright <year> <you> <where you live>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CWD=$(pwd)
TMP=/tmp/$TAG
OUTPUT=/tmp
PRGNAM=$(basename $CWD)
BUILD=${BUILD:-1}
TAG=${TAG:-cyco} # the "_SBo" is required
PKG=$TMP/pkg-$PRGNAM
VERSION=$(date +%Y.%m.%d_%H.%M)
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
# mise en place
GIT_URL="https://github.com/pyca/bcrypt.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
# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (syncthing/syncthing-gtk)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
EOF
[ -e $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View file

@ -0,0 +1,67 @@
#!/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
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz