summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a6e91222a3cf05d019e0572b1189a2a9c8d86de (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
# Maintainer  : George Eleftheriou <eleftg>
# Contributor : George Eleftheriou <eleftg>
 
pkgname=rtl-entropy-git
pkgver=0.1.2.r99.cf52a3b
pkgrel=1
pkgdesc="An entropy generator using SDR peripherals, including rtl-sdr and BladeRF"
url="https://github.com/pwarren/rtl-entropy"
license=('GPL3')
depends=('openssl' 'rtl-sdr')
makedepends=('git' 'cmake' 'pkgconfig')
arch=('x86_64')
provides=("rtl-entropy=${pkgver}")
conflicts=("rtl-entropy")
source=("master::git+https://github.com/pwarren/rtl-entropy")
sha512sums=('SKIP')

pkgver() {
  cd master
  printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
    [ ! -d build ] && mkdir build
}

build() {
    cd build

    cmake ../master  \
        -DCMAKE_C_FLAGS="${CPPFLAGS} ${CFLAGS}" \
        -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
        -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
        -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX="/usr"

    make
}

package() {
    cd "${srcdir}/build"

    make DESTDIR="${pkgdir}" install
}