summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoryhfudev2019-01-02 17:13:57 -0500
committeryhfudev2019-01-02 17:13:57 -0500
commitebb8591e7bede3179f8f8534aa5679186fe8aba7 (patch)
tree8a656736980634996930165156ee73dfe7974c6a
parentfd731239a3ff88afcf36f0104f8b4d29c83510eb (diff)
downloadaur-ebb8591e7bede3179f8f8534aa5679186fe8aba7.tar.gz
update 3.29 with full package supports.
-rw-r--r--.SRCINFO75
-rw-r--r--PKGBUILD413
2 files changed, 356 insertions, 132 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3f1f006bc878..143c277d9cc4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = ns3
pkgdesc = Discrete-event network simulator for Internet systems
- pkgver = 3.26
+ pkgver = 3.29
pkgrel = 1
url = http://www.nsnam.org/
arch = i686
@@ -8,57 +8,70 @@ pkgbase = ns3
arch = armv6
arch = armv6h
arch = arm7h
+ arch = aarch64
license = GPL
+ makedepends = mercurial
+ makedepends = bzr
+ makedepends = git
+ makedepends = binutils
makedepends = fakeroot
makedepends = findutils
depends = gcc
- depends = python2
- depends = python2-setuptools
- depends = qt4
- depends = mercurial
- depends = cmake
- depends = cvs
- depends = unzip
- depends = bzr
- depends = p7zip
- depends = linux-headers
- depends = doxygen
- depends = graphviz
- depends = python2-pygraphviz
- depends = sqlite
+ depends = gsl
depends = libxml2
- depends = gtk2
- depends = pygtk
+ depends = sqlite
depends = boost
depends = boost-libs
- depends = git
- depends = gdb
- depends = valgrind
- depends = python2-sphinx
+ depends = doxygen
+ depends = graphviz
depends = imagemagick
depends = dia
+ depends = qt4
+ depends = python2
+ depends = python2-setuptools
+ depends = python2-pydot
depends = goocanvas
- depends = pygccxml
depends = pygoocanvas
- depends = texlive-bin
- depends = uncrustify
+ depends = pygtk
+ depends = python2-pygraphviz
+ depends = python2-gobject
+ depends = pygccxml
+ depends = castxml
+ depends = libgcrypt
depends = openmpi
depends = flex
- optdepends = gsl
+ depends = valgrind
optdepends = tcpdump
optdepends = wireshark-gtk
- source = https://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
+ optdepends = gdb
+ optdepends = texlive-bin
+ optdepends = python2-sphinx
+ optdepends = uncrustify
+ provides = ns3
+ conflicts = ns3
+ conflicts = ns-3
+ conflicts = ns3-full
+ conflicts = ns3-hg
+ source = https://www.nsnam.org/release/ns-allinone-3.29.tar.bz2
+ source = ns3-hg::hg+http://code.nsnam.org/ns-3-allinone
source = ns3-openflow-hg::hg+http://code.nsnam.org/openflow
source = ns3-click-git::git+https://github.com/kohler/click
source = ns3-brite-hg::hg+http://code.nsnam.org/jpelkey3/BRITE
- md5sums = 286b4bc3f89c448850a0a6c0bca79742
+ source = ns3-nsc-hg::hg+https://secure.wand.net.nz/mercurial/nsc
+ source = ns3-dev-hg::hg+http://code.nsnam.org/ns-3-dev
+ source = ns3-netanim-hg::hg+http://code.nsnam.org/netanim
+ source = ns3-bake-hg::hg+http://code.nsnam.org/bake
+ source = pybindgen-git::git+https://github.com/gjcarneiro/pybindgen.git
+ md5sums = 1f4b667035fdb79471c7319f38595289
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
md5sums = SKIP
- sha1sums = 4db9fb6cff2e7302f56fd2e625153735c0027dd1
- sha1sums = SKIP
- sha1sums = SKIP
- sha1sums = SKIP
pkgname = ns3
diff --git a/PKGBUILD b/PKGBUILD
index 93769f4c6dd8..6d728835dfbe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,156 +1,367 @@
-# Contributor: Yunhui Fu <yhfudev@gmail.com>
-# Maintainer: Shuwen Jethro Sun <jethro.sun7+arch@gmail.com>
+# Maintainer: Yunhui Fu <yhfudev@gmail.com>
-pkgname=ns3
-pkgver=3.26
+USE_DEV=0
+VER_RELEASE=3.29
+
+pkgname=ns3-hg
+pkgver=r13896
pkgrel=1
+
+if [ "${USE_DEV}" = "0" ]; then
+pkgname=ns3
+pkgver=3.29
+fi
+
pkgdesc='Discrete-event network simulator for Internet systems'
-arch=( 'i686' 'x86_64' 'armv6' 'armv6h' 'arm7h' )
+arch=( 'i686' 'x86_64' 'armv6' 'armv6h' 'arm7h' 'aarch64' )
url='http://www.nsnam.org/'
license=('GPL')
depends=(
- 'gcc' 'python2' 'python2-setuptools' 'qt4' 'mercurial'
- 'cmake' 'cvs' 'unzip' 'bzr' 'p7zip' 'linux-headers' # FIXME
- 'doxygen' 'graphviz' 'python2-pygraphviz'
- 'sqlite'
- 'libxml2' 'gtk2' 'pygtk'
- 'boost' 'boost-libs' 'git' 'gdb' 'valgrind'
- 'python2-sphinx'
-# extra stuff
- 'imagemagick' 'dia'
- 'goocanvas' 'pygccxml' 'pygoocanvas'
- 'texlive-bin'
- 'uncrustify' # utils/check-style.py style check program
+ 'gcc'
+ 'gsl' # GNU Scientific Library
+ 'libxml2' 'sqlite' 'boost' 'boost-libs'
+ 'doxygen'
+ 'graphviz' 'imagemagick' 'dia' 'qt4'
+ 'python2' 'python2-setuptools' 'python2-pydot' 'goocanvas' 'pygoocanvas' 'pygtk' 'python2-pygraphviz' 'python2-gobject'
+ 'pygccxml' 'castxml'
+ 'libgcrypt'
'openmpi' # MPI for HPC
'flex' # for nsc
+ 'valgrind'
)
makedepends=(
+ 'mercurial' 'bzr' 'git'
+ 'binutils'
'fakeroot'
'findutils'
)
optdepends=(
- 'gsl' 'tcpdump' 'wireshark-gtk'
+ 'tcpdump' 'wireshark-gtk'
+ 'gdb'
+ 'texlive-bin'
+ 'python2-sphinx'
+ 'uncrustify' # utils/check-style.py style check program
)
+provides=('ns3')
+conflicts=('ns3' 'ns-3' 'ns3-full' 'ns3-hg')
source=(
- "https://www.nsnam.org/release/ns-allinone-${pkgver}.tar.bz2"
-#"ns3-hg::hg+http://code.nsnam.org/ns-3-allinone"
+ "https://www.nsnam.org/release/ns-allinone-${VER_RELEASE}.tar.bz2"
+ "ns3-hg::hg+http://code.nsnam.org/ns-3-allinone"
"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/jpelkey3/BRITE"
-#"ns3-nsc-hg::hg+https://secure.wand.net.nz/mercurial/nsc"
+ "ns3-nsc-hg::hg+https://secure.wand.net.nz/mercurial/nsc"
+ "ns3-dev-hg::hg+http://code.nsnam.org/ns-3-dev"
+ "ns3-netanim-hg::hg+http://code.nsnam.org/netanim"
+ "ns3-bake-hg::hg+http://code.nsnam.org/bake"
+ "pybindgen-git::git+https://github.com/gjcarneiro/pybindgen.git"
)
-md5sums=('286b4bc3f89c448850a0a6c0bca79742'
- 'SKIP'
- 'SKIP'
- 'SKIP')
-sha1sums=('4db9fb6cff2e7302f56fd2e625153735c0027dd1'
- 'SKIP'
- 'SKIP'
- 'SKIP')
-
+
pkgver_git() {
- cd "${srcdir}/${pkgname}"
+ cd "${srcdir}/${pkgname}"
local ver="$(git show | grep commit | awk '{print $2}' )"
- printf "r%s" "${ver//[[:alpha:]]}"
+ #printf "r%s" "${ver//[[:alpha:]]}"
echo ${ver:0:7}
}
pkgver_svn() {
- cd "${srcdir}/${pkgname}"
+ cd "${srcdir}/${pkgname}"
local ver="$(svn info | grep Revision | awk '{print $2}' )"
- printf "r%s" "${ver//[[:alpha:]]}"
+ #printf "r%s" "${ver//[[:alpha:]]}"
echo ${ver:0:7}
}
-#pkgver() {
-# pkgver_git
-#}
+pkgver_hg() {
+ #cd "${srcdir}/${pkgname}"
+ cd "${srcdir}/ns3-dev-hg/"
+ local ver="$(hg log | grep changeset | head -n 1 | awk '{print $2}' | awk -F: '{print $1}' )"
+ printf "r%s" "${ver//[[:alpha:]]}"
+}
+
+pkgver() {
+ if [ ! "${USE_DEV}" = "0" ]; then
+ pkgver_hg
+ else
+ echo $pkgver
+ fi
+}
+
+prepare()
+{
+ local DN_PYBINDGEN="$srcdir/pybindgen-git"
+ local DN_NETANIM="$srcdir/ns3-netanim-hg"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd "$srcdir/ns-allinone-$pkgver/"
+ local FN=`ls | grep pybindgen`
+ DN_PYBINDGEN="$srcdir/ns-allinone-$pkgver/$FN"
+ FN=`ls | grep netanim`
+ DN_NETANIM="$srcdir/ns-allinone-$pkgver/$FN"
+ fi
+
+ if [ "${USE_DEV}" = "0" ]; then
+ # already include source for netanim, pybindgen, and ns3-xxx
+ cd $srcdir/ns-allinone-$pkgver
+
+ sed '1s|^|#!/usr/bin/env python2\n|' -i ns-$pkgver/bindings/python/wscript
+ sed -e 's|#!/usr/bin/env python$|#!/usr/bin/env python2|g' -i ns-$pkgver/waf
+
+ sed -e 's|program.create_task("SuidBuild")|program.create_task("SuidBuild_task")|' -i ns-$pkgver/wscript
+
+ else
+ # setup: bake, netanim, pybindgen, and ns-3-dev
+ cd "${srcdir}/${pkgname}"
-prepare() {
- cd $srcdir/ns-allinone-$pkgver
+ sed '1s|^|#!/usr/bin/env python2\n|' -i ${srcdir}/ns3-dev-hg/bindings/python/wscript
+ sed -e 's|#!/usr/bin/env python$|#!/usr/bin/env python2|g' -i ${srcdir}/ns3-dev-hg/waf
+ fi
-# ./download.py -n ns-3-dev
+ echo "Fix python(3) for ns3"
grep -rl '/usr/bin/env python' . \
- | xargs sed -i 's|/usr/bin/env python|/usr/bin/python2|g'
+ | xargs sed -e 's|/usr/bin/env python$|/usr/bin/env python2|g' -i
-# compile openflow lib support
+ if [ ! "${USE_DEV}" = "0" ]; then
+ echo "update the dev links ..."
+ rm -f ns-3-dev
+ rm -f netanim
+ rm -f bake
+ rm -f pybindgen
+ ln -sf ../ns3-dev-hg/ ns-3-dev
+ ln -sf ../ns3-netanim-hg/ netanim
+ ln -sf ../ns3-bake-hg/ bake
+ ln -sf ../pybindgen-git/ pybindgen
+ echo "Update the .config file ... pwd=`pwd`"
+ PYTHON=`which python2` ./download.py
+ fi
+
+ echo "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
+ | xargs sed -e 's|/usr/bin/env python$|/usr/bin/env python2|g' -i
+ echo " waf configure ..."
+ PYTHON=`which python2` ./waf configure
+ echo " waf build ..."
+ PYTHON=`which python2` ./waf build
+
+ echo "compile pybindgen lib support ..."
+ cd "${DN_PYBINDGEN}"
+ sed -e 's|#!/usr/bin/env python$|#!/usr/bin/env python2|g' -i waf
+ grep -rl '/usr/bin/env python' . \
+ | xargs sed -e 's|/usr/bin/env python$|/usr/bin/env python2|g' -i
+ #echo " waf configure ..."
+ #PYTHON=`which python2` ./waf configure
+ #echo " waf build ..."
+ #PYTHON=`which python2` ./waf build
-# compile click support
+ echo "compile click support ..."
cd $srcdir/ns3-click-git
-#autoreconf -if
+ #autoreconf -if
./configure --disable-linuxmodule --enable-nsclick --enable-wifi
rm -rf bin
- make -j $(cat /proc/cpuinfo | grep processor | wc -l | awk '{print $0 + 1;}')
+ make -j $(nproc)
-# BRITE
+ echo "compile BRITE ..."
cd $srcdir/ns3-brite-hg
- make -j $(cat /proc/cpuinfo | grep processor | wc -l | awk '{print $0 + 1;}')
-
- if [ 0 = 1 ]; then
-# Network Simulation Cradle (NSC)
- cd $srcdir/ns3-nsc-hg
- grep -rl '/usr/bin/env python' . \
- | xargs sed -i 's|/usr/bin/env python|/usr/bin/python2|g'
- grep -rl '/usr/bin/env python' . \
- | xargs sed -i 's|/usr/bin/env python|/usr/bin/python2|g'
-#python2 scons.py
- SHLIBSUFFIX=.so ./scons.py
- fi
+ make -j $(nproc)
+
+
+ if [ 1 = 1 ]; then
+
+ echo "compile Network Simulation Cradle (NSC) ..."
+ cd $srcdir/ns3-nsc-hg
+
+ echo "(NSC) replace python2 ..."
+ grep -rl '/usr/bin/env python' . \
+ | while read A; do sed -e 's|/usr/bin/env python$|/usr/bin/python2|g' -i $A; done
+ echo "(NSC) replace flex ..."
+ sed -e "s|if not conf.CheckLib('fl') or not exe_exists('flex'):|if not conf.CheckLib('fl') and not exe_exists('flex'):|g" -i SConstruct
+ sed -e "s|SConscript('test/SConscript')||g" -i SConstruct
+ echo "(NSC) replace is_function ..."
+ grep -Hr "is_function(" . | awk -F: '{print $1}' | sort | uniq \
+ | while read A; do sed -e 's|is_function(|is_funct(|g' -i $A; done
+ echo "(NSC) replace is_enum ..."
+ grep -Hr "is_enum(" . | awk -F: '{print $1}' | sort | uniq \
+ | while read A; do sed -e 's|is_enum(|is_enumeration(|g' -i $A; done
+
+ echo "(NSC) replace yylex ..."
+ grep -Hr "extern int yylex" . | awk -F: '{print $1}' | sort | uniq \
+ | while read A; do sed -e 's|extern int yylex();||g' -i $A; done
+ sed -e 's|class node_t;|class node_t; extern "C" int yylex();|g' -i globaliser/handle_global.h
+ sed -e 's|#include "parser.tab.hh"|#include "parser.tab.hh"\n#include "handle_global.h"\n|g' -i globaliser/ilex.cc
+
+ echo "(NSC) scons ..."
+ #python2 scons.py
+ PYTHON=`which python2` SHLIBSUFFIX=.so ./scons.py -j $(nproc)
+
+ fi
+}
+
+build0()
+{
+ local DN_PYBINDGEN="$srcdir/pybindgen-git"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd "$srcdir/ns-allinone-$pkgver/"
+ local FN=`ls | grep pybindgen`
+ DN_PYBINDGEN="$srcdir/ns-allinone-$pkgver/$FN"
+ fi
+
+ if [ "${USE_DEV}" = "0" ]; then
+ cd $srcdir/ns-allinone-$pkgver
+ else
+ cd "${srcdir}/${pkgname}"
+ fi
+
+ echo "Build ns-3 with build.py ..."
+ PYTHON=`which python2` ./build.py \
+ --build-options="--progress -j $(nproc)" \
+ --qmake-path=/usr/bin/qmake-qt4 \
+ -- \
+ -d release -o build-shared \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --with-python=`which python2` \
+ --progress \
+ --enable-mpi \
+ --enable-sudo \
+ --enable-des-metrics \
+ --force-planetlab \
+ --with-nsclick=$srcdir/ns3-click-git \
+ --with-openflow=$srcdir/ns3-openflow-hg \
+ --with-brite=$srcdir/ns3-brite-hg \
+ --with-nsc=$srcdir/ns3-nsc-hg \
+ "--with-pybindgen=${DN_PYBINDGEN}" \
+ --enable-examples \
+ --enable-tests \
+ $(NULL)
+
+ # replace directory path
+ find -L . -name "*.pc" | xargs -n 1 sed -e "s|[^[:blank:]\r\n]\+$srcdir[^[:blank:]\r\n]\+||g" -i
+}
+
+build1()
+{
+ local DN_PYBINDGEN="$srcdir/pybindgen-git"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd "$srcdir/ns-allinone-$pkgver/"
+ local FN=`ls | grep pybindgen`
+ DN_PYBINDGEN="$srcdir/ns-allinone-$pkgver/$FN"
+ fi
+
+ if [ "${USE_DEV}" = "0" ]; then
+ cd $srcdir/ns-allinone-$pkgver/ns-$pkgver
+ else
+ cd "${srcdir}/${pkgname}/ns-3-dev"
+ fi
+ echo "Build ns-3 with waf ..."
+ PYTHON=`which python2` ./waf configure \
+ -d release -o build-shared \
+ --prefix=/usr \
+ --libdir=/usr/lib \
+ --with-python=`which python2` \
+ --progress \
+ --enable-mpi \
+ --enable-sudo \
+ --enable-des-metrics \
+ --force-planetlab \
+ --with-nsclick=$srcdir/ns3-click-git \
+ --with-openflow=$srcdir/ns3-openflow-hg \
+ --with-brite=$srcdir/ns3-brite-hg \
+ --with-nsc=$srcdir/ns3-nsc-hg \
+ "--with-pybindgen=${DN_PYBINDGEN}" \
+ --enable-examples \
+ --enable-tests \
+ $(NULL)
+ PYTHON=`which python2` ./waf build --progress -j $(nproc)
+ # replace directory path
+ find -L . -name "*.pc" | xargs -n 1 sed -e "s|[^[:blank:]\r\n]\+$srcdir[^[:blank:]\r\n]\+||g" -i
+
+
+ local DN_NETANIM="$srcdir/ns3-netanim-hg"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd "$srcdir/ns-allinone-$pkgver/"
+ FN=`ls | grep netanim`
+ DN_NETANIM="$srcdir/ns-allinone-$pkgver/$FN"
+ fi
+ cd "${DN_NETANIM}"
+ qmake-qt4 NetAnim.pro
+ make -j 8
}
build() {
-#cd "${srcdir}/${pkgname}"
- cd $srcdir/ns-allinone-$pkgver
-
- ./build.py \
- --build-options=--progress \
- --qmake-path=/usr/bin/qmake-qt4 \
- -- \
- --prefix=/usr \
- --with-python=/usr/bin/python2 \
- --progress \
- --enable-mpi \
- --enable-sudo \
- --with-nsclick=$srcdir/ns3-click-git \
- --with-openflow=$srcdir/ns3-openflow-hg \
- --with-brite=$srcdir/ns3-brite-hg \
- --libdir=/usr/lib \
-#--with-nsc=$srcdir/ns3-nsc-hg \
-#--enable-examples \
-#--enable-tests \
-#$(NULL)
+ build1 # replace this
}
-verify_build() {
-#cd "${srcdir}/${pkgname}"
- cd $srcdir/ns-allinone-$pkgver
+verify_build()
+{
+
+ LIBVER="3-dev"
+ if [ "${USE_DEV}" = "0" ]; then
+ LIBVER="${pkgver}"
+ fi
-# openflow
-# https://www.nsnam.org/docs/release/3.13/models/html/openflow-switch.html
- ./waf --run openflow-switch
- ./waf --run "openflow-switch -v"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd $srcdir/ns-allinone-$pkgver/ns-$pkgver
+ else
+ cd "${srcdir}/${pkgname}/ns-3-dev"
+ fi
-# NS-3 Click Integration Support
-# https://www.nsnam.org/docs/models/html/click.html
- ./waf --run nsclick-simple-lan
+ # openflow
+ # https://www.nsnam.org/docs/release/3.13/models/html/openflow-switch.html
+ PYTHON=`which python2` ./waf --run openflow-switch
+ PYTHON=`which python2` ./waf --run "openflow-switch -v"
-# brite
-# https://www.nsnam.org/wiki/BRITE_integration_with_ns-3
- ./waf --run 'brite-generic-example --verbose=1'
+ # NS-3 Click Integration Support
+ # https://www.nsnam.org/docs/models/html/click.html
+ PYTHON=`which python2` ./waf --run nsclick-simple-lan
-# nsc
-# https://www.nsnam.org/docs/models/html/tcp.html?#network-simulation-cradle
- ./test.py -s ns3-tcp-interoperability
+ # brite
+ # https://www.nsnam.org/wiki/BRITE_integration_with_ns-3
+ PYTHON=`which python2` ./waf --run 'brite-generic-example --verbose=1'
+
+ # nsc
+ # https://www.nsnam.org/docs/models/html/tcp.html?#network-simulation-cradle
+ PYTHON=`which python2` ./test.py -s ns3-tcp-interoperability
+
+ g++ -std=c++11 \
+ `pkg-config --cflags libns${LIBVER}-applications libns${LIBVER}-point-to-point` \
+ `pkg-config --libs libns${LIBVER}-applications libns${LIBVER}-point-to-point` \
+ -o ns3-first examples/tutorial/first.cc
}
-package() {
-#cd "${srcdir}/${pkgname}/ns-3-dev"
- cd $srcdir/ns-allinone-$pkgver/ns-$pkgver
- ./waf install --destdir=$pkgdir/
+package()
+{
+ if [ "${USE_DEV}" = "0" ]; then
+ cd $srcdir/ns-allinone-$pkgver/ns-$pkgver
+ else
+ cd "${srcdir}/${pkgname}/ns-3-dev"
+ fi
+ PYTHON=`which python2` ./waf install \
+ --with-python=`which python2` \
+ --destdir=$pkgdir/
+
+ local LIBVER="3-dev"
+ if [ "${USE_DEV}" = "0" ]; then
+ LIBVER="${pkgver}"
+ fi
+ local DN_NETANIM="$srcdir/ns3-netanim-hg"
+ if [ "${USE_DEV}" = "0" ]; then
+ cd "$srcdir/ns-allinone-$pkgver/"
+ FN=`ls | grep netanim`
+ DN_NETANIM="$srcdir/ns-allinone-$pkgver/$FN"
+ fi
+
+ install -Dm755 "${DN_NETANIM}/NetAnim" ${pkgdir}/usr/bin/ns${LIBVER}-netanim
}
+#sha1sums=('59a9a3cfd738c48e17253eb7ed2aaccfc1cc498d' 'SKIP' 'SKIP' 'SKIP')
+md5sums=('1f4b667035fdb79471c7319f38595289'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ )
+