2021-06-15 10:26:26 +02:00
|
|
|
#!/bin/bash
|
2012-06-06 08:41:05 +02:00
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
2021-09-23 15:52:55 +02:00
|
|
|
GITHUB_REPO=pavouk/lgi
|
|
|
|
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/${GITHUB_REPO}/releases/latest | jq -r .tag_name | sed 's|^null$|trunk|')} # or VERSION=trunk
|
|
|
|
|
2012-06-06 08:41:05 +02:00
|
|
|
# default settings
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
BUILD=1
|
|
|
|
|
2020-06-25 11:23:11 +02:00
|
|
|
TAG=gwh
|
2012-06-06 08:41:05 +02:00
|
|
|
TMP=/tmp/$TAG
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=/tmp
|
|
|
|
|
2017-01-29 21:57:40 +01:00
|
|
|
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
|
2012-06-06 08:41:05 +02:00
|
|
|
|
|
|
|
DOCS="ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO"
|
|
|
|
|
2016-09-18 22:28:40 +02:00
|
|
|
rm -rf $PKG $TMP/$PRGNAM
|
2012-06-06 08:41:05 +02:00
|
|
|
mkdir -p $PKG
|
|
|
|
cd $TMP
|
|
|
|
|
|
|
|
if [ -e $CWD/$PRGNAM-$VERSION.tar.xz ] ; then
|
2016-09-18 22:28:40 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
2012-06-06 08:41:05 +02:00
|
|
|
else
|
2021-09-23 15:52:55 +02:00
|
|
|
[ ! -e $REPOSITORY ] && git clone https://github.com/${GITHUB_REPO}.git $REPOSITORY
|
2021-06-15 10:59:49 +02:00
|
|
|
cd $REPOSITORY
|
|
|
|
git pull --all
|
2021-04-08 13:42:40 +02:00
|
|
|
VERSION="git_$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
|
2016-09-18 22:28:40 +02:00
|
|
|
|
2017-01-29 21:57:40 +01:00
|
|
|
cp -R $REPOSITORY $PRGNAM
|
2012-06-06 08:41:05 +02:00
|
|
|
fi
|
2016-09-18 22:28:40 +02:00
|
|
|
cd $PRGNAM
|
2012-06-06 08:41:05 +02:00
|
|
|
|
2013-03-25 22:37:46 +01:00
|
|
|
LUA_VERSION=$(lua -v 2>&1 | grep -o "5\..")
|
|
|
|
|
2017-11-15 20:38:40 +01:00
|
|
|
sed -i \
|
|
|
|
-e "s|/usr/local|/usr|" \
|
|
|
|
-e "s|/lib/lua/|/share/lua/|" \
|
|
|
|
-e "s|LUA_VERSION=5.1|LUA_VERSION=$LUA_VERSION|" \
|
|
|
|
lgi/Makefile
|
|
|
|
|
2020-07-12 09:29:21 +02:00
|
|
|
LIBDIRSUFFIX=$( uname -m | grep -o 64 )
|
|
|
|
|
|
|
|
make LUA_LIBDIR=/usr/lib$LIBDIRSUFFIX/lua/$LUA_VERSION \
|
2017-11-15 20:38:40 +01:00
|
|
|
LUA_SHAREDIR=/usr/share/lua/$LUA_VERSION \
|
|
|
|
PREFIX=/usr CFLAGS="$SLKCFLAGS"
|
2020-07-12 09:29:21 +02:00
|
|
|
make LUA_LIBDIR=/usr/lib$LIBDIRSUFFIX/lua/$LUA_VERSION \
|
2017-11-15 20:38:40 +01:00
|
|
|
LUA_SHAREDIR=/usr/share/lua/$LUA_VERSION \
|
|
|
|
DESTDIR=$PKG install
|
2012-06-06 08:41:05 +02:00
|
|
|
|
|
|
|
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 (Dynamic Lua binding to GObject libraries)
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
2016-09-18 22:28:40 +02:00
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
|
|
|
$PRGNAM:
|
2021-09-23 15:52:55 +02:00
|
|
|
$PRGNAM: https://github.com/${GITHUB_REPO}
|
2012-06-06 08:41:05 +02:00
|
|
|
$PRGNAM:
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chown -R root:root $PKG
|
|
|
|
|
2018-04-20 23:02:35 +02:00
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2020-07-12 09:22:26 +02:00
|
|
|
/sbin/makepkg -c n -l y $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
|