#!/bin/bash # # librtlsdr.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. # # librtlsdr.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="librtlsdr" PACKAGE_EXT="gz" VERSION=${VERSION:=0.8.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/librtlsdr/librtlsdr/archive/refs/tags/v$VERSION.tar.$PACKAGE_EXT" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION mkdir -p build cd build cmake \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ -DDETACH_KERNEL_DRIVER=ON \ -DINSTALL_UDEV_RULES=ON \ -Wno-dev \ -DCMAKE_BUILD_TYPE=Release .. make ${NUMJOBS} make install DESTDIR=$PKG cd .. # Fix locations mkdir -p $PKG/lib/udev/rules.d mv $PKG/etc/udev/rules.d/rtl-sdr.rules $PKG/lib/udev/rules.d/40-rtl-sdr.rules rm -rf $PKG/etc # Module blacklist install -Dm644 $CWD/rtlsdr.conf $PKG/lib/modprobe.d/rtlsdr.conf # Don't install man pages. # They are not updated with the extra utilities and emprovements. #mkdir -p $PKG/usr/man/man1 #cp debian/*.1 $PKG/usr/man/man1 mkdir -p $DOCS cp -a AUTHORS COPYING README* protocol_rtl_tcp.txt $DOCS echo -e "You can not use a DVB stick for both DVB and SDR. There is a driver conflict.\n/lib/modprobe.d/rtlsdr.conf blacklists the DVB drivers." > $DOCS/README.Slackware fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi