summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a4a00e0b6a93f5c3314c52adde5663de52ee71ec (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: Filippo Berto <berto.f@protonmail.com>
_reponame=nlsr
_pkgname=nlsr
pkgname=ndn-${_pkgname}-git
pkgver=0.5.2.r12.g4a90b9a
pkgrel=1
# epoch=
pkgdesc="Named Data Link State Routing Protocol"
arch=('i686' 'x86_64')
url="https://github.com/named-data/${_pkgname}"
license=('GPL')
groups=()
depends=('boost' 'ndn-cxx' 'ndn-psync' 'ndn-chronosync')
makedepends=('git' 'python' 'python-sphinx' 'doxygen')
checkdepends=()
optdepends=()
provides=("ndn-${_pkgname}")
conflicts=("ndn-${_pkgname}")
replaces=()
backup=()
options=()
install=
source=("git+${url}.git")
noextract=()
sha256sums=('SKIP')
validpgpkeys=()

pkgver() {
	cd "${srcdir}/${_reponame}"
  git describe --long | sed 's/^NLSR.//;s/\([^-]*-g\)/r\1/;s/-/./g'	
}

prepare() {
	cd "${srcdir}/${_reponame}"

  # Patch missing include
  sed -i "26i#include <ostream>" "${srcdir}/${_reponame}/src/hello-protocol.hpp"
  sed -i "25i#include <ostream>" "${srcdir}/${_reponame}/src/statistics.hpp"

	./waf configure --prefix=/usr --with-tests
}

build() {
  cd "${srcdir}/${_reponame}"
	./waf build
  ./waf docs
}

## Check disabled until upstream gets fixed
#check() {
#  cd "${srcdir}/${_reponame}-${_reponame}-${pkgver}"
#  ./waf install --destdir="${srcdir}/tests"
#  LD_LIBRARY_PATH="${srcdir}/tests/usr/lib" ./build/unit-tests-nlsr
#}


package() {
  install -dm 755 "${pkgdir}/usr/share/doc/$_pkgname"

  cd "${srcdir}/${_reponame}"
	./waf install --destdir="${pkgdir}"
  cp -r "${srcdir}/${_reponame}/build/docs/"* "${pkgdir}/usr/share/doc/$_pkgname"
  mv "${pkgdir}/usr/etc" "${pkgdir}/"
}