This commit is contained in:
Gwenhael Le Moine 2018-08-16 19:24:30 +02:00
parent 4e66d7d754
commit 0a4eea842a
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

55
ap/rb/SlackBuild Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh
# variables
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=${VERSION:-$(date +"%Y.%m.%d_%H.%M")}
ARCH=noarch
BUILD=1
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM}
PREFIX=${PREFIX:-/usr}
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG$PREFIX/bin/
# mise en place
[ ! -e $REPOSITORY ] && git clone https://github.com/thisredone/rb.git $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
mkdir -p $PKG$PREFIX/bin/
cp $REPOSITORY/rb $PKG$PREFIX/bin/rb
chmod 0755 $PKG$PREFIX/bin/rb
mkdir -p $PKG$PREFIX/doc/$PRGNAM
cp $REPOSITORY/LICENSE $REPOSITORY/README.md $PKG$PREFIX/doc/$PRGNAM/
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Turns Ruby into a versatile command line utility)
$PRGNAM:
$PRGNAM: Replace most of the command line tools that you use to process
$PRGNAM: text inside of the terminal.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/thisredone/rb
$PRGNAM:
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