core/openvpn/PKGBUILD

54 lines
1.8 KiB
Bash
Raw Normal View History

2010-03-13 23:25:19 +08:00
pkgname=openvpn
2011-05-02 05:41:40 +08:00
pkgver=2.1.4
2012-11-04 07:38:10 +08:00
pkgrel=4
2010-03-13 23:25:19 +08:00
pkgdesc="An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)"
arch=(i686 x86_64)
url="http://openvpn.net/index.php/open-source.html"
depends=('openssl' 'lzo2')
license=('custom')
backup=(usr/share/openvpn/easy-rsa/vars
usr/share/openvpn/easy-rsa/openssl.cnf
etc/conf.d/openvpn-tapdev)
2011-05-02 05:41:40 +08:00
source=(http://swupdate.openvpn.net/community/releases/openvpn-${pkgver}.tar.gz
2012-06-24 21:16:00 +08:00
openvpn@.service)
2011-05-02 05:41:40 +08:00
md5sums=('96a11868082685802489254f03ff3bde'
2012-06-24 21:16:00 +08:00
'44047df812a3fcd57a7e36a61732a9b9')
2010-03-13 23:25:19 +08:00
build() {
cd $srcdir/$pkgname-$pkgver
2011-05-02 05:41:40 +08:00
# Build openvpn
2010-03-13 23:25:19 +08:00
CFLAGS="$CFLAGS -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn\\\"" ./configure --prefix=/usr --enable-password-save --mandir=/usr/share/man
2011-05-02 05:41:40 +08:00
make
# Build plugins
for plug in auth-pam down-root; do
cd $srcdir/$pkgname-$pkgver/plugin/$plug
make
done
}
package() {
cd $srcdir/$pkgname-$pkgver
# Install openvpn
make DESTDIR=$pkgdir install
2010-03-13 23:25:19 +08:00
install -d -m755 $pkgdir/etc/openvpn
# Install examples
install -d -m755 $pkgdir/usr/share/openvpn
2011-05-02 05:41:40 +08:00
cp -r sample-config-files $pkgdir/usr/share/openvpn/examples
2010-03-13 23:25:19 +08:00
find $pkgdir/usr/share/openvpn -type f -exec chmod 644 {} \;
find $pkgdir/usr/share/openvpn -type d -exec chmod 755 {} \;
# Install license
2011-05-02 05:41:40 +08:00
install -D -m644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
# Install plugins
2010-03-13 23:25:19 +08:00
for plug in auth-pam down-root; do
cd $srcdir/$pkgname-$pkgver/plugin/$plug
2011-05-02 05:41:40 +08:00
install -D -m755 openvpn-$plug.so $pkgdir/usr/lib/openvpn/openvpn-$plug.so
2010-03-13 23:25:19 +08:00
done
# Install easy-rsa
cd $srcdir/$pkgname-$pkgver
2011-05-02 05:41:40 +08:00
make -C easy-rsa/2.0 install DESTDIR=$pkgdir PREFIX=usr/share/openvpn/easy-rsa
2012-06-24 21:16:00 +08:00
# install systemd units
install -Dm644 "$srcdir/openvpn@.service" "$pkgdir/usr/lib/systemd/system/openvpn@.service"
2010-03-13 23:25:19 +08:00
}