slackbuilds/xap/awesome/SlackBuild

90 lines
2 KiB
Text
Raw Normal View History

2021-06-15 10:26:26 +02:00
#!/bin/bash
# variables
CWD=$(pwd)
PRGNAM=awesome
GITHUB_REPO=awesomeWM/awesome
2022-01-22 10:52:07 +01:00
VERSION=${VERSION:-latest}
ARCH=${ARCH:-$(uname -m)}
BUILD=1
2020-06-25 11:23:11 +02:00
TAG=gwh
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
REPOSITORIES=/var/cache/SlackBuilds.gwh
SLCKFLAGS=""
2020-07-12 14:53:00 +02:00
REQUIRES="lua luarocks lgi"
2022-03-03 10:44:46 +01:00
# nettoyage prealable
2020-09-03 15:22:52 +02:00
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
2020-09-03 15:22:52 +02:00
( cd $REPOSITORIES/$PRGNAM; git pull )
rm -fr $TMP/$PRGNAM
mkdir -p $TMP/$PRGNAM
cd $TMP/$PRGNAM
2023-03-23 09:54:21 +01:00
VERSION="git_r$( cd $REPOSITORIES/$PRGNAM && git rev-list --count HEAD )"
# configuration
cmake \
2020-09-03 15:22:52 +02:00
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc \
2020-09-03 15:22:52 +02:00
-DAWESOME_DOC_PATH=/usr/doc/$PRGNAM \
-DAWESOME_MAN_PATH=/usr/man \
$SRC_PATH
# compilation
make -j3
# installation
make install DESTDIR=$PKG
2009-11-15 09:04:31 +01:00
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:
2020-09-03 15:22:52 +02:00
$PRGNAM: # for rock in luafilesystem penlight ldoc busted luacheck luacov; do
2020-10-23 09:10:54 +02:00
$PRGNAM: luarocks install \$rock;
2020-09-03 15:22:52 +02:00
$PRGNAM: done
$PRGNAM:
2019-06-12 09:22:37 +02:00
$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
2023-08-16 12:23:26 +02:00
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz