slackbuilds/xap/OpenRGB/SlackBuild

88 lines
2.2 KiB
Text
Raw Normal View History

2024-05-05 23:13:24 +02:00
#!/bin/bash
# variables
TAG=gwh
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename "$CWD")
PKG=$TMP/pkg-$PRGNAM
ARCH=$(uname -m)
BUILD=1
VERSION=${VERSION:-latest}
REPOSITORY=/home/installs/SlackBuilds/_repositories/$PRGNAM
2024-05-05 23:13:24 +02:00
rm -fr "$PKG" "${TMP:?}"/"$PRGNAM"
mkdir -p "$PKG"
# mise en place
[ ! -e "$REPOSITORY" ] && git clone https://gitlab.com/CalcProgrammer1/OpenRGB.git "$REPOSITORY"
cd "$REPOSITORY" || exit 1
git pull --all
cp -R "$REPOSITORY" "$TMP"/"$PRGNAM"
cd "$TMP"/"$PRGNAM"/ || exit 1
[ "$VERSION" == "latest" ] && VERSION=$(git tag --sort=-taggerdate | head -n1)
[ "$VERSION" == "" ] && VERSION=trunk
[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" #|| git checkout $VERSION
qmake6 DOCS_DIR=/usr/doc/"$PRGNAM" MAN_DIR=/usr/man/man1 OpenRGB.pro
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
make
make INSTALL_ROOT="$PKG" install
find "$PKG" -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find "$PKG"/usr/man -type f -exec gzip -9 {} \;
for i in $( find "$PKG"/usr/man -type l ) ; do ln -s "$( readlink "$i" ).gz" "$i.gz" ; rm "$i" ; done
2024-05-05 23:13:24 +02:00
# correction
cd "$PKG" || exit 1
chown -R root:root ./*
# embaumement
mkdir -p "$PKG"/install
cat <<EOF > "$PKG"/install/doinst.sh
udevadm control --reload-rules
udevadm trigger
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -x /usr/bin/update-mime-database ]; then
/usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
EOF
cat <<EOF > "$PKG"/install/slack-desc
|-----handy-ruler------------------------------------------------------|
$PRGNAM: $PRGNAM (LEDs control)
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://www.openrgb.org/
$PRGNAM: REQUIRES: mbedtls
2024-05-05 23:13:24 +02:00
EOF
# empaquetage
cd "$PKG" || exit 1
/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION}-$ARCH-$BUILD$TAG.txz"