slackbuilds/lua/awesome/SlackBuild

90 lines
2.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
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name | sed 's|^null$|trunk|')} # or VERSION=trunk
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
2011-07-22 08:41:46 +02:00
REPOSITORIES=/home/installs/SlackBuilds/repositories
SLCKFLAGS=""
2020-07-12 14:53:00 +02:00
REQUIRES="lua luarocks lgi"
# nettoyage pr<70>alable
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
VERSION="git_$( cd $REPOSITORIES/$PRGNAM && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
# 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
2020-07-12 09:22:26 +02:00
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz