55 lines
1.3 KiB
Bash
Executable file
55 lines
1.3 KiB
Bash
Executable file
#!/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
|