diff options
author | Nicolás Reynolds <fauno@parabola.nu> | 2013-05-24 14:07:18 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@parabola.nu> | 2013-05-24 14:07:18 -0300 |
commit | 3bb2d69f78cc242bd1d314131e45a13dc6697bc2 (patch) | |
tree | 63be1b3f97dbe222ae6fb70b0cfd203db0e52341 /pcr/openswan | |
parent | 8febad754f500027e10af865b0f9f0f5bbc38b3e (diff) |
IPSec implementations
Diffstat (limited to 'pcr/openswan')
-rw-r--r-- | pcr/openswan/PKGBUILD | 43 | ||||
-rwxr-xr-x | pcr/openswan/openswan | 43 | ||||
-rwxr-xr-x | pcr/openswan/openswan.service | 13 |
3 files changed, 80 insertions, 19 deletions
diff --git a/pcr/openswan/PKGBUILD b/pcr/openswan/PKGBUILD index bae970025..97cea98e6 100644 --- a/pcr/openswan/PKGBUILD +++ b/pcr/openswan/PKGBUILD @@ -1,24 +1,23 @@ -# Contributor: Jan Fader <jan.fader@web.de> +# Contributor: xjpvictor Huang <ke [AT] xjpvictor [DOT] info> pkgname=openswan -pkgver=2.6.36 -pkgrel=2 +pkgver=2.6.38 +pkgrel=1 pkgdesc="Open Source implementation of IPsec for the Linux operating system" url="http://www.openswan.org" license=('GPL' 'custom') -arch=('i686' 'x86_64' 'mips64el') -depends=('iproute' 'gmp' 'perl') +arch=('i686' 'x86_64') +depends=('iproute2>=2.6.8' 'gmp' 'perl') +makedepends=('flex' 'bison') +conflicts=('ipsec-tools' 'openswan') +provides=('openswan') backup=(etc/ipsec.conf \ etc/ipsec.d/policies/{block,clear,clear-or-private,private,private-or-clear}) -source=(http://www.openswan.org/download/openswan-$pkgver.tar.gz - openswan.rc.d - compile.patch) +source=(http://download.openswan.org/openswan/openswan-$pkgver.tar.gz + openswan + openswan.service) build() { - # Create /etc/rc.d for init script, and license directory - mkdir -p $pkgdir/{etc/rc.d,usr/share/licenses/openswan} - cd $srcdir/openswan-$pkgver - patch -p1 -i $srcdir/compile.patch # Change install paths to Arch defaults sed -i 's|/usr/local|/usr|;s|libexec/ipsec|lib/openswan|' Makefile.inc @@ -26,21 +25,27 @@ build() { make USE_XAUTH=true USE_OBJDIR=true programs } -package(){ +package() { cd $srcdir/openswan-$pkgver + + # Create /etc/rc.d for init script, and license directory + mkdir -p $pkgdir/{etc/rc.d,usr/share/licenses/openswan} make DESTDIR=$pkgdir install # Change permissions in /var - chmod 755 $pkgdir/var/run/pluto - + chmod 700 $pkgdir/var/run/pluto + # Copy License cp LICENSE $pkgdir/usr/share/licenses/openswan - + # Install init script - install -Dm755 ../openswan.rc.d $pkgdir/etc/rc.d/openswan + install -Dm755 ../openswan $pkgdir/etc/rc.d/openswan + install -Dm644 ../openswan.service $pkgdir/usr/lib/systemd/system/openswan.service + mkdir $pkgdir/usr/lib/systemd/scripts/ + cp $pkgdir/etc/rc.d/ipsec $pkgdir/usr/lib/systemd/scripts/ipsec # fix manpages mv $pkgdir/usr/man $pkgdir/usr/share/ } -md5sums=('b3a1733493520bb18729633b62ef8247' +md5sums=('13073eb5314b83a31be88e4117e8bbcd' '543d84162761b9cc9ec319e938c4dd2a' - '5540437bb334873da646e21ac9caa963') + 'd8b465c10838c72e31329d65011002b6') diff --git a/pcr/openswan/openswan b/pcr/openswan/openswan new file mode 100755 index 000000000..30bd0d56e --- /dev/null +++ b/pcr/openswan/openswan @@ -0,0 +1,43 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + stat_busy "Starting Openswan IPsec" + /etc/rc.d/ipsec --start + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + add_daemon openswan + fi + ;; + stop) + stat_busy "Stopping Openswan IPsec" + /etc/rc.d/ipsec --stop + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + rm_daemon openswan + fi + ;; + restart) + stat_busy "Restarting Openswan IPsec" + /etc/rc.d/ipsec --restart + if [ $? -gt 0 ]; then + stat_fail + else + stat_done + add_daemon openswan + fi + ;; + status) + /etc/rc.d/ipsec --status + ;; + *) + echo "usage: $0 {start|stop|restart|status}" +esac + diff --git a/pcr/openswan/openswan.service b/pcr/openswan/openswan.service new file mode 100755 index 000000000..6d899705c --- /dev/null +++ b/pcr/openswan/openswan.service @@ -0,0 +1,13 @@ +[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 + +[Install] +WantedBy=multi-user.target |