summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 90317cf25b029ebc3be540b3aa83afb3977961ae (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
# Maintainer: Brian Bidulock <bidulock@openss7.org>

pkgname="smcroute-git"
_pkgname=smcroute
pkgver=2.5.5.r5.gf5bf08e
pkgrel=1
pkgdesc="command line tool to manipulate kernel multicast routing"
arch=('i686' 'x86_64')
url="https://github.com/troglobit/smcroute"
license=('GPL2')
provides=("${_pkgname}=${pkgver%%.r*}-${pkgrel}" 'mcsender')
conflicts=('smcroute' 'mcsender')
backup=('etc/smcroute.conf')
depends=('libcap' 'bash' 'libsystemd.so')
makedepends=('git')
source=("$pkgname::git+https://github.com/troglobit/smcroute.git")
md5sums=('SKIP')
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g;s/^0\.95\./1.99.2./'
}

prepare() {
  cd $pkgname
  ./autogen.sh
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --runstatedir=/run \
    --localstatedir=/var
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir/" install

  install -Dm644 /dev/null  "${pkgdir}/etc/smcroute.conf"
  sed -e '/^[mp]/s,^,#,' smcroute.conf >"${pkgdir}/etc/smcroute.conf"
  install -Dm644 /dev/null  "${pkgdir}/usr/lib/tmpfiles.d/smcroute.conf"
  echo "d /etc/smcroute.d - -" >"${pkgdir}/usr/lib/tmpfiles.d/smcroute.conf"
}

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