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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Dec 27 15:24:03 2012 UTC (6 years, 8 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
pluto creates /var/run/pluto on startup, so don't call keepdir. Bug 448834 by flameeyes. Remove old.

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)

1 # Copyright 1999-2011 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.6.31.ebuild,v 1.2 2011/06/06 06:18:52 robbat2 Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info toolchain-funcs flag-o-matic
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="caps curl ldap pam ssl extra-algorithms weak-algorithms nocrypto-algorithms ms-bad-proposal nss"
17
18 COMMON_DEPEND="!net-misc/strongswan
19 dev-libs/gmp
20 dev-lang/perl
21 caps? ( sys-libs/libcap-ng )
22 curl? ( net-misc/curl )
23 ldap? ( net-nds/openldap )
24 nss? ( dev-libs/nss )
25 ssl? ( dev-libs/openssl )"
26 DEPEND="${COMMON_DEPEND}
27 virtual/linux-sources
28 app-text/xmlto
29 app-text/docbook-xml-dtd:4.1.2" # see bug 237132
30 RDEPEND="${COMMON_DEPEND}
31 virtual/logger
32 sys-apps/iproute2"
33
34 pkg_setup() {
35 if use nocrypto-algorithms && ! use weak-algorithms; then
36 ewarn "Enabling nocrypto-algorithms USE flag has no effect when"
37 ewarn "weak-algorithms USE flag is disabled"
38 fi
39
40 linux-info_pkg_setup
41
42 if kernel_is -ge 2 6; then
43 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
44 einfo "KLIPS will not be compiled/installed."
45 MYMAKE="programs"
46
47 elif kernel_is 2 4; then
48 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
49 eerror "You need to have an IPsec enabled 2.4.x kernel."
50 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
51 die
52 fi
53
54 einfo "Using patched-in IPsec code for kernel 2.4"
55 einfo "Your kernel only supports KLIPS for kernel level IPsec."
56 MYMAKE="confcheck programs"
57
58 else
59 die "Unsupported kernel version"
60 fi
61
62 # most code is OK, but programs/pluto code breaks strict aliasing
63 append-cflags -fno-strict-aliasing
64 }
65
66 src_prepare() {
67 epatch "${FILESDIR}"/${P}-gentoo.patch
68 use ms-bad-proposal && epatch "${FILESDIR}"/${PN}-${PV%.*}-allow-ms-bad-proposal.patch
69
70 find . -type f -regex '.*[.]\([1-8]\|html\|xml\)' -exec sed -i \
71 -e s:/usr/local:/usr:g '{}' \; ||
72 die "failed to replace text in docs"
73 }
74
75 get_make_options() {
76 echo KERNELSRC=\"${KERNEL_DIR}\"\
77 FINALEXAMPLECONFDIR=/usr/share/doc/${PF}\
78 INC_RCDEFAULT=/etc/init.d\
79 INC_USRLOCAL=/usr\
80 INC_MANDIR=share/man\
81 FINALDOCDIR=/usr/share/doc/${PF}/html\
82 FINALLIBDIR=/usr/$(get_libdir)/ipsec\
83 DESTDIR=\"${D}\"\
84 USERCOMPILE=\"${CFLAGS}\"\
85 CC=\"$(tc-getCC)\"
86
87 use caps\
88 && echo USE_LIBCAP_NG=true\
89 || echo USE_LIBCAP_NG=false
90
91 use curl\
92 && echo USE_LIBCURL=true\
93 || echo USE_LIBCURL=false
94
95 use ldap\
96 && echo USE_LDAP=true\
97 || echo USE_LDAP=false
98
99 echo USE_XAUTH=true
100 use pam\
101 && echo USE_XAUTHPAM=true\
102 || echo USE_XAUTHPAM=false
103
104 use nss\
105 && echo USE_LIBNSS=true\
106 || echo USE_LIBNSS=false
107
108 use ssl\
109 && echo HAVE_OPENSSL=true\
110 || echo HAVE_OPENSSL=false
111
112 use extra-algorithms\
113 && echo USE_EXTRACRYPTO=true\
114 || echo USE_EXTRACRYPTO=false
115 if use weak-algorithms ; then
116 echo USE_WEAKSTUFF=true
117 if use nocrypto-algorithms; then
118 echo USE_NOCRYPTO=true
119 fi
120 else
121 echo USE_WEAKSTUFF=false
122 fi
123
124 echo USE_LWRES=false # needs bind9 with lwres support
125 if use curl || use ldap || use pam; then
126 echo HAVE_THREADS=true
127 else
128 echo HAVE_THREADS=false
129 fi
130 }
131
132 src_compile() {
133 eval set -- $(get_make_options)
134 emake "$@" ${MYMAKE} || die "emake failed"
135 }
136
137 src_install() {
138 eval set -- $(get_make_options)
139 emake "$@" install || die "emake install failed"
140
141 dodoc docs/{KNOWN_BUGS*,RELEASE-NOTES*,PATENTS*,debugging*}
142 dohtml doc/*.html
143 docinto quickstarts
144 dodoc doc/quickstarts/*
145
146 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
147
148 keepdir /var/run/pluto
149 }
150
151 pkg_preinst() {
152 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
153 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
154 local i err=0
155 if [ -h "../ipsec.d" ]; then
156 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
157 fi
158 for i in *; do
159 if [ -e "../$i" ]; then
160 eerror " $i NOT MOVED, ../$i already exists!"
161 err=1
162 elif [ -d "$i" ]; then
163 mv "$i" .. || die "failed to move $i directory"
164 ewarn " directory $i"
165 elif [ -f "$i" ]; then
166 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
167 mv "$i" .. && ewarn " file $i" || \
168 die "failed to move $i file"
169 else
170 eerror " $i NOT MOVED, it is not a file nor a directory!"
171 err=1
172 fi
173 done
174 popd
175 if [ $err -eq 0 ]; then
176 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
177 else
178 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
179 fi
180 fi
181 }
182
183 pkg_postinst() {
184 if kernel_is -ge 2 6; then
185 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
186 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
187 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
188 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
189 check_extra_config
190 fi
191 }

  ViewVC Help
Powered by ViewVC 1.1.20