summaryrefslogtreecommitdiffstats
path: root/main/openvpn/APKBUILD
blob: a8f1e18ff22e9905f20510969184fff6f4dbb605 (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
60
61
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openvpn
pkgver=2.0.9
pkgrel=2
pkgdesc="A robust, and highly configurable VPN (Virtual Private Network)"
url="http://openvpn.sourceforge.net/"
license="custom"
subpackages="$pkgname-doc"
depends="iproute2"
makedepends="openssl-dev lzo-dev"
install=
source="http://$pkgname.net/release/$pkgname-$pkgver.tar.gz
	openvpn-2.0.9-persistent.patch
	openvpn.initd
	"

build() { 
	cd "$srcdir"/$pkgname-$pkgver
	for i in ../*.patch; do
		msg "Applying $i..."
		patch -p1 < $i || return 1
	done

	./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--enable-ssl \
		--enable-crypto \
		--disable-threads \
		--enable-iproute2

	make || return 1

	cd plugin/down-root
	make || return 1
	cd ../..

	make DESTDIR="$pkgdir" install || return 1

	# install plugins
	install -d "$pkgdir"/usr/lib/$pkgname
	cp plugin/*/*.so "$pkgdir"/usr/lib/$pkgname

	# install easy-rsa
	sed -i -e 's/--directory/-d/g; s/--mode=/-m/g' easy-rsa/2.0/Makefile
	sed -i -e '1s|#!/bin/bash|#!/bin/sh|' easy-rsa/2.0/*
	make -C easy-rsa/2.0 DESTDIR="$pkgdir" \
		PREFIX=etc/openvpn/easy-rsa \
		install

	# install examples
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname/examples
	cp -a sample-config-files "$pkgdir"/usr/share/doc/$pkgname/examples
	install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	# install init.d
	install -Dm755 ../openvpn.initd "$pkgdir"/etc/init.d/openvpn

}
md5sums="60745008b90b7dbe25fe8337c550fec6  openvpn-2.0.9.tar.gz
a9075ceb8552980519132cc27fda85ac  openvpn-2.0.9-persistent.patch
793184e36ad09b22cdb19b4294131508  openvpn.initd"