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

Contents of /net-misc/openswan/openswan-2.4.15-r2.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.4.15-r2.ebuild,v 1.3 2011/06/06 06:18:52 robbat2 Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info toolchain-funcs
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 ms-bad-proposal"
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 -ge 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.patch
56 epatch "${FILESDIR}"/${P}-deprecated-ldap.patch
57 use ms-bad-proposal && epatch "${FILESDIR}"/${PN}-${PV%.*}-allow-ms-bad-proposal.patch
58
59 find . -type f -regex '.*[.]\([1-8]\|html\|xml\)' -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[.]conf:/etc/ipsec/ipsec.conf:g' \
63 -e 's:/etc/ipsec[\][&][.]secrets:/etc/ipsec/ipsec\\\&.secrets:g' \
64 -e 's:/etc/ipsec[.]secrets:/etc/ipsec/ipsec.secrets:g' '{}' \; ||
65 die "failed to replace text in docs"
66 }
67
68 get_make_options() {
69 echo KERNELSRC=\"${KERNEL_DIR}\" \
70 FINALCONFDIR=/etc/ipsec \
71 FINALCONFFILE=/etc/ipsec/ipsec.conf \
72 FINALEXAMPLECONFDIR=/usr/share/doc/${PF} \
73 INC_RCDEFAULT=/etc/init.d \
74 INC_USRLOCAL=/usr \
75 INC_MANDIR=share/man \
76 FINALDOCDIR=/usr/share/doc/${PF} \
77 DESTDIR=\"${D}\" \
78 USERCOMPILE=\"${CFLAGS}\" \
79 CC=\"$(tc-getCC)\"
80 if use smartcard ; then
81 echo USE_SMARTCARD=true
82 fi
83 if use extra-algorithms ; then
84 echo USE_EXTRACRYPTO=true
85 fi
86 if use weak-algorithms ; then
87 echo USE_WEAKSTUFF=true
88 fi
89 echo USE_OE=false # by default, turn off Opportunistic Encryption
90 echo USE_LWRES=false # needs bind9 with lwres support
91 local USETHREADS=false
92 if use curl; then
93 echo USE_LIBCURL=true
94 USETHREADS=true
95 fi
96 if use ldap; then
97 echo USE_LDAP=true
98 USETHREADS=true
99 fi
100 echo HAVE_THREADS=${USETHREADS}
101 }
102
103 src_compile() {
104 eval set -- $(get_make_options)
105 emake "$@" \
106 ${MYMAKE} || die "emake failed"
107 }
108
109 src_install() {
110 eval set -- $(get_make_options)
111 emake "$@" \
112 install || die "emake install failed"
113
114 dodoc docs/{KNOWN_BUGS,RELEASE-NOTES*,debugging*}
115 dodoc doc/*.html
116 docinto quickstarts
117 dodoc doc/quickstarts/*
118
119 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
120
121 doinitd "${FILESDIR}"/ipsec || die "failed to install init script"
122
123 dodir /var/run/pluto || die "failed to create /var/run/pluto"
124 }
125
126 pkg_postinst() {
127 if kernel_is -ge 2 6; then
128 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
129 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
130 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
131 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
132 check_extra_config
133 fi
134 }

  ViewVC Help
Powered by ViewVC 1.1.20