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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Nov 7 21:56:58 2011 UTC (7 years, 11 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump (#368903); install cotrib files (#350083); use LDFLAGS (#351019).

(Portage version: 2.1.10.11/cvs/Linux x86_64)

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.29.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 DESTDIR=\"${D}\"\
83 USERCOMPILE=\"${CFLAGS}\"\
84 CC=\"$(tc-getCC)\"
85
86 use caps\
87 && echo USE_LIBCAP_NG=true\
88 || echo USE_LIBCAP_NG=false
89
90 use curl\
91 && echo USE_LIBCURL=true\
92 || echo USE_LIBCURL=false
93
94 use ldap\
95 && echo USE_LDAP=true\
96 || echo USE_LDAP=false
97
98 echo USE_XAUTH=true
99 use pam\
100 && echo USE_XAUTHPAM=true\
101 || echo USE_XAUTHPAM=false
102
103 use nss\
104 && echo USE_LIBNSS=true\
105 || echo USE_LIBNSS=false
106
107 use ssl\
108 && echo HAVE_OPENSSL=true\
109 || echo HAVE_OPENSSL=false
110
111 use extra-algorithms\
112 && echo USE_EXTRACRYPTO=true\
113 || echo USE_EXTRACRYPTO=false
114 if use weak-algorithms ; then
115 echo USE_WEAKSTUFF=true
116 if use nocrypto-algorithms; then
117 echo USE_NOCRYPTO=true
118 fi
119 else
120 echo USE_WEAKSTUFF=false
121 fi
122
123 echo USE_LWRES=false # needs bind9 with lwres support
124 if use curl || use ldap || use pam; then
125 echo HAVE_THREADS=true
126 else
127 echo HAVE_THREADS=false
128 fi
129 }
130
131 src_compile() {
132 eval set -- $(get_make_options)
133 emake "$@" ${MYMAKE} || die "emake failed"
134 }
135
136 src_install() {
137 eval set -- $(get_make_options)
138 emake "$@" install || die "emake install failed"
139
140 dodoc docs/{KNOWN_BUGS*,RELEASE-NOTES*,PATENTS*,debugging*}
141 dohtml doc/*.html
142 docinto quickstarts
143 dodoc doc/quickstarts/*
144
145 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
146
147 keepdir /var/run/pluto
148 }
149
150 pkg_preinst() {
151 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
152 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
153 local i err=0
154 if [ -h "../ipsec.d" ]; then
155 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
156 fi
157 for i in *; do
158 if [ -e "../$i" ]; then
159 eerror " $i NOT MOVED, ../$i already exists!"
160 err=1
161 elif [ -d "$i" ]; then
162 mv "$i" .. || die "failed to move $i directory"
163 ewarn " directory $i"
164 elif [ -f "$i" ]; then
165 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
166 mv "$i" .. && ewarn " file $i" || \
167 die "failed to move $i file"
168 else
169 eerror " $i NOT MOVED, it is not a file nor a directory!"
170 err=1
171 fi
172 done
173 popd
174 if [ $err -eq 0 ]; then
175 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
176 else
177 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
178 fi
179 fi
180 }
181
182 pkg_postinst() {
183 if kernel_is -ge 2 6; then
184 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
185 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
186 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
187 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
188 check_extra_config
189 fi
190 }

  ViewVC Help
Powered by ViewVC 1.1.20