77 lines
2.3 KiB
Bash
Executable file
77 lines
2.3 KiB
Bash
Executable file
#!/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:-gwh} # 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
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|