slackbuilds/xap/awesome/SlackBuild
Gwenhael Le Moine 8544e1662f
re-organize
2024-11-27 10:16:27 +01:00

89 lines
2 KiB
Bash
Executable file

#!/bin/bash
# variables
CWD=$(pwd)
PRGNAM=awesome
GITHUB_REPO=awesomeWM/awesome
VERSION=${VERSION:-latest}
ARCH=${ARCH:-$(uname -m)}
BUILD=1
TAG=gwh
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
REPOSITORIES=/var/cache/SlackBuilds.gwh
SLCKFLAGS=""
REQUIRES="lua luarocks lgi"
# nettoyage prealable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG
SRC_PATH=$REPOSITORIES/$PRGNAM
# mise en place
cd $TMP
[ ! -e $REPOSITORIES/$PRGNAM ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORIES/$PRGNAM
( cd $REPOSITORIES/$PRGNAM; git pull )
rm -fr $TMP/$PRGNAM
mkdir -p $TMP/$PRGNAM
cd $TMP/$PRGNAM
VERSION="git_r$( cd $REPOSITORIES/$PRGNAM && git rev-list --count HEAD )"
# configuration
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc \
-DAWESOME_DOC_PATH=/usr/doc/$PRGNAM \
-DAWESOME_MAN_PATH=/usr/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
# 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: # for rock in luafilesystem penlight ldoc busted luacheck luacov; do
$PRGNAM: luarocks install \$rock;
$PRGNAM: done
$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
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz