summaryrefslogtreecommitdiff
path: root/community/rtl-sdr/PKGBUILD
blob: 3bad0ade0e98cad9b3cbc548bb5e839f1148405b (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
42
43
44
45
46
47
48
49
# $Id: PKGBUILD 105412 2014-02-07 01:40:43Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Michael Düll <mail@akurei.me>

pkgname=rtl-sdr
# they are just starting to play with tags
# consider using tags for the pkgver in the future
pkgver=20140207
_commit=df9596b2d1
pkgrel=1
pkgdesc="Driver for Realtek RTL2832U, allowing general purpose software defined radio (SDR)."
arch=('i686' 'x86_64')
url="http://sdr.osmocom.org/trac/wiki/rtl-sdr"
license=('GPL')
depends=('libusb>=1.0')
makedepends=('git' 'cmake')
conflicts=('rtl-sdr-git')
options=('staticlibs') 
install=rtl-sdr.install
source=("git://git.osmocom.org/rtl-sdr.git#commit=$_commit"
        'rtlsdr.conf')
md5sums=('SKIP'
         '9c65be40f8916a220e3f55b819897331')

_gitname="rtl-sdr"

pkgver() {
  cd "$srcdir/$_gitname"
  git show -s --format="%ci" HEAD | sed -e 's/-//g' -e 's/ .*//'
}

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

package() {
  cd "$srcdir/$_gitname/build"
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir/$_gitname/rtl-sdr.rules" "$pkgdir/usr/lib/udev/rules.d/10-rtl-sdr.rules"
  install -Dm644 "$srcdir/rtlsdr.conf" "$pkgdir/etc/modprobe.d/rtlsdr.conf"
}

# vim:set ts=2 sw=2 et: