#!/bin/bash # variables TAG=gwh TMP=/tmp/$TAG CWD=$(pwd) OUTPUT=/tmp PRGNAM=$(basename "$CWD") PKG=$TMP/pkg-$PRGNAM ARCH=$(uname -m) BUILD=2 VERSION=${VERSION:-latest} REPOSITORY=/var/cache/SlackBuilds.gwh/$PRGNAM 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=-version:refname | head -n1) [ "$VERSION" == "" ] && VERSION=trunk [ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" #|| git checkout $VERSION # Override default udev rule location since it would put it in a # non-standard location in Slackware sed -i 's|$$PREFIX/lib/udev/|/lib/udev/|g' OpenRGB.pro sed -i 's|/usr/lib/udev/|/lib/udev/|' README.md ResourceManager.cpp # This fixes breakage if someone is running experimental versions (master branch) # It does not affect the current release sed -i '/.*certs\.h/'d dependencies/hueplusplus-1.?.0/src/EntertainmentMode.cpp qmake6 DOCS_DIR=/usr/doc/"$PRGNAM" MAN_DIR=/usr/man/man1 OpenRGB.pro CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ make -j $(nproc) 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 # correction cd "$PKG" || exit 1 chown -R root:root ./* # embaumement mkdir -p "$PKG"/install cat < "$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 < "$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 EOF # empaquetage cd "$PKG" || exit 1 /sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT/$PRGNAM-${VERSION}-$ARCH-$BUILD$TAG.txz"