summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Bidulock2016-09-09 03:10:15 -0600
committerBrian Bidulock2016-09-09 03:10:15 -0600
commitf1bf18cf0ed3d08f6cf04997323205d719d01318 (patch)
tree6b8336f69f2be55de9c72a637473921f45512ebe
downloadaur-f1bf18cf0ed3d08f6cf04997323205d719d01318.tar.gz
initial version
-rw-r--r--.SRCINFO33
-rw-r--r--PKGBUILD71
-rw-r--r--openswan.service16
3 files changed, 120 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2e3646dfa381
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = openswan-git
+ pkgdesc = Open Source implementation of IPsec for the Linux operating system
+ pkgver = 2.6.49.r5.g1a1bda3
+ pkgrel = 1
+ url = https://www.openswan.org
+ arch = i686
+ arch = x86_64
+ license = GPL
+ license = custom
+ makedepends = flex
+ makedepends = bison
+ makedepends = git
+ depends = gmp
+ depends = perl
+ depends = iproute2
+ optdepends = python2
+ provides = openswan
+ conflicts = openswan
+ conflicts = ipsec-tools
+ options = !makeflags
+ backup = etc/ipsec.conf
+ backup = etc/ipsec.d/policies/block
+ backup = etc/ipsec.d/policies/clear
+ backup = etc/ipsec.d/policies/clear-or-private
+ backup = etc/ipsec.d/policies/private
+ backup = etc/ipsec.d/policies/private-or-clear
+ source = openswan-git::git+https://github.com/xelerance/Openswan.git#branch=2.6.50dev
+ source = openswan.service
+ md5sums = SKIP
+ md5sums = 8195505574c86f990cec2fb85ac9a780
+
+pkgname = openswan-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..605334ec5647
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,71 @@
+# Maintainer: Brian Bidulock <bidulock@openss7.org>
+# Contributor: Carsten Feuls <archlinux@carstenfeuls.de>
+# Contributor: AXVill
+# Contributor: dacoit <dacoit at tuta.io>
+# Contributor: xjpvictor Huang <ke [AT] xjpvictor [DOT] info>
+# Contributor: uuwe
+pkgname=openswan-git
+_pkgname=openswan
+pkgver=2.6.49.r5.g1a1bda3
+pkgrel=1
+pkgdesc='Open Source implementation of IPsec for the Linux operating system'
+url='https://www.openswan.org'
+arch=('i686' 'x86_64')
+license=('GPL' 'custom')
+depends=('gmp' 'perl' 'iproute2')
+makedepends=('flex' 'bison' 'git')
+optdepends=('python2')
+provides=($_pkgname)
+conflicts=($_pkgname 'ipsec-tools')
+options=('!makeflags')
+backup=('etc/ipsec.conf'
+ 'etc/ipsec.d/policies/'{block,clear,clear-or-private,private,private-or-clear})
+source=("$pkgname::git+https://github.com/xelerance/Openswan.git#branch=2.6.50dev"
+ 'openswan.service')
+md5sums=('SKIP'
+ '8195505574c86f990cec2fb85ac9a780')
+
+pkgver() {
+ cd $pkgname
+ git describe --long --tags|sed -E 's,^[^0-9]*,,;s,([^-]*-g),r\1,;s,-,.,g'
+}
+
+prepare() {
+ cd $pkgname
+
+ # Change install paths to Arch defaults
+ sed -i 's,INC_MANDIR=man,INC_MANDIR=share/man,' Makefile.inc
+ 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 $pkgname
+ make USE_XAUTH=true USE_OBJDIR=true programs
+}
+
+package() {
+ cd $pkgname
+
+ # Pre-create init script directory
+ mkdir -p "$pkgdir/usr/lib/systemd/scripts"
+
+ make DESTDIR="$pkgdir" install
+
+ # Remove /var (/run/pluto handled by .service file)
+ rm -r "$pkgdir/var"
+
+ # Remove empty man directory
+ rm -r "$pkgdir/usr/share/man/man3"
+
+ # Copy License
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ # Install service unit
+ install -Dm644 "$srcdir/openswan.service" "$pkgdir/usr/lib/systemd/system/openswan.service"
+
+ # fix python2
+ sed -i '1s|python|python2|' "$pkgdir/usr/lib/openswan/verify"
+}
diff --git a/openswan.service b/openswan.service
new file mode 100644
index 000000000000..78509f55ba01
--- /dev/null
+++ b/openswan.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Openswan daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/lib/systemd/scripts/ipsec --start
+ExecStop=/usr/lib/systemd/scripts/ipsec --stop
+ExecReload=/usr/lib/systemd/scripts/ipsec --restart
+Restart=always
+RuntimeDirectory=pluto
+RuntimeDirectoryMode=0700
+
+
+[Install]
+WantedBy=multi-user.target