#!/bin/bash # # calf.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. # # calf.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="calf" PACKAGE_EXT="gz" VERSION=${VERSION:=0.90.3} 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://calf-studio-gear.org/files/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-${VERSION} # Install the docs in a Slackware default location: sed -e 's/^docdir.*$//' -i Makefile.am # Since 0.90.4, but there are bugs which are being solved. # Wait until 0.90.7 at least. #cat $CWD/calf-cmake-docdir.patch | patch -p1 # #mkdir build && cd build # # export LDFLAGS="$SLKLDFLAGS" # export CXXFLAGS="$SLKCFLAGS" # export CFLAGS="$SLKCFLAGS" # # cmake \ # -DCMAKE_INSTALL_PREFIX=/usr \ # -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ # -DDOCDIR=/usr/doc/$PACKAGE-$VERSION/html \ # -DCMAKE_BUILD_TYPE=Release \ # .. # # make $NUMJOBS # make DESTDIR=$PKG install # #cd - # #exit autoreconf -vif LDFLAGS="$SLKLDFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION/html \ --localstatedir=/var \ --sysconfdir=/etc \ --with-lv2 \ --with-lv2-dir=/usr/lib${LIBDIRSUFFIX}/lv2 \ --enable-experimental \ --enable-sse \ --enable-shared \ --disable-static \ --program-prefix= \ --program-suffix= \ --build=$ARCH-slackware-linux make $NUMJOBS make DESTDIR=$PKG install mkdir -p $DOCS cp -a AUTHORS COPYING* ChangeLog README TODO $DOCS mkdir -p $PKG/usr/share/doc/ ( cd $PKG/usr/share/doc/ ln -s /usr/doc/$PACKAGE-$VERSION/html calf ) # This shouldn't be in the package: rm -f $PKG/usr/share/icons/hicolor/icon-theme.cache # Shipped .desktop file doesn't validate, use modified copy: #cat $CWD/$PACKAGE.desktop > $PKG/usr/share/applications/$PACKAGE.desktop # Add this to the doinst.sh: mkdir -p $PKG/install cat <> $PKG/install/doinst.sh # Give all binaries in the package realtime capabilities when they # link to Jack2 (thanks to SBO's Johannes Schoepfer and Arik Miller): if [ -x /sbin/setcap ]; then CBINS=( $(cd $PKG/usr/bin ; find . -type f -exec file '{}' + |grep " ELF .* executable, " |cut -f 1 -d : |cut -d/ -f2 |xargs printf '"%s"\n') ) for EXE in "\${CBINS[@]}" ; do if [ -n "\$(readelf -d usr/bin/\$EXE | grep libjack.so)" ]; then /sbin/setcap cap_ipc_lock,cap_sys_nice=ep "usr/bin/\$EXE" fi done fi # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 fi # Update hicolor theme cache: if [ -d usr/share/icons/hicolor ]; then if [ -x /usr/bin/gtk-update-icon-cache ]; then chroot . /usr/bin/gtk-update-icon-cache -f -t usr/share/icons/hicolor 1> /dev/null 2> /dev/null fi fi # Update the mime database: if [ -x usr/bin/update-mime-database ]; then chroot . /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1 fi EOINS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/${PACKAGE} rm -rf $PKG fi