summaryrefslogtreecommitdiff
path: root/extra/vpnc/PKGBUILD
blob: 935e0a91438f2893f8a922a2db4546643a61f558 (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
# $Id: PKGBUILD 203595 2014-01-13 17:12:30Z andyrtr $
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgname=vpnc
_vpncver=0.5.3
_git=d2c5a77f3f0ea6ad80fc59158127d63ede81a6cb
pkgver=$_vpncver.svn527
pkgrel=2
pkgdesc="VPN client for cisco3000 VPN Concentrators"
url="http://www.unix-ag.uni-kl.de/~massar/vpnc/"
license=('GPL')
depends=('libgcrypt' 'openssl' 'iproute2')
optdepends=('openresolv: Let vpnc manage resolv.conf')
arch=('i686' 'x86_64')
source=("ftp://ftp.archlinux.org/other/$pkgname/$pkgname-$pkgver.tar.xz"
        "http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/$_git:/vpnc-script"
        'vpnc.conf')
backup=('etc/vpnc/default.conf')
md5sums=('db1908bc5cf2b70334c9f74a597a4623'
         '70198474faf36a84beaa11136f6c4d9c'
         'a3f4e0cc682f437e310a1c86ae198e45')

mktarball() {
  [[ -d tarball ]] || mkdir tarball

  pushd tarball

  svn co http://svn.unix-ag.uni-kl.de/vpnc/trunk
  _svnrev=$(cd trunk >/dev/null; svn info | awk '/^Revision:/ { print $2 }')

  find trunk/ -type d -name .svn -exec rm -rf {} +
  mv trunk "$pkgname-$_vpncver.svn$_svnrev"
  tar cJf "../$pkgname-$_vpncver.svn$_svnrev.tar.xz" "$pkgname-$_vpncver.svn$_svnrev/"

  popd
  rm -rf tarball
}

build() {
  cd "$pkgname-$pkgver"

  # Build hybrid support
  sed -i 's|^#OPENSSL|OPENSSL|g' Makefile

  # fix resolvconf location for community/openresolv
  sed -i 's|/sbin/resolvconf|/usr&|g' "$srcdir/vpnc-script"

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" PREFIX=/usr SBINDIR=/usr/bin install

  install -Dm644 "$srcdir"/vpnc.conf "$pkgdir"/etc/vpnc/default.conf
  install -Dm755 "$srcdir"/vpnc-script "$pkgdir"/etc/vpnc/vpnc-script
}