summaryrefslogtreecommitdiff
path: root/arch-linux/anytun-svn/PKGBUILD
blob: e502d11062bca8773a882601d00f9aa163f347f6 (plain) (blame)
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
# Contributor: Bernhard Tittelbach <xro -at- realraum -dot- at>
pkgname="anytun-svn"
pkgver=977
pkgrel=1
pkgdesc="secure anycast tunneling protocol implementation for flexible and fault-tolerant VPNs"
arch=("i686" "x86_64")
url="http://www.anytun.org/"
license=('GPL3')
groups=()
depends=(boost openssl glibc)
#depends=(boost libgcrypt glibc)
makedepends=(make asciidoc gcc subversion)
provides=(anytun)
conflicts=(anytun)
replaces=()
backup=()
options=(docs zipman ccache distcc)
install=anytun.install
source=("examples.patch")
noextract=()
md5sums=('8246dd06f1ea5b8560cdd56c7f60a334')

_svntrunk="https://svn.anytun.org/anytun/trunk"
_svnmod="anytun"

build() {
  local sharedir="/usr/share/${pkgname}-${pkgver}-${pkgrel}"
  local docdir="/usr/share/doc/${pkgname}-${pkgver}-${pkgrel}"
  local examplesdir=${docdir}/etc-examples

  msg "Checking out Source ..."
  if [ -d ${_svnmod}/.svn ]; then
    (cd ${_svnmod} && svn up -r ${pkgver})
  else
    svn co ${_svntrunk} --config-dir ./ -r ${pkgver} ${_svnmod}
  fi

  rm -rf "${srcdir}/${_svnmod}-build"
  svn export "${srcdir}/${_svnmod}" "${srcdir}/${_svnmod}-build"

  msg "Building Source ..."
  cd "${srcdir}/${_svnmod}-build/src" || return 1
  sed  -i  's/-lboost_thread\(\W\)/-lboost_thread-mt\1/' ./configure || return 1
  ./configure --prefix=/usr --sysconfdir=/etc --use-ssl-crypto --examplesdir=${examplesdir} || return 1 # use libssl
  #./configure --prefix=/usr --sysconfdir=/etc --examplesdir=${examplesdir} || return 1 # use libgcrypt
  make || return 1

  msg "Building Manpages ..."
  make manpage || return 1

  #msg "Building AnyRTPProxy ..."
  #make anyrtpproxy || return 1

  msg "Tweaking example for Arch ..."
  patch -p0 -d ../etc/anytun/ < ${srcdir}/examples.patch

  msg "Installing ${pkgname} ..."
  mkdir -p ${pkgdir}/var/run/anytun  ${pkgdir}/var/run/anytun-controld &>/dev/null
  make install DESTDIR="${pkgdir}"
  mv ${pkgdir}/etc/init.d/ ${pkgdir}/etc/rc.d/
  install -Dm 644 ../README ${pkgdir}${docdir}/README
  install -Dm 644 ../ChangeLog ${pkgdir}${docdir}/ChangeLog
  install -Dm 644 ../AUTHORS ${pkgdir}${docdir}/AUTHORS
}