PKGBUILDs/aur/openswan/PKGBUILD

65 lines
1.8 KiB
Bash
Raw Normal View History

2016-06-29 00:23:59 +00:00
# Maintainer: AXVill
# Contributor: dacoit <dacoit at tuta.io>
# Contributor: xjpvictor Huang <ke [AT] xjpvictor [DOT] info>
# Contributor: uuwe
2013-07-31 09:12:52 +00:00
pkgname=openswan
2016-06-29 00:23:59 +00:00
pkgver=2.6.47
2015-08-31 00:38:44 +00:00
pkgrel=1
pkgdesc='Open Source implementation of IPsec for the Linux operating system'
url='https://www.openswan.org'
2013-07-31 09:12:52 +00:00
arch=('i686' 'x86_64')
2015-08-31 00:38:44 +00:00
license=('GPL' 'custom')
depends=('gmp' 'perl' 'iproute2')
2013-07-31 09:12:52 +00:00
makedepends=('flex' 'bison')
2015-08-31 00:38:44 +00:00
optdepends=('python2')
2013-07-31 09:12:52 +00:00
conflicts=('ipsec-tools')
2016-06-29 00:23:59 +00:00
options=('!makeflags')
2015-08-31 00:38:44 +00:00
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')
2013-07-31 09:12:52 +00:00
2014-12-04 15:53:13 +00:00
prepare() {
2015-08-31 00:38:44 +00:00
cd "$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() {
2015-08-31 00:38:44 +00:00
cd "$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() {
2015-08-31 00:38:44 +00:00
cd "$pkgname-$pkgver"
2014-12-04 15:53:13 +00:00
# Pre-create init script directory
2015-08-31 00:38:44 +00:00
mkdir -p "$pkgdir/usr/lib/systemd/scripts"
2014-12-04 15:53:13 +00:00
2015-08-31 00:38:44 +00:00
make DESTDIR="$pkgdir" install
2013-07-31 09:12:52 +00:00
# Change permissions in /var
2015-08-31 00:38:44 +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
2015-08-31 00:38:44 +00:00
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/openswan/LICENSE"
2013-07-31 09:12:52 +00:00
2015-08-31 00:38:44 +00:00
# Install service unit
install -Dm644 "$srcdir/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
2015-08-31 00:38:44 +00:00
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
2015-08-31 00:38:44 +00:00
sed -i '1s|python|python2|' "$pkgdir/usr/lib/openswan/verify"
2013-07-31 09:12:52 +00:00
}
2016-06-29 00:23:59 +00:00
md5sums=('54aa71adb46e4f1b07f3db534540058a'
2013-07-31 09:12:52 +00:00
'd8b465c10838c72e31329d65011002b6')
2016-06-29 00:23:59 +00:00