2009-11-12 09:00:01 +01:00
|
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
|
|
# variables
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
2009-12-29 04:20:04 +01:00
|
|
|
|
PRGNAM=awesome
|
2010-01-16 04:43:26 +01:00
|
|
|
|
BRANCH=master
|
2016-09-18 22:28:40 +02:00
|
|
|
|
VERSION=${VERSION:-${BRANCH}}
|
2010-01-16 04:43:26 +01:00
|
|
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
|
|
|
BUILD=1
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
2011-02-17 05:54:04 +01:00
|
|
|
|
TAG=cyco
|
|
|
|
|
TMP=/tmp/$TAG
|
2011-02-17 05:58:04 +01:00
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
2009-12-29 10:47:10 +01:00
|
|
|
|
OUTPUT=/tmp
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
2011-07-22 08:41:46 +02:00
|
|
|
|
REPOSITORIES=/home/installs/SlackBuilds/repositories
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
|
|
|
|
PREFIX=/usr
|
|
|
|
|
|
|
|
|
|
SLCKFLAGS=""
|
|
|
|
|
|
2009-12-29 04:20:04 +01:00
|
|
|
|
function git_clone_or_pull() {
|
|
|
|
|
REPO_URL=$1
|
|
|
|
|
REPO_NAME=$2
|
2016-09-18 22:28:40 +02:00
|
|
|
|
[ ! -e $REPOSITORIES/$REPO_NAME ] && git clone $REPO_URL $REPOSITORIES/$REPO_NAME
|
|
|
|
|
|
|
|
|
|
( cd $REPOSITORIES/$REPO_NAME
|
|
|
|
|
git pull
|
|
|
|
|
)
|
2009-12-29 04:20:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
2009-11-12 09:00:01 +01:00
|
|
|
|
# nettoyage pr<70>alable
|
2009-12-29 04:20:04 +01:00
|
|
|
|
rm -fr $PKG $TMP/$PRGNAM-$VERSION
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
|
|
|
|
mkdir -p $PKG
|
|
|
|
|
|
2016-09-18 22:28:40 +02:00
|
|
|
|
SRC_PATH=$REPOSITORIES/$PRGNAM
|
|
|
|
|
|
2009-11-12 09:00:01 +01:00
|
|
|
|
# mise en place
|
|
|
|
|
cd $TMP
|
2009-12-29 04:20:04 +01:00
|
|
|
|
if [ -e $CWD/$PRGNAM-$VERSION.tar.?z* ] ; then
|
|
|
|
|
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
|
|
|
|
|
SRC_PATH=.
|
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
2009-11-12 09:00:01 +01:00
|
|
|
|
else
|
2014-11-24 11:12:53 +01:00
|
|
|
|
git_clone_or_pull https://github.com/awesomeWM/$PRGNAM.git $PRGNAM
|
2009-12-29 04:20:04 +01:00
|
|
|
|
rm -fr $TMP/$PRGNAM-$VERSION
|
|
|
|
|
mkdir -p $TMP/$PRGNAM-$VERSION
|
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
2016-09-18 22:28:40 +02:00
|
|
|
|
VERSION="$( cd $REPOSITORIES/$PRGNAM && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
2009-11-12 09:00:01 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# configuration
|
|
|
|
|
cmake \
|
2012-07-31 07:08:05 +02:00
|
|
|
|
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
2009-12-29 04:20:04 +01:00
|
|
|
|
-DSYSCONFDIR=/etc \
|
2010-03-23 16:09:49 +01:00
|
|
|
|
-DAWESOME_DOC_PATH=$PREFIX/doc/$PRGNAM \
|
2009-12-29 04:20:04 +01:00
|
|
|
|
-DAWESOME_MAN_PATH=$PREFIX/man \
|
|
|
|
|
$SRC_PATH
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# compilation
|
|
|
|
|
make -j3
|
|
|
|
|
|
|
|
|
|
# installation
|
|
|
|
|
make install DESTDIR=$PKG
|
2009-11-15 09:04:31 +01:00
|
|
|
|
mkdir -p $PKG/etc/X11/xinit/
|
2009-12-29 04:20:04 +01:00
|
|
|
|
cp $CWD/xinitrc.$PRGNAM $PKG/etc/X11/xinit/
|
|
|
|
|
chmod +x $PKG/etc/X11/xinit/xinitrc.$PRGNAM
|
|
|
|
|
|
2009-11-12 09:00:01 +01:00
|
|
|
|
# correction
|
|
|
|
|
cd $PKG
|
|
|
|
|
chown -R root:root *
|
|
|
|
|
|
2009-12-29 04:20:04 +01:00
|
|
|
|
find $PKG -name \.git\* -exec rm -fr {} \;
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
|
|
|
|
|
|
# Strip binaries
|
2014-11-24 11:12:53 +01:00
|
|
|
|
cd $PKG
|
|
|
|
|
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
|
|
|
|
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
|
2009-11-12 09:00:01 +01:00
|
|
|
|
|
|
|
|
|
# embaumement
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
2009-12-29 04:20:04 +01:00
|
|
|
|
$PRGNAM: $PRGNAM (Window Manager "Framework")
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM: $PRGNAM is an extremely fast, small, and dynamic window manager for X.
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
|
|
|
|
$PRGNAM:
|
2014-11-24 11:12:53 +01:00
|
|
|
|
$PRGNAM:
|
2009-12-29 04:20:04 +01:00
|
|
|
|
$PRGNAM: http://$PRGNAM.naquadah.org
|
|
|
|
|
$PRGNAM: see /usr/doc/$PRGNAM-$VERSION for more details
|
|
|
|
|
$PRGNAM:
|
2009-11-12 09:00:01 +01:00
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
# empaquetage
|
2011-02-17 05:54:04 +01:00
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|