2014-12-04 15:53:13 +00:00
|
|
|
# Contributor: uuwe
|
|
|
|
# Maintainer: xjpvictor Huang <ke [AT] xjpvictor [DOT] info>
|
2013-07-31 09:12:52 +00:00
|
|
|
pkgname=openswan
|
2014-11-09 05:23:08 +00:00
|
|
|
pkgver=2.6.42
|
2015-01-08 02:45:42 +00:00
|
|
|
pkgrel=3
|
2013-07-31 09:12:52 +00:00
|
|
|
pkgdesc="Open Source implementation of IPsec for the Linux operating system"
|
|
|
|
url="http://www.openswan.org"
|
|
|
|
license=('GPL' 'custom')
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
depends=('iproute2>=2.6.8' 'gmp' 'perl')
|
|
|
|
optdepends=('python2')
|
|
|
|
makedepends=('flex' 'bison')
|
|
|
|
conflicts=('ipsec-tools')
|
|
|
|
backup=(etc/ipsec.conf \
|
|
|
|
etc/ipsec.d/policies/{block,clear,clear-or-private,private,private-or-clear})
|
|
|
|
source=(http://download.openswan.org/openswan/openswan-$pkgver.tar.gz
|
|
|
|
openswan.service)
|
|
|
|
|
2014-12-04 15:53:13 +00:00
|
|
|
prepare() {
|
|
|
|
cd $srcdir/${pkgname}-$pkgver
|
2013-07-31 09:12:52 +00:00
|
|
|
|
|
|
|
# Change install paths to Arch defaults
|
|
|
|
sed -i 's|/usr/local|/usr|;s|libexec/ipsec|lib/openswan|;s|)/sbin|)/bin|' Makefile.inc
|
|
|
|
|
2014-12-04 15:53:13 +00:00
|
|
|
# Replace invalid init script paths with systemd script path
|
|
|
|
sed -i 's/^INC_RCDIRS.*/INC_RCDIRS\?\=\/usr\/lib\/systemd\/scripts/' Makefile.inc
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd $srcdir/${pkgname}-$pkgver
|
2013-07-31 09:12:52 +00:00
|
|
|
make USE_XAUTH=true USE_OBJDIR=true programs || return 1
|
2014-12-04 15:53:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd $srcdir/${pkgname}-$pkgver
|
|
|
|
|
|
|
|
# Pre-create init script directory
|
|
|
|
mkdir -p $pkgdir/usr/lib/systemd/scripts/
|
|
|
|
|
|
|
|
make DESTDIR="${pkgdir}" install
|
2013-07-31 09:12:52 +00:00
|
|
|
|
|
|
|
# Change permissions in /var
|
2015-01-08 02:45:42 +00:00
|
|
|
mv $pkgdir/var/run $pkgdir/
|
|
|
|
rm -r $pkgdir/var
|
|
|
|
chmod 700 $pkgdir/run/pluto
|
2013-07-31 09:12:52 +00:00
|
|
|
|
|
|
|
# Copy License
|
2014-12-04 15:53:13 +00:00
|
|
|
install -Dm644 LICENSE $pkgdir/usr/share/licenses/openswan/LICENSE
|
2013-07-31 09:12:52 +00:00
|
|
|
|
|
|
|
# Install init script
|
|
|
|
install -Dm644 ../openswan.service $pkgdir/usr/lib/systemd/system/openswan.service
|
2014-12-04 15:53:13 +00:00
|
|
|
|
2013-07-31 09:12:52 +00:00
|
|
|
# fix manpages
|
|
|
|
mv $pkgdir/usr/man $pkgdir/usr/share/
|
2014-12-04 15:53:13 +00:00
|
|
|
|
2013-07-31 09:12:52 +00:00
|
|
|
# fix python2
|
|
|
|
sed -i '1s|python|python2|' $pkgdir/usr/lib/openswan/verify
|
|
|
|
}
|
2014-11-09 05:23:08 +00:00
|
|
|
md5sums=('22240ce28be48f051bfdc874083c8947'
|
2013-07-31 09:12:52 +00:00
|
|
|
'd8b465c10838c72e31329d65011002b6')
|