/[gentoo-x86]/net-misc/openswan/openswan-2.4.14.ebuild
Gentoo

Contents of /net-misc/openswan/openswan-2.4.14.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Aug 30 07:35:29 2009 UTC (10 years, 1 month ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Expunge exploitable versions from the tree (#275233).
(Portage version: 2.1.6.13/cvs/Linux x86_64)

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/openswan-2.4.14.ebuild,v 1.4 2009/06/14 10:25:30 mrness Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info
8
9 DESCRIPTION="Open Source implementation of IPsec for the Linux operating system (was SuperFreeS/WAN)."
10 HOMEPAGE="http://www.openswan.org/"
11 SRC_URI="http://www.openswan.org/download/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 ~ppc ~sparc x86"
16 IUSE="curl ldap smartcard extra-algorithms weak-algorithms"
17
18 COMMON_DEPEND="!net-misc/strongswan
19 dev-libs/gmp
20 dev-lang/perl
21 smartcard? ( dev-libs/opensc )
22 curl? ( net-misc/curl )
23 ldap? ( net-nds/openldap )"
24 DEPEND="${COMMON_DEPEND}
25 virtual/linux-sources"
26 RDEPEND="${COMMON_DEPEND}
27 virtual/logger
28 sys-apps/iproute2"
29
30 pkg_setup() {
31 linux-info_pkg_setup
32
33 if kernel_is 2 6; then
34 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
35 einfo "KLIPS will not be compiled/installed."
36 MYMAKE="programs"
37
38 elif kernel_is 2 4; then
39 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
40 eerror "You need to have an IPsec enabled 2.4.x kernel."
41 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
42 die
43 fi
44
45 einfo "Using patched-in IPsec code for kernel 2.4"
46 einfo "Your kernel only supports KLIPS for kernel level IPsec."
47 MYMAKE="confcheck programs"
48
49 else
50 die "Unsupported kernel version"
51 fi
52 }
53
54 src_prepare() {
55 epatch "${FILESDIR}"/${P}-gentoo-fixed.patch
56 epatch "${FILESDIR}"/${P}-deprecated-ldap.patch
57 epatch "${FILESDIR}"/${P}-getline.patch
58
59 find . -regex '.*[.][1-8]' -exec sed -i \
60 -e s:/usr/local:/usr:g \
61 -e s:/etc/ipsec[.]conf:/etc/ipsec/ipsec.conf:g \
62 -e s:/etc/ipsec[.]secrets:/etc/ipsec/ipsec.secrets:g '{}' \; ||
63 die "failed to replace text in xml docs"
64 }
65
66 get_make_options() {
67 echo KERNELSRC=\"${KERNEL_DIR}\" \
68 FINALCONFDIR=/etc/ipsec \
69 FINALCONFFILE=/etc/ipsec/ipsec.conf \
70 FINALEXAMPLECONFDIR=/usr/share/doc/${PF} \
71 INC_RCDEFAULT=/etc/init.d \
72 INC_USRLOCAL=/usr \
73 INC_MANDIR=share/man \
74 FINALDOCDIR=/usr/share/doc/${PF} \
75 DESTDIR=\"${D}\" \
76 USERCOMPILE=\"${CFLAGS}\"
77 if use smartcard ; then
78 echo USE_SMARTCARD=true
79 fi
80 if use extra-algorithms ; then
81 echo USE_EXTRACRYPTO=true
82 fi
83 if use weak-algorithms ; then
84 echo USE_WEAKSTUFF=true
85 fi
86 echo USE_OE=false # by default, turn off Opportunistic Encryption
87 echo USE_LWRES=false # needs bind9 with lwres support
88 local USETHREADS=false
89 if use curl; then
90 echo USE_LIBCURL=true
91 USETHREADS=true
92 fi
93 if use ldap; then
94 echo USE_LDAP=true
95 USETHREADS=true
96 fi
97 echo HAVE_THREADS=${USETHREADS}
98 }
99
100 src_compile() {
101 eval set -- $(get_make_options)
102 emake "$@" \
103 ${MYMAKE} || die "emake failed"
104 }
105
106 src_install() {
107 eval set -- $(get_make_options)
108 emake "$@" \
109 install || die "emake install failed"
110
111 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
112
113 doinitd "${FILESDIR}"/ipsec || die "failed to install init script"
114
115 dodir /var/run/pluto || die "failed to create /var/run/pluto"
116 }
117
118 pkg_postinst() {
119 if kernel_is 2 6; then
120 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
121 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
122 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
123 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
124 check_extra_config
125 fi
126 }

  ViewVC Help
Powered by ViewVC 1.1.20