diff options
author | M0Rf30 | 2024-02-17 14:15:29 +0100 |
---|---|---|
committer | M0Rf30 | 2024-02-17 14:15:29 +0100 |
commit | 00682ccc145981a6c283d196529468aafe7c0a7b (patch) | |
tree | 987e609d668c6ccd75900b7ec8c0633b031ab9d1 /PKGBUILD | |
parent | 905875c84947f89e6663052b8b25201fb2bd55d2 (diff) | |
download | aur-rtl-sdr-git.tar.gz |
rtl-sdr-git: update
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 73 |
1 files changed, 47 insertions, 26 deletions
@@ -3,48 +3,69 @@ pkgname=rtl-sdr-git pkgrel=1 -pkgver=0.8.0.r2.gfe22586 -pkgdesc="Driver for Realtek RTL2832U, allowing general purpose software defined radio (SDR)." +pkgver=2.0.1.4.gaf33886 +pkgdesc='Driver for Realtek RTL2832U, allowing general purpose software defined radio (SDR)' arch=('i686' 'x86_64' 'aarch64') -url="https://github.com/librtlsdr/librtlsdr" +url='https://osmocom.org/projects/rtl-sdr/wiki' license=('GPL') -depends=('libusb>=1.0') +depends=('glibc' 'libusb') makedepends=('git' 'cmake') provides=("${pkgname%%-git}") conflicts=("${pkgname%%-git}") install="${pkgname%%-git}.install" -source=("${pkgname%%-git}::git+${url}" - 'rtlsdr.conf') +source=( + "${pkgname%%-git}::git+https://gitea.osmocom.org/sdr/rtl-sdr" + 'fix-udev-directory.patch' + "${pkgname%%-git}.sysusers" +) pkgver() { - cd "${srcdir}/${pkgname%%-git}" - git describe --long --tags | - sed 's/\([^-]*-g\)/r\1/;s/-/./g' | - sed s/v// + cd "${pkgname%%-git}" + + git describe --long --abbrev=7 | sed 's/\([^-]*-g\)v/r\1/;s/-/./g;s/^v//g' +} + +prepare() { + cd "${pkgname%%-git}" + + # ensure udev rules get installed to correct directory + patch -p1 -i "$srcdir/fix-udev-directory.patch" + + # fix udev rules and allow access to any user that is locally logged in or in the rtlsdr group + # https://bugzilla.redhat.com/show_bug.cgi?id=815093 + sed -e 's/GROUP="plugdev"/GROUP="rtlsdr", TAG+="uaccess"/' -i rtl-sdr.rules } build() { - cd "${srcdir}/${pkgname%%-git}" - mkdir -p build - cd build - cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \ - -DDETACH_KERNEL_DRIVER=ON -Wno-dev ../ - make + cmake \ + -S "${pkgname%%-git}" \ + -B build \ + -D CMAKE_INSTALL_PREFIX=/usr \ + -D CMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \ + -D DETACH_KERNEL_DRIVER=ON \ + -D INSTALL_UDEV_RULES=ON \ + -W no-dev + + cmake --build build } package() { - cd "${srcdir}/${pkgname%%-git}/build" - make DESTDIR="$pkgdir" install - install -Dm644 "$srcdir/${pkgname%%-git}/rtl-sdr.rules" \ - "$pkgdir/usr/lib/udev/rules.d/10-rtl-sdr.rules" - install -Dm644 "$srcdir/rtlsdr.conf" \ + DESTDIR="$pkgdir" cmake --install build + + # rtlsdr group creation + install -vDm644 ${pkgname%%-git}.sysusers \ + "$pkgdir/usr/lib/sysusers.d/${pkgname%%-git}.conf" + + cd "${pkgname%%-git}" + + # module blacklisting rules + install -vDm644 debian/rtl-sdr-blacklist.conf \ "$pkgdir/usr/lib/modprobe.d/rtlsdr.conf" - install -dm755 "${pkgdir}/usr/share/man/man1" - install -m644 "${srcdir}/${pkgname%%-git}/debian/"{rtl_adsb,rtl_eeprom,rtl_fm,rtl_power,rtl_sdr,rtl_tcp,rtl_test}".1" \ - "${pkgdir}/usr/share/man/man1/" + # man pages + install -vDm644 -t "$pkgdir/usr/share/man/man1" debian/*.1 } sha256sums=('SKIP' - '678ecf05c85e79f29048c7093aee18c90e0e50dcd47ca61d842938b608ef3215') + 'a0acd270f017e11d32450ad33ef21794b5052f29f4086099995680373308aeb9' + 'e408f25fb51e9d53326c5548dbe8d53ae701602398fc68538243065488a89056') |