Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=09fa9e00dbdad723a1fa967add5dc71a8b7a122f
commit 09fa9e00dbdad723a1fa967add5dc71a8b7a122f Author: Miklos Vajna <[email protected]> Date: Tue Mar 29 10:59:36 2011 +0200 strongswan-4.5.1-2-i686 - backport systemd support patch from git diff --git a/source/network-extra/strongswan/FrugalBuild b/source/network-extra/strongswan/FrugalBuild index 685c9ca..e2d1fb0 100644 --- a/source/network-extra/strongswan/FrugalBuild +++ b/source/network-extra/strongswan/FrugalBuild @@ -3,20 +3,27 @@ pkgname=strongswan pkgver=4.5.1 -pkgrel=1 +pkgrel=2 pkgdesc="the OpenSource IPsec-based VPN Solution for Linux" url="http://www.strongswan.org/" -depends=('curl' 'gmp' 'iproute2' 'openssl' 'sqlite3') +depends=('curl' 'gmp' 'iproute2' 'openssl' 'sqlite3' 'systemd') groups=('network-extra') archs=('i686') backup=(etc/{ipsec.conf,strongswan.conf}) _F_archive_grepv="dr" up2date="Flasttar http://www.strongswan.org/download.htm" -source=(http://download.strongswan.org/strongswan-$pkgver.tar.bz2) -signatures=($source.sig) -Fconfopts="$Fconfopts --enable-curl --enable-eap-sim --enable-eap-sim-file --enable-eap-simaka-pseudonym \ +source=(http://download.strongswan.org/strongswan-$pkgver.tar.bz2 systemd.patch) +signatures=($source.sig '') + +build() +{ + Fpatchall + Fautoreconf + Fmake --enable-curl --enable-eap-sim --enable-eap-sim-file --enable-eap-simaka-pseudonym \ --enable-eap-simaka-reauth --enable-eap-identity --enable-eap-md5 \ --enable-eap-gtc --enable-eap-aka --enable-eap-aka-3gpp2 \ - --enable-eap-mschapv2 --enable-eap-radius --enable-md4" + --enable-eap-mschapv2 --enable-eap-radius --enable-md4 + Fmakeinstall +} # optimization OK diff --git a/source/network-extra/strongswan/strongswan.install b/source/network-extra/strongswan/strongswan.install new file mode 100644 index 0000000..d6dea5d --- /dev/null +++ b/source/network-extra/strongswan/strongswan.install @@ -0,0 +1,24 @@ +post_install() +{ + systemctl daemon-reload >/dev/null 2>&1 +} + +post_upgrade() +{ + systemctl daemon-reload >/dev/null 2>&1 +} + +pre_remove() +{ + systemctl --no-reload disable strongswan.service >/dev/null 2>&1 + systemctl stop strongswan.service >/dev/null 2>&1 +} + +post_remove() +{ + systemctl daemon-reload >/dev/null 2>&1 +} + +op=$1 +shift +$op $* diff --git a/source/network-extra/strongswan/systemd.patch b/source/network-extra/strongswan/systemd.patch new file mode 100644 index 0000000..5eb9332 --- /dev/null +++ b/source/network-extra/strongswan/systemd.patch @@ -0,0 +1,100 @@ +Backport from http://git.strongswan.org/strongswan.git/?p=strongswan.git;a=commitdiff;h=fc16b361ef5290510fe92f17b8f821ea809d7604 + +From fc16b361ef5290510fe92f17b8f821ea809d7604 Mon Sep 17 00:00:00 2001 +From: Miklos Vajna <[email protected]> +Date: Mon, 28 Mar 2011 20:04:00 +0200 +Subject: [PATCH] Install systemd service file if systemd is available + +--- + Makefile.am | 2 +- + configure.in | 9 +++++++++ + init/Makefile.am | 6 ++++++ + init/systemd/Makefile.am | 8 ++++++++ + init/systemd/strongswan.service.in | 10 ++++++++++ + 5 files changed, 34 insertions(+), 1 deletions(-) + create mode 100644 init/Makefile.am + create mode 100644 init/systemd/Makefile.am + create mode 100644 init/systemd/strongswan.service.in + +diff --git a/Makefile.am b/Makefile.am +index cba5048..4757c8c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-SUBDIRS = src man testing ++SUBDIRS = src man init testing + + if USE_SCRIPTS + SUBDIRS += scripts +diff --git a/configure.in b/configure.in +index 6dcf65c..4c66b75 100644 +--- a/configure.in ++++ b/configure.in +@@ -43,6 +43,13 @@ ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing tabl + ARG_WITH_SET([capabilities], [no], [set capability dropping library. Currently supported values are "libcap" and "native"]) + ARG_WITH_SET([mpz_powm_sec], [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available]) + ++if test -n "$PKG_CONFIG"; then ++ systemdsystemunitdir_default=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) ++fi ++ARG_WITH_SET([systemdsystemunitdir], [$systemdsystemunitdir_default], [directory for systemd service files]) ++AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno]) ++AC_SUBST(systemdsystemunitdir) ++ + AC_ARG_WITH( + [xauth-module], + AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]), +@@ -957,6 +964,8 @@ dnl ============================== + AC_OUTPUT( + Makefile + man/Makefile ++ init/Makefile ++ init/systemd/Makefile + src/Makefile + src/include/Makefile + src/libstrongswan/Makefile +diff --git a/init/Makefile.am b/init/Makefile.am +new file mode 100644 +index 0000000..69439a1 +--- /dev/null ++++ b/init/Makefile.am +@@ -0,0 +1,6 @@ ++ ++SUBDIRS = ++ ++if HAVE_SYSTEMD ++ SUBDIRS += systemd ++endif +diff --git a/init/systemd/Makefile.am b/init/systemd/Makefile.am +new file mode 100644 +index 0000000..e2bbfc4 +--- /dev/null ++++ b/init/systemd/Makefile.am +@@ -0,0 +1,8 @@ ++ ++EXTRA_DIST = strongswan.service.in ++CLEANFILES = strongswan.service ++ ++systemdsystemunit_DATA = strongswan.service ++ ++strongswan.service : strongswan.service.in ++ sed -e "s:@SBINDIR@:$(sbindir):" $(srcdir)/[email protected] > $@ +diff --git a/init/systemd/strongswan.service.in b/init/systemd/strongswan.service.in +new file mode 100644 +index 0000000..e8dc5e8 +--- /dev/null ++++ b/init/systemd/strongswan.service.in +@@ -0,0 +1,10 @@ ++[Unit] ++Description=strongSwan IPsec ++After=syslog.target ++ ++[Service] ++ExecStart=@SBINDIR@/ipsec start --nofork ++StandardOutput=syslog ++ ++[Install] ++WantedBy=multi-user.target +-- +1.7.1 + _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
