summaryrefslogtreecommitdiff
path: root/extra/vpnc/PKGBUILD
blob: a181b20b679f6b6cfe198bc2928631a01ef89cd9 (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 164259 2012-07-29 01:13:10Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>

pkgname=vpnc
_vpncver=0.5.3
_git=1b65c39e3cdebb89ce5c75f05d44a0519a67ede6
pkgver=$_vpncver.svn516
pkgrel=3
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=('2118c5ccc464250c0892be57dbfabdf7'
         '6293c15ef6e7a3365ed7add5e336b806'
         '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 install

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