summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43ef04e29c9d90443d1de0821a888df7e3ac8c2b (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=conntrack-tools-git
pkgver=1.4.7.r9.ga6ec82b
pkgrel=1
pkgdesc="A tool to view and manage the in-kernel connection tracking state table from userspace"
arch=('i686' 'x86_64')
url="https://www.netfilter.org/projects/conntrack-tools/"
license=('GPL2')
depends=('glibc'
         'libmnl'
         'libnetfilter_conntrack'
         'libnetfilter_cttimeout'
         'libnetfilter_cthelper'
         'libnetfilter_queue'
         'libnfnetlink'
         'systemd-libs')
makedepends=('git' 'systemd' 'libtirpc')
provides=("conntrack-tools=$pkgver")
conflicts=('conntrack-tools')
backup=('etc/conntrackd.conf')
source=("git://git.netfilter.org/conntrack-tools"
        "conntrackd.service::https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/conntrack-tools/trunk/conntrackd.service")
sha256sums=('SKIP'
            'SKIP')


prepare() {
  cd "conntrack-tools"

  sed -i -e 's,/etc/conntrackd/,/etc/,' \
      -e 's,/var/lock/,/run/lock/,' \
      "include/conntrackd.h"
}

pkgver() {
  cd "conntrack-tools"

  git describe --long --tags | sed 's/^conntrack-tools-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "conntrack-tools"

  ./autogen.sh
  ./configure \
    --prefix="/usr" \
    --sbindir="/usr/bin" \
    --enable-systemd
  make
}

package() {
  cd "conntrack-tools"

  make \
    DESTDIR="$pkgdir" \
    install

  install -Dm644 "$srcdir/conntrackd.service" -t "$pkgdir/usr/lib/systemd/system"

  # install empty configuration files
  install -Dm644 "/dev/null" "$pkgdir/etc/conntrackd.conf"
}