slackbuilds/UNUSED/ap/Golbarg/SlackBuild
2020-07-12 09:22:26 +02:00

84 lines
2.2 KiB
Bash
Executable file

#!/bin/sh
# variables
VERSION=${VERSION:-trunk_$(date +"%Y.%m.%d_%H.%M")}
BUILD=${BUILD:-1}
TAG=gwh
TMP=/tmp/$TAG
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
ARCH=${ARCH:-$(uname -m)}
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/repositories/$PRGNAM}
PREFIX=${PREFIX:-/usr}
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
if [ ! -e $REPOSITORY ] ; then
mkdir -p $(dirname $REPOSITORY)
git clone http://github.com/Schnouki/Golbarg.git $REPOSITORY
else
( cd $REPOSITORY
git pull
)
fi
cp -R $REPOSITORY $TMP/
cd $TMP/$PRGNAM
python ./setup.py install --root $PKG
# correction
cd $PKG
chown -R root:root *
# move doc/ to the appropriate location
mkdir -p $PKG$PREFIX/doc
mv $PKG$PREFIX/share/golbarg/ $PKG$PREFIX/doc
# move golbarg.el where it belongs
mkdir -p $PKG$PREFIX/share/emacs/site-lisp/golbarg/
mv $PKG$PREFIX/doc/golbarg/golbarg.el $PKG$PREFIX/share/emacs/site-lisp/golbarg/
( cd $PKG$PREFIX/share/emacs/site-lisp/golbarg/
EMACS=$(basename $(ls /usr/bin/emacs-2*))
$EMACS -batch -f batch-byte-compile *.el
)
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (A static blog generator written in Python)
$PRGNAM:
$PRGNAM: Golbarg is a static blog generator written in Python. It is heavily
$PRGNAM: inspired by Jekyll, but is is (obviously!) better (at least in my
$PRGNAM: opinion).
$PRGNAM: You can see it in action on my own blog, (source code on Github too).
$PRGNAM: Golbarg is free software, available under the terms of the GNU GPLv3
$PRGNAM: license.
$PRGNAM:
$PRGNAM: http://github.com/Schnouki/Golbarg
$PRGNAM:
EOF
# empaquetage
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz