#!/bin/bash # # snapcast.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # snapcast.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="snapcast" PACKAGE_EXT="gz" VERSION=${VERSION:=0.27.0} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/badaix/snapcast/archive/v${VERSION}.tar.gz" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION cat $CWD/snapcast-0.20.0-gcc-11.patch | patch -p1 cmake -B build -S . \ -DCMAKE_BUILD_TYPE=None \ -DBUILD_STATIC_LIBS=No \ -DBUILD_TESTS=no \ -DBUILD_WITH_AVAHI=No \ -DBUILD_WITH_PULSE=No \ -DCMAKE_INSTALL_PREFIX=/usr \ -Wno-dev # -DBUILD_STATIC_LIBS=OFF \ make -C build ${NUMJOBS} #make -C build # Manual installation echo "Install in $PKG" install -Dm755 bin/snapserver "${PKG}/usr/bin/snapserver" install -Dm644 server/snapserver.1 "${PKG}/usr/man/man1/snapserver.1" install -Dm644 server/etc/snapserver.conf "${PKG}/etc/snapserver.conf.new" # install snapweb for file in server/etc/snapweb/*\.*; do install -Dm 644 ${file} -t "${PKG}/usr/share/snapserver/snapweb/"; done for file in server/etc/snapweb/3rd-party/*\.*; do install -Dm 644 ${file} -t "${PKG}/usr/share/snapserver/snapweb/3rd-party/"; done install -Dm755 bin/snapclient "${PKG}/usr/bin/snapclient" install -Dm644 client/snapclient.1 "${PKG}/usr/man/man1/snapclient.1" install -Dm644 $CWD/snapcast.default ${PKG}/etc/default/snapcast.new install -Dm755 $CWD/snapcast.init ${PKG}/etc/rc.d/rc.snapcast mkdir -p ${PKG}/var/lib/snapserver chown 315:315 ${PKG}/var/lib/snapserver # install documentation mkdir -p $DOCS/control cp -R doc/* $DOCS install -Dm644 *.md $DOCS # example control scripts cp -R control/* $DOCS/control/ fixup_package $PKG set +u # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi