diff options
author | Sebastien Duthil | 2015-08-20 19:06:53 -0400 |
---|---|---|
committer | Sebastien Duthil | 2015-08-20 19:06:53 -0400 |
commit | d95f02eae4c396a16268d21a541af416f2145144 (patch) | |
tree | 73191a24abb5690b8a49b43965468eac509d23b0 | |
download | aur-dnds-git.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | PKGBUILD | 102 | ||||
-rw-r--r-- | dnds-git-tapcfg.patch | 13 | ||||
-rw-r--r-- | dnds-git.install | 20 | ||||
-rw-r--r-- | dnds-git.patch | 14 |
5 files changed, 169 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c084989de7b0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = dnds-git + pkgdesc = Dynamic Network Directory Service - easy to use VPN + pkgver = 20140328 + pkgrel = 1 + url = https://github.com/nicboul/DNDS + install = dnds-git.install + arch = i686 + arch = x86_64 + license = GPL2 + makedepends = git + makedepends = cmake + makedepends = scons + depends = qt4 + source = dnds-git.patch + source = dnds-git-tapcfg.patch + md5sums = 09f1f49cd6b5317e11698495668f26bb + md5sums = 17d70917c22e1792303f86c8c13aa62f + +pkgname = dnds-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..dbb4f1e7744e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,102 @@ +# Maintainer: Sebastien Duthil <duthils@free.fr> +pkgname='dnds-git' +pkgver=20140328 +pkgrel=1 +epoch= +pkgdesc="Dynamic Network Directory Service - easy to use VPN" +arch=('i686' 'x86_64') +url="https://github.com/nicboul/DNDS" +license=('GPL2') +groups=() +depends=('qt4') +makedepends=('git' 'cmake' 'scons') +checkdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install='dnds-git.install' +changelog= +noextract=() +source=('dnds-git.patch' + 'dnds-git-tapcfg.patch') +md5sums=('09f1f49cd6b5317e11698495668f26bb' + '17d70917c22e1792303f86c8c13aa62f') + +_dnds_gitroot="git://github.com/nicboul/DNDS.git" +_dnds_gitname="DNDS" + +_udt4_gitroot="git://github.com/nicboul/udt4.git" +_udt4_gitname="udt4" + +_tapcfg_gitroot="git://github.com/nicboul/tapcfg.git" +_tapcfg_gitname="tapcfg" + +_libconfig_gitroot="git://github.com/nicboul/libconfig.git" +_libconfig_gitname="libconfig" + +_clone_or_pull() { + gitname="$1" + gitroot="$2" + if [ -d "$srcdir/$gitname" ] ; then + cd "$srcdir/$gitname" && git pull origin + msg2 "$gitname - The local files are updated." + else + git clone "$gitroot" "$srcdir/$gitname" --depth=1 + fi +} + +_fix_libconfig_git () { + # git creates files in alphabetic order, messing with dependency detection + # of make. Specifically, *.y files are created after *.c files, which are + # generated from *.y files + touch "$srcdir/$_libconfig_gitname"/lib/*.c +} + + +build() { + cd "$srcdir" + msg "Connecting to the git repositories..." + + _clone_or_pull "$_dnds_gitname" "$_dnds_gitroot" + _clone_or_pull "$_libconfig_gitname" "$_libconfig_gitroot" + _clone_or_pull "$_udt4_gitname" "$_udt4_gitroot" + _clone_or_pull "$_tapcfg_gitname" "$_tapcfg_gitroot" + ln -sf "$srcdir/$_libconfig_gitname" "$srcdir/$_dnds_gitname/libconfig-linux" + ln -sf "$srcdir/$_udt4_gitname" "$srcdir/$_dnds_gitname/udt4" + ln -sf "$srcdir/$_tapcfg_gitname" "$srcdir/$_dnds_gitname/tapcfg-linux" + + cd "$srcdir/$_udt4_gitname" + if [ "$CARCH" == 'i686' ] ; then + make_arch='arch=IA32' + else + make_arch='arch=AMD64' + fi + make "$make_arch" src.all + + cd "$srcdir/$_tapcfg_gitname" + git apply "$srcdir/dnds-git-tapcfg.patch" || true + ./buildall.sh + + cd "$srcdir/$_libconfig_gitname" + _fix_libconfig_git + ./configure 'CFLAGS=-fPIC' + make + + cd "$srcdir/$_dnds_gitname/" + git apply "$srcdir/dnds-git.patch" || true + rm -rf build.archlinux + mkdir build.archlinux + cd build.archlinux + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. + make dnc +} + +package() { + cd "$srcdir/$_dnds_gitname/build.archlinux/libdnds" + make DESTDIR="$pkgdir/" install + + cd "$srcdir/$_dnds_gitname/build.archlinux/dnc" + make DESTDIR="$pkgdir/" install +} diff --git a/dnds-git-tapcfg.patch b/dnds-git-tapcfg.patch new file mode 100644 index 000000000000..12ea927cf534 --- /dev/null +++ b/dnds-git-tapcfg.patch @@ -0,0 +1,13 @@ +diff --git a/SConstruct b/SConstruct +index c8c497e..30814ac 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -44,7 +44,7 @@ if GetOption('gcc64'): + env.Append(CXXFLAGS = ['-m64']) + env.Append(LINKFLAGS = ['-m64']) + +-env.Append(CFLAGS = ['-Wall', '-O2']) ++env.Append(CFLAGS = ['-Wall', '-O2', '-fPIC']) + + conf = Configure(env) + conf.CheckLib('socket') diff --git a/dnds-git.install b/dnds-git.install new file mode 100644 index 000000000000..9528969ac4c0 --- /dev/null +++ b/dnds-git.install @@ -0,0 +1,20 @@ +post_install () { + chmod 666 /dev/net/tun + + if [ -x /sbin/setcap ] + then + setcap cap_net_bind_service,cap_net_admin=ep /usr/bin/dnc + else + echo "setcap(8) not installed. You need to set CAP_NET_BIND and CAP_NET_ADMIN \ + to be able to run dynvpn without root privileges." + fi + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor +} + +post_upgrade () { + post_install +} + +post_remove() { + post_install +} diff --git a/dnds-git.patch b/dnds-git.patch new file mode 100644 index 000000000000..125c35d3aa02 --- /dev/null +++ b/dnds-git.patch @@ -0,0 +1,14 @@ +diff --git a/dnc/src/CMakeLists.txt b/dnc/src/CMakeLists.txt +index d1d390b..74455cf 100644 +--- a/dnc/src/CMakeLists.txt ++++ b/dnc/src/CMakeLists.txt +@@ -100,8 +100,8 @@ else() + tapcfg + config + dnds +- ssl + -Wl,-Bdynamic ++ ssl + crypto + pthread + ) |