blob: 3d554ace28db0fb8ace597e96175ce01cfdf8c35 (
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
62
|
# Contributor: uuwe
# Maintainer: xjpvictor Huang <ke [AT] xjpvictor [DOT] info>
pkgname=openswan
pkgver=2.6.42
pkgrel=3
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{,.asc}
openswan.service)
validpgpkeys=('9A9A392AA8D738BA263458AAF51005129FC816CA')
md5sums=('22240ce28be48f051bfdc874083c8947'
'SKIP'
'd8b465c10838c72e31329d65011002b6')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Change install paths to Arch defaults
sed -i 's|/usr/local|/usr|;s|libexec/ipsec|lib/openswan|;s|)/sbin|)/bin|' Makefile.inc
# 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}"
make USE_XAUTH=true USE_OBJDIR=true programs
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Pre-create init script directory
mkdir -p "${pkgdir}"/usr/lib/systemd/scripts/
make DESTDIR="${pkgdir}" install
# Change permissions in /var
mv "${pkgdir}"/var/run "${pkgdir}"/
rm -r "${pkgdir}"/var
chmod 700 "${pkgdir}"/run/pluto
# Copy License
install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/openswan/LICENSE
# Install init script
install -Dm644 "${srcdir}"/openswan.service "${pkgdir}"/usr/lib/systemd/system/openswan.service
# fix manpages
mv "${pkgdir}"/usr/man "${pkgdir}"/usr/share/
# fix python2
sed -i '1s|python|python2|' "${pkgdir}"/usr/lib/openswan/verify
}
|