From fa4f242120c6f557b33597d2bf0eed746f96d38c Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 16 Jun 2020 19:06:49 +0200 Subject: [PATCH] add awesome-lain --- l/awesome_lain/SlackBuild | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 l/awesome_lain/SlackBuild diff --git a/l/awesome_lain/SlackBuild b/l/awesome_lain/SlackBuild new file mode 100755 index 00000000..f56bcd02 --- /dev/null +++ b/l/awesome_lain/SlackBuild @@ -0,0 +1,77 @@ +#!/bin/sh + +CWD=$(pwd) + +# default settings +PRGNAM=$(basename $CWD) +ARCH=$(uname -m) +VERSION=${VERSION:-$(date +%Y.%m.%d_%H.%M)} +BUILD=1 + + +TAG=cyco +TMP=/tmp/$TAG +PKG=$TMP/pkg-$PRGNAM +OUTPUT=/tmp + +REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM + +DOCS="ISSUE_TEMPLATE.md LICENSE README.rst" + +rm -rf $PKG $TMP/$PRGNAM +mkdir -p $PKG +cd $TMP + +if [ -e $CWD/$PRGNAM-$VERSION.tar.xz ] ; then + tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +else + [ ! -e $REPOSITORY ] && git clone https://github.com/lcpz/lain.git $REPOSITORY + ( cd $REPOSITORY && git pull ) + VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )" + + cp -R $REPOSITORY $PRGNAM +fi +cd $PRGNAM + +LUA_VERSION=$(lua -v 2>&1 | grep -o "5\..") +LUA_SHAREDIR=/usr/share/lua/$LUA_VERSION + +mkdir -p ${PKG}${LUA_SHAREDIR}/lain + +cp -a {icons,layout,util,widget,LICENSE,README.rst,*.lua} ${PKG}${LUA_SHAREDIR}/lain +mkdir -p ${PKG}/usr/doc/$PRGNAM +cp $DOCS ${PKG}/usr/doc/$PRGNAM + +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 +[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; + +mkdir -p install +cat << EOF > install/slack-desc +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-----------------------------------------------------| +$PRGNAM: $PRGNAM (Awesome WM complements) +$PRGNAM: +$PRGNAM: Successor of awesome-vain, this module provides alternative layouts, +$PRGNAM: asynchronous widgets and utility functions for Awesome. +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: +$PRGNAM: https://github.com/lcpz/lain +$PRGNAM: +EOF + +chown -R root:root $PKG + +rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la +makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz