summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Pfeifer <pfeifer@gentoo.org>2005-06-23 22:20:06 +0000
committerJay Pfeifer <pfeifer@gentoo.org>2005-06-23 22:20:06 +0000
commit0533aac0ec2baefb9fefa74a01895f088e6d10cc (patch)
tree9ff40ed5450a966cf87f9862f653027b4f24cab7 /net-misc/strongswan
parentVersion bump. (diff)
downloadhistorical-0533aac0ec2baefb9fefa74a01895f088e6d10cc.tar.gz
historical-0533aac0ec2baefb9fefa74a01895f088e6d10cc.tar.bz2
historical-0533aac0ec2baefb9fefa74a01895f088e6d10cc.zip
Version bump.
Package-Manager: portage-2.0.51.22-r1
Diffstat (limited to 'net-misc/strongswan')
-rw-r--r--net-misc/strongswan/ChangeLog8
-rw-r--r--net-misc/strongswan/Manifest5
-rw-r--r--net-misc/strongswan/files/digest-strongswan-2.4.41
-rw-r--r--net-misc/strongswan/files/strongswan-2.4.4-gentoo.patch257
-rw-r--r--net-misc/strongswan/strongswan-2.4.4.ebuild149
5 files changed, 418 insertions, 2 deletions
diff --git a/net-misc/strongswan/ChangeLog b/net-misc/strongswan/ChangeLog
index b7a4d581d1fb..e58a279c8da3 100644
--- a/net-misc/strongswan/ChangeLog
+++ b/net-misc/strongswan/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/strongswan
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/strongswan/ChangeLog,v 1.26 2005/05/10 01:28:42 pfeifer Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/strongswan/ChangeLog,v 1.27 2005/06/23 22:20:06 pfeifer Exp $
+
+*strongswan-2.4.4 (23 Jun 2005)
+
+ 23 Jun 2005; Jay Pfeifer <pfeifer@gentoo.org>
+ +files/strongswan-2.4.4-gentoo.patch, +strongswan-2.4.4.ebuild:
+ Version bump.
10 May 2005; Jay Pfeifer <pfeifer@gentoo.org> strongswan-2.4.1.ebuild:
Mark stable on x86.
diff --git a/net-misc/strongswan/Manifest b/net-misc/strongswan/Manifest
index eba8b431fe8d..5c387b54a25e 100644
--- a/net-misc/strongswan/Manifest
+++ b/net-misc/strongswan/Manifest
@@ -1,9 +1,11 @@
MD5 e6297c8c76a1d129b2fc8fcf2ac40a6b strongswan-2.2.2.ebuild 3666
MD5 b0885f5ebb16fe1bd4e4e0fe2cb1753b strongswan-2.3.0.ebuild 3664
MD5 8cf6b616e951dc52e00c54e82baba8d2 strongswan-2.3.2.ebuild 3670
-MD5 92d1c62776fede15f86c9f51062c18fc ChangeLog 4448
+MD5 533b09574cc8f7e4f3e9f14f370be629 strongswan-2.4.4.ebuild 3712
+MD5 86519fcb2fcfa43f89b4ba0c1b6de5f0 ChangeLog 4612
MD5 48d78406890387afe4b0d4bba793f8d1 metadata.xml 634
MD5 064d6f0547c302cb4bac648fd47846e4 strongswan-2.4.1.ebuild 3711
+MD5 8b7ed8cba35db92918e4929869e4c282 files/strongswan-2.4.4-gentoo.patch 11561
MD5 e5c314dfa834ee14593f4b779f539ed1 files/strongswan-2.2.2-gentoo.patch 12859
MD5 d35f8aea878066e110e6ff3d09a4f50e files/ipsec 1538
MD5 47a9dfbe76a29a7364281925b1315aae files/strongswan-2.3.0-gentoo.patch 12012
@@ -11,5 +13,6 @@ MD5 c538ae5513e73c1ab298f18b7482cbcc files/digest-strongswan-2.2.2 69
MD5 4ef28324e1a2a0771bcc8e2198b70333 files/digest-strongswan-2.3.0 69
MD5 54559c4a469f44360df4e37b03b2404d files/digest-strongswan-2.3.2 70
MD5 1f3af171d38ad8310936b0c695eedf64 files/digest-strongswan-2.4.1 70
+MD5 2de02207b4352ea45d9e4e6546a9c7c6 files/digest-strongswan-2.4.4 70
MD5 30aeca768ac7a52bcfeef648424925db files/strongswan-2.3.2-gentoo.patch 12012
MD5 ec018e1d16f6002ac621f39cae1fec21 files/strongswan-2.4.1-gentoo.patch 11561
diff --git a/net-misc/strongswan/files/digest-strongswan-2.4.4 b/net-misc/strongswan/files/digest-strongswan-2.4.4
new file mode 100644
index 000000000000..2d01337f0966
--- /dev/null
+++ b/net-misc/strongswan/files/digest-strongswan-2.4.4
@@ -0,0 +1 @@
+MD5 84dc2b323188c42c70094675e5d6e4c4 strongswan-2.4.4.tar.bz2 2641143
diff --git a/net-misc/strongswan/files/strongswan-2.4.4-gentoo.patch b/net-misc/strongswan/files/strongswan-2.4.4-gentoo.patch
new file mode 100644
index 000000000000..df8f3218c762
--- /dev/null
+++ b/net-misc/strongswan/files/strongswan-2.4.4-gentoo.patch
@@ -0,0 +1,257 @@
+diff -Naurp strongswan-2.4.4/Makefile.inc strongswan-2.4.4-gentoo/Makefile.inc
+--- strongswan-2.4.4/Makefile.inc 2004-09-17 12:15:20.000000000 -0500
++++ strongswan-2.4.4-gentoo/Makefile.inc 2005-06-23 17:11:12.000000000 -0500
+@@ -62,7 +62,7 @@ POLICYLIB=${FREESWANSRCDIR}/lib/libipsec
+ DESTDIR?=
+
+ # "local" part of tree, used in building other pathnames
+-INC_USRLOCAL=/usr/local
++INC_USRLOCAL=/usr
+
+ # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
+ # settings which are assumed to include it (or at least, to include *some*
+@@ -96,7 +96,7 @@ MANTREE=$(DESTDIR)$(INC_USRLOCAL)/$(INC_
+ MANPLACES=man3 man5 man8
+
+ # where configuration files go
+-FINALCONFFILE?=/etc/ipsec.conf
++FINALCONFFILE?=/etc/ipsec/ipsec.conf
+ CONFFILE=$(DESTDIR)$(FINALCONFFILE)
+
+ FINALCONFDIR?=/etc
+@@ -107,10 +107,10 @@ CONFDDIR=$(DESTDIR)$(FINALCONFDDIR)
+
+ # sample configuration files go into
+ INC_DOCDIR?=share/doc
+-FINALEXAMPLECONFDIR=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan
++FINALEXAMPLECONFDIR=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan-2.4.4
+ EXAMPLECONFDIR=${DESTDIR}${FINALEXAMPLECONFDIR}
+
+-FINALDOCDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan
++FINALDOCDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan-2.4.4
+ DOCDIR=${DESTDIR}${FINALDOCDIR}
+
+ # where per-conn pluto logs go
+@@ -239,7 +239,7 @@ RH_KERNELSRC?=/usr/src/linux-2.4
+ # installed one in RH 7.2, won't work - you wind up depending upon
+ # openssl.
+
+-BIND9STATICLIBDIR?=/usr/local/lib
++BIND9STATICLIBDIR?=/usr/lib
+
+ # FreeSWAN 3.x will require bind9.
+ USE_LWRES?=false
+diff -Naurp strongswan-2.4.4/programs/_include/_include.in strongswan-2.4.4-gentoo/programs/_include/_include.in
+--- strongswan-2.4.4/programs/_include/_include.in 2004-03-15 15:03:06.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/_include/_include.in 2005-06-23 17:11:12.000000000 -0500
+@@ -49,10 +49,10 @@ for f
+ do
+ if test ! -r "$f"
+ then
+- if test ! "$f" = "/etc/ipsec.conf"
++ if test ! "$f" = "/etc/ipsec/ipsec.conf"
+ then
+ echo "#:cannot open configuration file \'$f\'"
+- if test "$f" = "/etc/ipsec.secrets"
++ if test "$f" = "/etc/ipsec/ipsec.secrets"
+ then
+ echo "#:Your secrets file will be created when you start $IPSEC_NAME for the first time."
+ fi
+diff -Naurp strongswan-2.4.4/programs/barf/barf.in strongswan-2.4.4-gentoo/programs/barf/barf.in
+--- strongswan-2.4.4/programs/barf/barf.in 2004-09-23 16:08:23.000000000 -0500
++++ strongswan-2.4.4-gentoo/programs/barf/barf.in 2005-06-23 17:11:12.000000000 -0500
+@@ -19,7 +19,7 @@ IPSEC_NAME="strongSwan"
+ KERNSRC=${KERNSRC-/usr/src/linux}
+ LOGS=${LOGS-/var/log}
+ CONFS=${IPSEC_CONFS-/etc}
+-CONFDDIR=${IPSEC_CONFDDIR-/etc/ipsec.d}
++CONFDDIR=${IPSEC_CONFDDIR-/etc/ipsec/ipsec.d}
+ me="ipsec barf"
+
+ # kludge to produce no barf output mentioning policygroups if none are present.
+@@ -207,13 +207,13 @@ then
+ done
+ fi
+ _________________________ ipsec/ls-libdir
+-ls -l ${IPSEC_LIBDIR-/usr/local/lib/ipsec}
++ls -l ${IPSEC_LIBDIR-/usr/lib/ipsec}
+ _________________________ ipsec/ls-execdir
+-ls -l ${IPSEC_EXECDIR-/usr/local/libexec/ipsec}
++ls -l ${IPSEC_EXECDIR-/usr/libexec/ipsec}
+ _________________________ ipsec/updowns
+-for f in `ls ${IPSEC_EXECDIR-/usr/local/libexec/ipsec} | egrep updown`
++for f in `ls ${IPSEC_EXECDIR-/usr/libexec/ipsec} | egrep updown`
+ do
+- cat ${IPSEC_EXECDIR-/usr/local/libexec/ipsec}/$f
++ cat ${IPSEC_EXECDIR-/usr/libexec/ipsec}/$f
+ done
+ _________________________ proc/net/dev
+ cat /proc/net/dev
+diff -Naurp strongswan-2.4.4/programs/eroute/eroute.5 strongswan-2.4.4-gentoo/programs/eroute/eroute.5
+--- strongswan-2.4.4/programs/eroute/eroute.5 2004-03-15 14:35:27.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/eroute/eroute.5 2005-06-23 17:11:12.000000000 -0500
+@@ -223,7 +223,7 @@ Parameters Index of
+ in hexadecimal using Authentication Header protocol (51,
+ IPPROTO_AH) with no identies defined for either end.
+ .SH FILES
+-/proc/net/ipsec_eroute, /usr/local/bin/ipsec
++/proc/net/ipsec_eroute, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_spi(5),
+ ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_eroute(8), ipsec_version(5),
+diff -Naurp strongswan-2.4.4/programs/eroute/eroute.8 strongswan-2.4.4-gentoo/programs/eroute/eroute.8
+--- strongswan-2.4.4/programs/eroute/eroute.8 2004-03-15 14:35:27.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/eroute/eroute.8 2005-06-23 17:11:12.000000000 -0500
+@@ -308,7 +308,7 @@ will be in clear text.
+ .br
+ .LP
+ .SH FILES
+-/proc/net/ipsec_eroute, /usr/local/bin/ipsec
++/proc/net/ipsec_eroute, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_spi(8),
+ ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_eroute(5)
+diff -Naurp strongswan-2.4.4/programs/ipsec/ipsec.8 strongswan-2.4.4-gentoo/programs/ipsec/ipsec.8
+--- strongswan-2.4.4/programs/ipsec/ipsec.8 2004-03-15 14:35:27.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/ipsec/ipsec.8 2005-06-23 17:11:12.000000000 -0500
+@@ -81,7 +81,7 @@ reports where
+ .I ipsec
+ thinks the IPsec configuration files are stored.
+ .SH FILES
+-/usr/local/lib/ipsec usual utilities directory
++/usr/lib/ipsec usual utilities directory
+ .SH ENVIRONMENT
+ .PP
+ The following environment variables control where FreeS/WAN finds its
+diff -Naurp strongswan-2.4.4/programs/klipsdebug/klipsdebug.5 strongswan-2.4.4-gentoo/programs/klipsdebug/klipsdebug.5
+--- strongswan-2.4.4/programs/klipsdebug/klipsdebug.5 2004-03-15 14:35:28.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/klipsdebug/klipsdebug.5 2005-06-23 17:11:12.000000000 -0500
+@@ -103,7 +103,7 @@ full
+ sockets debugging has been set and everything else is not set.
+ .LP
+ .SH FILES
+-/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec
++/proc/net/ipsec_klipsdebug, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8),
+ ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(5), ipsec_version(5),
+diff -Naurp strongswan-2.4.4/programs/klipsdebug/klipsdebug.8 strongswan-2.4.4-gentoo/programs/klipsdebug/klipsdebug.8
+--- strongswan-2.4.4/programs/klipsdebug/klipsdebug.8 2004-03-15 14:35:28.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/klipsdebug/klipsdebug.8 2005-06-23 17:11:12.000000000 -0500
+@@ -117,7 +117,7 @@ turns off only the
+ debugging messages.
+ .LP
+ .SH FILES
+-/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec
++/proc/net/ipsec_klipsdebug, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8),
+ ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(5)
+diff -Naurp strongswan-2.4.4/programs/lwdnsq/lwdnsq.xml.in strongswan-2.4.4-gentoo/programs/lwdnsq/lwdnsq.xml.in
+--- strongswan-2.4.4/programs/lwdnsq/lwdnsq.xml.in 2004-03-15 14:35:28.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/lwdnsq/lwdnsq.xml.in 2005-06-23 17:11:12.000000000 -0500
+@@ -430,7 +430,7 @@ information.
+ <refsect1><title>Special IPSECKEY processing</title>
+
+ <programlisting>
+-/etc/ipsec.d/lwdnsq.conf
++/etc/ipsec/ipsec.d/lwdnsq.conf
+ </programlisting>
+
+ </refsect1>
+diff -Naurp strongswan-2.4.4/programs/mailkey/mailkey.in strongswan-2.4.4-gentoo/programs/mailkey/mailkey.in
+--- strongswan-2.4.4/programs/mailkey/mailkey.in 2004-03-15 14:35:28.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/mailkey/mailkey.in 2005-06-23 17:11:12.000000000 -0500
+@@ -60,7 +60,7 @@ with the following error:
+
+ "$test1st"
+
+-Common concerns: This account must be able to read /etc/ipsec.secrets.
++Common concerns: This account must be able to read /etc/ipsec/ipsec.secrets.
+ If you haven't generated your key yet, please run 'ipsec newhostkey'."
+ exit 0
+ }
+diff -Naurp strongswan-2.4.4/programs/showhostkey/showhostkey.in strongswan-2.4.4-gentoo/programs/showhostkey/showhostkey.in
+--- strongswan-2.4.4/programs/showhostkey/showhostkey.in 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/showhostkey/showhostkey.in 2005-06-23 17:11:12.000000000 -0500
+@@ -18,7 +18,7 @@ me="ipsec showhostkey"
+ usage="Usage: $me [--file secrets] [--left] [--right] [--txt gateway] [--id id]
+ [--dhclient]"
+
+-file=/etc/ipsec.secrets
++file=/etc/ipsec/ipsec.secrets
+ fmt=""
+ gw=
+ id=
+diff -Naurp strongswan-2.4.4/programs/spi/spi.5 strongswan-2.4.4-gentoo/programs/spi/spi.5
+--- strongswan-2.4.4/programs/spi/spi.5 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/spi/spi.5 2005-06-23 17:11:12.000000000 -0500
+@@ -162,7 +162,7 @@ since 1 of 8 bits is a parity bit), has
+ 3858 seconds ago and has been idle for 23 seconds.
+ .LP
+ .SH FILES
+-/proc/net/ipsec_spi, /usr/local/bin/ipsec
++/proc/net/ipsec_spi, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_eroute(5),
+ ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_spi(8), ipsec_version(5),
+diff -Naurp strongswan-2.4.4/programs/spi/spi.8 strongswan-2.4.4-gentoo/programs/spi/spi.8
+--- strongswan-2.4.4/programs/spi/spi.8 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/spi/spi.8 2005-06-23 17:11:12.000000000 -0500
+@@ -461,7 +461,7 @@ and protocol
+ (4).
+ .LP
+ .SH FILES
+-/proc/net/ipsec_spi, /usr/local/bin/ipsec
++/proc/net/ipsec_spi, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8),
+ ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_spi(5)
+diff -Naurp strongswan-2.4.4/programs/spigrp/spigrp.5 strongswan-2.4.4-gentoo/programs/spigrp/spigrp.5
+--- strongswan-2.4.4/programs/spigrp/spigrp.5 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/spigrp/spigrp.5 2005-06-23 17:11:12.000000000 -0500
+@@ -77,7 +77,7 @@ be an incoming or outgoing group, depend
+ machine.
+ .LP
+ .SH FILES
+-/proc/net/ipsec_spigrp, /usr/local/bin/ipsec
++/proc/net/ipsec_spigrp, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(5), ipsec_eroute(5),
+ ipsec_spi(5), ipsec_klipsdebug(5), ipsec_spigrp(8), ipsec_version(5),
+diff -Naurp strongswan-2.4.4/programs/spigrp/spigrp.8 strongswan-2.4.4-gentoo/programs/spigrp/spigrp.8
+--- strongswan-2.4.4/programs/spigrp/spigrp.8 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/spigrp/spigrp.8 2005-06-23 17:11:12.000000000 -0500
+@@ -128,7 +128,7 @@ and finally an AH header to authenticate
+ .BR 0x236 .
+ .LP
+ .SH FILES
+-/proc/net/ipsec_spigrp, /usr/local/bin/ipsec
++/proc/net/ipsec_spigrp, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8),
+ ipsec_spi(8), ipsec_klipsdebug(8), ipsec_spigrp(5)
+diff -Naurp strongswan-2.4.4/programs/tncfg/tncfg.5 strongswan-2.4.4-gentoo/programs/tncfg/tncfg.5
+--- strongswan-2.4.4/programs/tncfg/tncfg.5 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/tncfg/tncfg.5 2005-06-23 17:11:12.000000000 -0500
+@@ -75,7 +75,7 @@ shows that virtual device
+ is not connected to any physical device.
+ .LP
+ .SH "FILES"
+-/proc/net/ipsec_tncfg, /usr/local/bin/ipsec
++/proc/net/ipsec_tncfg, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_eroute(5), ipsec_spi(5),
+ ipsec_spigrp(5), ipsec_klipsdebug(5), ipsec_tncfg(8), ipsec_version(5),
+diff -Naurp strongswan-2.4.4/programs/tncfg/tncfg.8 strongswan-2.4.4-gentoo/programs/tncfg/tncfg.8
+--- strongswan-2.4.4/programs/tncfg/tncfg.8 2004-03-15 14:35:31.000000000 -0600
++++ strongswan-2.4.4-gentoo/programs/tncfg/tncfg.8 2005-06-23 17:11:12.000000000 -0500
+@@ -76,7 +76,7 @@ virtual device to the
+ physical device.
+ .LP
+ .SH "FILES"
+-/proc/net/ipsec_tncfg, /usr/local/bin/ipsec
++/proc/net/ipsec_tncfg, /usr/bin/ipsec
+ .SH "SEE ALSO"
+ ipsec(8), ipsec_manual(8), ipsec_eroute(8), ipsec_spi(8),
+ ipsec_spigrp(8), ipsec_klipsdebug(8), ipsec_tncfg(5)
diff --git a/net-misc/strongswan/strongswan-2.4.4.ebuild b/net-misc/strongswan/strongswan-2.4.4.ebuild
new file mode 100644
index 000000000000..0aee357884a6
--- /dev/null
+++ b/net-misc/strongswan/strongswan-2.4.4.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/strongswan/strongswan-2.4.4.ebuild,v 1.1 2005/06/23 22:20:06 pfeifer Exp $
+
+inherit eutils
+
+DESCRIPTION="Open Source implementation of IPsec for the Linux operating system."
+HOMEPAGE="http://www.strongswan.org/"
+SRC_URI="http://download.strongswan.org/${P}.tar.bz2
+ mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~x86 ~ppc ~amd64"
+IUSE="curl ldap smartcard"
+
+DEPEND="!net-misc/openswan
+ virtual/libc
+ virtual/linux-sources
+ curl? ( net-misc/curl )
+ ldap? ( =net-nds/openldap-2* )
+ smartcard? ( dev-libs/opensc )
+ >=dev-libs/gmp-3.1.1
+ net-misc/host
+ sys-apps/iproute2"
+RDEPEND=""
+
+check_version_h() {
+ if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
+ then
+ eerror "Please verify that your /usr/src/linux symlink is pointing"
+ eerror "to your current kernel sources, and that you have a running kernel"
+ die "/usr/src/linux symlink not setup!"
+ fi
+}
+
+get_KV_info() {
+ check_version_h
+
+ # Get the kernel version of sources in /usr/src/linux ...
+ export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
+ "${ROOT}/usr/src/linux/include/linux/version.h")"
+ export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
+ export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
+ export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
+}
+
+is_kernel() {
+ [ -z "$1" -o -z "$2" ] && return 1
+
+ get_KV_info
+
+ if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
+ then
+ return 0
+ else
+ return 1
+ fi
+}
+
+pkg_setup() {
+ get_KV_info
+
+ einfo "Linux kernel is version ${KV_major}.${KV_minor}.${KV_micro}"
+
+ if is_kernel 2 5
+ then
+ eerror "Kernel version ${KV_major}.${KV_minor}.${KV_micro} will not work with this ebuild."
+ die "Please install a 2.6.x version of the Linux kernel."
+ fi
+
+ if is_kernel 2 6
+ then
+ einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
+ einfo "KLIPS will not be compiled/installed."
+ export MYMAKE="programs"
+
+ elif is_kernel 2 4
+ then
+ [ -d /usr/src/linux/net/ipsec ] || {
+ eerror "You need to have an IPsec enabled 2.4.x kernel."
+ eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
+ }
+ einfo "Using patched-in IPsec code for kernel 2.4"
+ einfo "Your kernel only supports KLIPS for kernel level IPsec."
+ export MYMAKE="confcheck programs"
+
+ else
+ eerror "Sorry, no support for your kernel version ${KV_major}.${KV_minor}.${KV_micro}."
+ die "Install an IPsec enabled 2.4 or 2.6 kernel."
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ epatch ${FILESDIR}/${P}-gentoo.patch
+
+ cd programs/pluto
+
+ if use curl ; then
+ ebegin "Curl support requested. Enabling curl support"
+ sed -i -e 's:#LIBCURL=1:LIBCURL=1:g' Makefile || die
+ eend $?
+ fi
+
+ if use ldap ; then
+ ebegin "LDAP support requested. Enabling LDAPv3 support"
+ sed -i -e 's:#LDAP_VERSION=3:LDAP_VERSION=3:g' Makefile || die
+ eend $?
+ fi
+
+ if use smartcard ; then
+ ebegin "Smartcard support requested. Enabling opensc support"
+ sed -i -e 's:#SMARTCARD=1:SMARTCARD=1:g' Makefile || die
+ eend $?
+ fi
+}
+
+src_compile() {
+ make \
+ DESTDIR=${D} \
+ USERCOMPILE="${CFLAGS}" \
+ FINALCONFDIR=/etc/ipsec \
+ INC_RCDEFAULT=/etc/init.d \
+ INC_USRLOCAL=/usr \
+ INC_MANDIR=share/man \
+ ${MYMAKE} || die
+}
+
+src_install() {
+ make \
+ DESTDIR=${D} \
+ USERCOMPILE="${CFLAGS}" \
+ FINALCONFDIR=/etc/ipsec \
+ INC_RCDEFAULT=/etc/init.d \
+ INC_USRLOCAL=/usr \
+ INC_MANDIR=share/man \
+ install || die
+
+ dohtml doc/*.html
+ rm -f ${S}/doc/*.html
+ dodoc CHANGES* CREDITS INSTALL LICENSE README* doc/*
+ dosym /etc/ipsec/ipsec.d /etc/ipsec.d
+
+ exeinto /etc/init.d/
+ doexe ${FILESDIR}/ipsec
+}