summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4a28f417b6117d1ff37728c83bd53806a92278ef (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
pkgname=('heka-git')
_srcname='heka'
pkgdesc='Data collection and processing made easy'
pkgver='r1'
pkgrel='1'
arch=('i686' 'x86_64')
url="https://github.com/mozilla-services/${_srcname}"
license=('MPL2')

depends=('geoip')
makedepends=(
    'cmake'
    'gcc'
    'git'
    'go'
    'make'
    'mercurial'
    'patch'
)
optdepends=('geoip-database-extra: GeoIpDecoder')
provides=("${pkgname[0]%-git}")
conflicts=("${pkgname[0]%-git}")

source=(
    "${_srcname}::git+${url}.git"
    'heka.service'
)
sha512sums=(
    'SKIP'
    'SKIP'
)

install='install.sh'

pkgver() {
    cd "${srcdir}/${_srcname}"

    printf 'r%s.%s.%s\n' \
        "$( git rev-list --count 'HEAD' )" \
        "$( git log --max-count='1' --pretty='format:%ct' )" \
        "$( git rev-parse --short 'HEAD' )"
}

build() {
    path_build="${srcdir}/build"
    mkdir --parents "${path_build}"
    cd "${path_build}"

    export GOPATH="${path_build}/heka"
    export LD_LIBRARY_PATH="${GOPATH}/lib"
    export DYLD_LIBRARY_PATH="${GOPATH}/lib"
    export GOBIN="${GOPATH}/bin"
    export PATH="${GOBIN}:${PATH}"
    export CTEST_OUTPUT_ON_FAILURE=1

    cmake \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DCMAKE_BUILD_TYPE='release' \
        -DHEKA_PATH='/usr/share/heka' \
        -DINCLUDE_SANDBOX='OFF' \
        "${srcdir}/${_srcname}"
    make
}

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

    export GOPATH="${path_build}/heka"
    export GOBIN="${GOPATH}/bin"
    export PATH="${GOBIN}:${PATH}"

    make DESTDIR="${pkgdir}" install

    install --owner='533' --group='533' --mode='750' --directory "${pkgdir}/var/cache/hekad"
    install --directory "${pkgdir}/etc/heka/conf.d"
    install -D --mode='644' "${srcdir}/heka.service" "${pkgdir}/usr/lib/systemd/system/heka.service"
}