120 lines
2.9 KiB
Bash
Executable file
120 lines
2.9 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
# variables
|
|
CWD=$(pwd)
|
|
|
|
PRGNAM=awesome
|
|
BRANCH=master
|
|
VERSION=${VERSION:-${BRANCH}}
|
|
ARCH=${ARCH:-$(uname -m)}
|
|
BUILD=1
|
|
|
|
TAG=gwh
|
|
TMP=/tmp/$TAG
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
OUTPUT=/tmp
|
|
|
|
REPOSITORIES=/home/installs/SlackBuilds/repositories
|
|
|
|
PREFIX=/usr
|
|
|
|
SLCKFLAGS=""
|
|
|
|
function git_clone_or_pull() {
|
|
REPO_URL=$1
|
|
REPO_NAME=$2
|
|
[ ! -e $REPOSITORIES/$REPO_NAME ] && git clone $REPO_URL $REPOSITORIES/$REPO_NAME
|
|
|
|
( cd $REPOSITORIES/$REPO_NAME
|
|
git pull
|
|
)
|
|
}
|
|
|
|
# nettoyage préalable
|
|
rm -fr $PKG $TMP/$PRGNAM-$VERSION
|
|
|
|
mkdir -p $PKG
|
|
|
|
SRC_PATH=$REPOSITORIES/$PRGNAM
|
|
|
|
# mise en place
|
|
cd $TMP
|
|
if [ -e $CWD/$PRGNAM-$VERSION.tar.?z* ] ; then
|
|
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
|
|
SRC_PATH=.
|
|
cd $TMP/$PRGNAM-$VERSION
|
|
else
|
|
git_clone_or_pull https://github.com/awesomeWM/$PRGNAM.git $PRGNAM
|
|
rm -fr $TMP/$PRGNAM-$VERSION
|
|
mkdir -p $TMP/$PRGNAM-$VERSION
|
|
cd $TMP/$PRGNAM-$VERSION
|
|
VERSION="$( cd $REPOSITORIES/$PRGNAM && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
|
fi
|
|
|
|
# configuration
|
|
cmake \
|
|
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
|
-DSYSCONFDIR=/etc \
|
|
-DAWESOME_DOC_PATH=$PREFIX/doc/$PRGNAM \
|
|
-DAWESOME_MAN_PATH=$PREFIX/man \
|
|
$SRC_PATH
|
|
|
|
# compilation
|
|
make -j3
|
|
|
|
# installation
|
|
make install DESTDIR=$PKG
|
|
mkdir -p $PKG/etc/X11/xinit/
|
|
cp $CWD/xinitrc.$PRGNAM $PKG/etc/X11/xinit/
|
|
chmod +x $PKG/etc/X11/xinit/xinitrc.$PRGNAM
|
|
|
|
# ### obvious
|
|
# git_clone_or_pull https://github.com/hoelzro/obvious.git obvious
|
|
# cp -R $REPOSITORIES/obvious $PKG$PREFIX/share/awesome/lib/
|
|
# ( cd $PKG$PREFIX/share/awesome/lib/obvious
|
|
# rm -fr .git
|
|
# make
|
|
# )
|
|
|
|
# ### vicious
|
|
# git_clone_or_pull https://github.com/Mic92/vicious.git vicious
|
|
# cp -R $REPOSITORIES/vicious $PKG$PREFIX/share/awesome/lib/
|
|
# rm -fr $PKG$PREFIX/share/awesome/lib/vicious/.git
|
|
|
|
# ### copycats
|
|
# git_clone_or_pull https://github.com/lcpz/awesome-copycats.git copycats
|
|
# cp -R $REPOSITORIES/copycats $PKG$PREFIX/share/awesome/lib/
|
|
# rm -fr $PKG$PREFIX/share/awesome/lib/copycats/.git
|
|
|
|
# correction
|
|
cd $PKG
|
|
chown -R root:root *
|
|
|
|
find $PKG -name \.git\* -exec rm -fr {} \;
|
|
|
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
|
|
|
# Strip binaries
|
|
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
|
|
|
|
# embaumement
|
|
mkdir -p $PKG/install
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
$PRGNAM: $PRGNAM (Window Manager "Framework")
|
|
$PRGNAM:
|
|
$PRGNAM: $PRGNAM is an extremely fast, small, and dynamic window manager for X.
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: # luarocks install luafilesystem penlight ldoc busted luacheck luacov
|
|
$PRGNAM:
|
|
$PRGNAM: https://awesomewm.org/
|
|
$PRGNAM: see /usr/doc/$PRGNAM-$VERSION for more details
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
# empaquetage
|
|
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
|