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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20