summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1c5f04902ac29cbd8d288dfa49482eb0afd16b48 (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: Xiang Gao <qasdfgtyuiop(at)gmail(dot)com>

_pkgbase=jool
pkgname=${_pkgbase}-dkms-git
pkgver=4.1.8.r2.g5604a61f
pkgrel=1
pkgdesc="Open Source SIIT and NAT64 for Linux."
arch=('i686' 'x86_64')
url="https://www.jool.mx"
license=('GPL2')
depends=('dkms' 'libnl')
makedepend=('git')

source=("git+https://github.com/NICMx/Jool.git")
md5sums=(SKIP)

pkgver() {
  cd Jool
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | grep -o '[0-9].*'
}

build() {
  cp -r Jool Jool-clean
  cd Jool
  ./autogen.sh
  ./configure --prefix=/usr
  make
}

package() {
  # Install
  cd Jool
  make DESTDIR="${pkgdir}" install
  make clean

  # Copy sources (including Makefile)
  ver=$(echo ${pkgver}| grep -o '[0-9]*\.[0-9*]\.[0-9]*')
  cd ..
  mkdir -p "${pkgdir}"/usr/src/${_pkgbase}-${ver}/
  cp -r Jool-clean/* "${pkgdir}"/usr/src/${_pkgbase}-${ver}/

 # Install service files
 install -Dm644 ../jool.service "${pkgdir}"/usr/lib/systemd/system/jool.service
 install -Dm644 ../jool_siit.service "${pkgdir}"/usr/lib/systemd/system/jool_siit.service
}