Depend on the old output style of ifconfig, and simplify build flags a bit.
authorMike Frysinger <vapier@gentoo.org>
Mon, 21 Nov 2011 20:51:51 +0000 (20:51 +0000)
committerMike Frysinger <vapier@gentoo.org>
Mon, 21 Nov 2011 20:51:51 +0000 (20:51 +0000)
Package-Manager: portage-2.2.0_alpha75/cvs/Linux x86_64

net-misc/openswan/ChangeLog
net-misc/openswan/Manifest
net-misc/openswan/openswan-2.6.37-r1.ebuild [new file with mode: 0644]

index a41e7cce35f7eb9a2eb75f8f68c73cf1d4ac1389..b9191709fc7412dfde224f66dcd247673b4d9c56 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for net-misc/openswan
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/ChangeLog,v 1.79 2011/11/10 14:32:21 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/ChangeLog,v 1.80 2011/11/21 20:51:51 vapier Exp $
+
+*openswan-2.6.37-r1 (21 Nov 2011)
+
+  21 Nov 2011; Mike Frysinger <vapier@gentoo.org> +openswan-2.6.37-r1.ebuild:
+  Depend on the old output style of ifconfig, and simplify build flags a bit.
 
   10 Nov 2011; Tony Vroon <chainsaw@gentoo.org> openswan-2.6.37.ebuild:
   Marked stable on AMD64 based on arch testing by Agostino "ago" Sarubbo & Ian
index 56536636e2f0341318927b126fec847305883625..efc933200097013a56ebf5ca1f22b647066287a5 100644 (file)
@@ -1,5 +1,5 @@
 -----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA256
 
 AUX ipsec 1551 RMD160 9f2480ebfb7549df1cbe3cf5c62575acd78a986a SHA1 53c1826bea6a613a025d34ea3b68e95c2b13e62c SHA256 926aedf5585626202b9817e0d37ef40c4a07ef1f75b77de228eb7f5f8b8e6f21
 AUX ipsec-initd 487 RMD160 23d9d7be6000fb95fdb142bc948964d6050b7864 SHA1 55a4c3ab2523f265e314c9048c0552699564fc4d SHA256 e86140b6e596a0b0d6e52ca521adb891eb3b9cc4ad8e6f28041fb773f9f60347
@@ -14,13 +14,14 @@ DIST openswan-2.6.31.tar.gz 11677821 RMD160 bd04ffcf3432887a93d2f97257dbb0ee40ea
 DIST openswan-2.6.37.tar.gz 11238286 RMD160 5ae2ba1e998d0e8a78097ec6d1fe062a1ccfb44f SHA1 a0da03e113f1a54c60513f7e8f9908e198c5cd15 SHA256 235a8e0207db661d533368037b2d6d3e9a300cca37e0ed0e906d96fee3a8cc62
 EBUILD openswan-2.4.15-r2.ebuild 3950 RMD160 69b877cca4604ebb777d649e730f96c26d832226 SHA1 0d32a4ef5d427e1cca3d4556b38bd654afbcb10d SHA256 5c00e82e2da652bfd6426ee2102f74fa9323a18248cdd55904675507a65ca6d6
 EBUILD openswan-2.6.31.ebuild 5292 RMD160 c19a17d74030330bc7f46385e25e3aa6f4d89b0d SHA1 cc31f59e5f7f617b3c341895cb3e75a66f4ad0f7 SHA256 6a426c2b72b918620e611a3ff6185ad604ebb96bbb91c4ac1fc18d8874ca5548
+EBUILD openswan-2.6.37-r1.ebuild 5219 RMD160 d84a3d3ed6686bb4ee6b2483ff1d603bc6ac76b7 SHA1 fefae67a0bf36fed13f111cd91ce228bb113b884 SHA256 72e5ad84fd4c4b1062a1db907aa50271442bba6b1009f4f125d15adfe4b7a7ab
 EBUILD openswan-2.6.37.ebuild 5367 RMD160 4a46d5ea838a6a3fd60e685cae001ccfe97c2cf7 SHA1 96a0035269245b2aa6aafc9b687fff3d9b271287 SHA256 23b815a13eb5ea07d4ac5c91eecd60ee8a0103a032220bc97c443af5d8790aa5
-MISC ChangeLog 16030 RMD160 f7224c47a80319328c6f24c994d75cc08d4db6f8 SHA1 da798698147baf4119ed47ea1b7cf227a8def1f6 SHA256 b76093bb4979edbcfd765f963a3ebe5932b23bae2a99be6c50cdd2731dd40a2a
+MISC ChangeLog 16220 RMD160 9b58e68fc50c50892af61de7e1569e3616fa0b52 SHA1 c6cfe054812da7b099f42bed730e6d7a9cb82322 SHA256 de1fcaf610a5d095914b2b23719ebe48265639932876a82027daa16103ad9662
 MISC metadata.xml 1314 RMD160 019be7cd2bd127e6a5bad6d35a35976e55ea7a87 SHA1 89038b19f7d141e24472c1a1afc4d6f0dbb8f102 SHA256 f4f37122d69a0f0dfe862f18fd49d6be83bad404ecfbccbf9ce383708541a84a
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
-iEYEARECAAYFAk674IgACgkQp5vW4rUFj5ra/ACffsWvzl3DjxmchArOKa+0788P
-xuAAn2/0Qk2N4EKsOwEqr8dWsxcm+NTp
-=8X6I
+iF4EAREIAAYFAk7Kue4ACgkQaC/OocHi7JYuqQD/eQasLHJRF6nvGYAkxyLGEJb6
+x+BHYjeWruH3R74gp1kA/26O1R0WZMLOebDwbhIJafV9YPHPkkJPb31fHx7z0rRw
+=5Czn
 -----END PGP SIGNATURE-----
diff --git a/net-misc/openswan/openswan-2.6.37-r1.ebuild b/net-misc/openswan/openswan-2.6.37-r1.ebuild
new file mode 100644 (file)
index 0000000..1f3922a
--- /dev/null
@@ -0,0 +1,175 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/openswan-2.6.37-r1.ebuild,v 1.1 2011/11/21 20:51:51 vapier Exp $
+
+EAPI="2"
+
+inherit eutils linux-info toolchain-funcs flag-o-matic
+
+DESCRIPTION="Open Source implementation of IPsec for the Linux operating system (was SuperFreeS/WAN)."
+HOMEPAGE="http://www.openswan.org/"
+SRC_URI="http://www.openswan.org/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="caps curl ldap pam ssl extra-algorithms weak-algorithms nocrypto-algorithms ms-bad-proposal nss"
+
+RESTRICT="test" # requires user mode linux setup
+
+COMMON_DEPEND="!net-misc/strongswan
+       dev-libs/gmp
+       dev-lang/perl
+       caps? ( sys-libs/libcap-ng )
+       curl? ( net-misc/curl )
+       ldap? ( net-nds/openldap )
+       nss? ( dev-libs/nss )
+       ssl? ( dev-libs/openssl )"
+DEPEND="${COMMON_DEPEND}
+       virtual/linux-sources
+       app-text/xmlto
+       app-text/docbook-xml-dtd:4.1.2" # see bug 237132
+RDEPEND="${COMMON_DEPEND}
+       || ( sys-apps/net-tools[old-output] <sys-apps/net-tools-1.60_p201111202031570500 )
+       virtual/logger
+       sys-apps/iproute2"
+
+pkg_setup() {
+       if use nocrypto-algorithms && ! use weak-algorithms; then
+               ewarn "Enabling nocrypto-algorithms USE flag has no effect when"
+               ewarn "weak-algorithms USE flag is disabled"
+       fi
+
+       linux-info_pkg_setup
+
+       if kernel_is -ge 2 6; then
+               einfo "This ebuild will set ${P} to use kernel native IPsec (KAME)."
+               MYMAKE="programs"
+
+       elif kernel_is 2 4; then
+               if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
+                       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"
+                       die
+               fi
+
+               einfo "Using patched-in IPsec code for kernel 2.4"
+               einfo "Your kernel only supports KLIPS for kernel level IPsec."
+               MYMAKE="confcheck programs"
+
+       else
+               die "Unsupported kernel version"
+       fi
+
+       # most code is OK, but programs/pluto code breaks strict aliasing
+       append-cflags -fno-strict-aliasing
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-gentoo.patch
+       use ms-bad-proposal && epatch "${FILESDIR}"/${PN}-${PV%.*}-allow-ms-bad-proposal.patch
+
+       find . -type f -regex '.*[.]\([1-8]\|html\|xml\)' -exec sed -i \
+           -e s:/usr/local:/usr:g '{}' \; ||
+           die "failed to replace text in docs"
+}
+
+usetf() { usex $1 true false ; }
+get_make_options() {
+       make_options=(
+               KERNELSRC="${KERNEL_DIR}"
+               FINALEXAMPLECONFDIR=/usr/share/doc/${PF}
+               INC_RCDEFAULT=/etc/init.d
+               INC_USRLOCAL=/usr
+               INC_MANDIR=share/man
+               FINALDOCDIR=/usr/share/doc/${PF}/html
+               FINALLIBDIR=/usr/$(get_libdir)/ipsec
+               DESTDIR="${D}"
+               USERCOMPILE="${CFLAGS}"
+               USERLINK="-Wl,-z,relro ${LDFLAGS}"
+               CC="$(tc-getCC)"
+               USE_LIBCAP_NG=$(usetf caps)
+               USE_LIBCURL=$(usetf curl)
+               USE_LDAP=$(usetf ldap)
+               USE_XAUTH=true
+               USE_XAUTHPAM=$(usetf pam)
+               USE_LIBNSS=$(usetf nss)
+               HAVE_OPENSSL=$(usetf ssl)
+               USE_EXTRACRYPTO=$(usetf extra-algorithms)
+               USE_WEAKSTUFF=$(usetf weak-algorithms)
+       )
+
+       if use weak-algorithms && use nocrypto-algorithms ; then
+               make_options+=( USE_NOCRYPTO=true )
+       fi
+
+       make_options+=( USE_LWRES=false ) # needs bind9 with lwres support
+       if use curl || use ldap || use pam; then
+               make_options+=( HAVE_THREADS=true )
+       else
+               make_options+=( HAVE_THREADS=false )
+       fi
+}
+
+src_compile() {
+       local make_options; get_make_options
+       emake "${make_options[@]}" ${MYMAKE} || die
+}
+
+src_install() {
+       local make_options; get_make_options
+       emake "${make_options[@]}" install || die
+
+       dodoc docs/{KNOWN_BUGS*,RELEASE-NOTES*,PATENTS*,debugging*}
+       docinto quickstarts
+       dodoc docs/quickstarts/*
+
+       insinto /usr/share/doc/${PF}
+       doins -r contrib
+
+       newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
+
+       keepdir /var/run/pluto
+}
+
+pkg_preinst() {
+       if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
+               ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
+               local i err=0
+               if [ -h "../ipsec.d" ]; then
+                       rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
+               fi
+               for i in *; do
+                       if [ -e "../$i" ]; then
+                               eerror "  $i NOT MOVED, ../$i already exists!"
+                               err=1
+                       elif [ -d "$i" ]; then
+                               mv "$i" .. || die "failed to move $i directory"
+                               ewarn "  directory $i"
+                       elif [ -f "$i" ]; then
+                               sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
+                                       mv "$i" .. && ewarn "  file $i" || \
+                                       die "failed to move $i file"
+                       else
+                               eerror "  $i NOT MOVED, it is not a file nor a directory!"
+                               err=1
+                       fi
+               done
+               popd
+               if [ $err -eq 0 ]; then
+                       rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
+               else
+                       ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
+               fi
+       fi
+}
+
+pkg_postinst() {
+       if kernel_is -ge 2 6; then
+               CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
+               WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
+               WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
+               WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
+               check_extra_config
+       fi
+}