-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
92 lines (81 loc) · 2.34 KB
/
PKGBUILD
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Contributor: Fang He <[email protected]>
# Contributor: Yunhui Fu <[email protected]>
# Maintainer: Shuwen Jethro Sun <[email protected]>
pkgname=ns3
pkgver=3.27
pkgrel=1
pkgdesc='Discrete-event network simulator for Internet systems'
arch=('x86_64')
url='http://www.nsnam.org/'
license=('GPL')
depends=(
'gcc' 'python2' 'qt5-base'
'sqlite'
'libxml2' 'gtk2' 'pygtk'
'gdb' 'valgrind'
'boost' 'boost-libs'
)
makedepends=(
'fakeroot'
'findutils'
'mercurial'
'git'
'qt5-tools'
'cmake'
)
optdepends=(
'tcpdump' 'wireshark-gtk' 'openmpi' 'gsl' 'boost' 'boost-libs'
)
source=(
"https://www.nsnam.org/release/ns-allinone-${pkgver}.tar.bz2"
"ns3-openflow-hg::hg+http://code.nsnam.org/openflow"
"ns3-click-git::git+https://github.com/kohler/click"
"ns3-brite-hg::hg+http://code.nsnam.org/BRITE"
)
sha1sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
prepare() {
cd $srcdir/ns-allinone-$pkgver
grep -rl '/usr/bin/env python' . | xargs sed -i 's|/usr/bin/env python|/usr/bin/python2|g'
# compile openflow lib support
cd $srcdir/ns3-openflow-hg
grep -rl '/usr/bin/env python' . | xargs sed -i 's|/usr/bin/env python|/usr/bin/python2|g'
./waf configure
./waf build
# compile click support
cd $srcdir/ns3-click-git
./configure --disable-linuxmodule --enable-nsclick --enable-wifi
rm -rf bin
make -j $(cat /proc/cpuinfo | grep processor | wc -l | awk '{print $0 + 1;}')
# BRITE
cd $srcdir/ns3-brite-hg
make -j $(cat /proc/cpuinfo | grep processor | wc -l | awk '{print $0 + 1;}')
}
build() {
cd $srcdir/ns-allinone-$pkgver
# --enable-examples \
# --enable-tests \
# --build-options=--progress \
# --enable-sudo \
./build.py \
--qmake-path=/usr/bin/qmake-qt5 \
--enable-examples \
-- \
--build-profile=debug \
--prefix=/usr \
--libdir=/usr/lib \
--disable-python \
--enable-mpi \
--with-nsclick=$srcdir/ns3-click-git \
--with-openflow=$srcdir/ns3-openflow-hg \
--with-brite=$srcdir/ns3-brite-hg
# --with-python=/usr/bin/python2 \
}
package() {
cd $srcdir/ns-allinone-$pkgver/ns-$pkgver
./waf install --destdir=$pkgdir/
install -m 644 $srcdir/ns3-brite-hg/libbrite.so $pkgdir/usr/lib
install -m 644 $srcdir/ns3-click-git/ns/libnsclick.so $pkgdir/usr/lib
}