slackbuilds/doc/masteringnode/SlackBuild
Gwenhael Le Moine e181ecf65d
generic name for SlackBuild scripts
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2018-03-14 09:35:32 +01:00

51 lines
945 B
Bash
Executable file

#!/bin/sh
CWD=$(pwd)
PRGNAM=$(basename $CWD)
VERSION=$(date +"%Y.%m.%d_%H.%M")
BUILD=1
ARCH=noarch
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
PREFIX=/usr
# cleaning
rm -fr $PKG
# get sources
[ ! -e $REPOSITORY ] && git clone http://github.com/visionmedia/masteringnode.git $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
mkdir -p $PKG$PREFIX/doc/
cp -R $REPOSITORY $PKG$PREFIX/doc/$PRGNAM
find $PKG$PREFIX/doc/$PRGNAM -name \.git\* -exec rm -fr {} \;
( cd $PKG
mkdir -p install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (a book about Node.js)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: http://visionmedia.github.com/masteringnode/
$PRGNAM:
EOF
chown -R root:root *
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
)