summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a2feda1e88df2d0655496786be66333623c33226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Maintainer: alphazo <alphazo@gmail.com>

pkgname=rtl-sdr-blog-git
pkgrel=1
pkgver=1.3.5.r0.g065e3d1
epoch=1
pkgdesc="Tuner for DVB-T sticks based on the Realtek RTL2832U, which can be used as a cheap SDR, since the chip allows transferring the raw I/Q samples to the host. RTL Blog edition to support RTL-SDR V4 dongles."
arch=('i686' 'x86_64' 'aarch64')
url="https://github.com/rtlsdrblog/rtl-sdr-blog"
license=('GPL')
depends=('libusb')
makedepends=('git' 'cmake')
provides=('rtl-sdr')
conflicts=('rtl-sdr' 'rtl-sdr-git' 'rtl-sdr-librtlsdr-git')
source=("git+${url}" "rtl-sdr-blog.conf")
md5sums=('SKIP'
         'e88d2a4b140e31b97436489825a1e941')

pkgver() {
  cd "${srcdir}/rtl-sdr-blog"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "${srcdir}/rtl-sdr-blog"
  mkdir -p build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DDETACH_KERNEL_DRIVER=ON -Wno-dev ../
  make
}

package() {
  cd "${srcdir}/rtl-sdr-blog/build/"
  make DESTDIR="${pkgdir}" install
  install -D -m644 "${srcdir}/rtl-sdr-blog/rtl-sdr.rules" \
    "${pkgdir}/usr/lib/udev/rules.d/10-rtl-sdr.rules"
  install -Dm644 "$srcdir/rtl-sdr-blog.conf" "$pkgdir/etc/modprobe.d/rtl-sdr-blog.conf"
  ln -s librtlsdr.so "${pkgdir}/usr/lib/librtlsdr.so.2"
}