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

Contents of /net-misc/openswan/openswan-2.4.15-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Aug 15 20:45:47 2010 UTC (9 years, 2 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Mark version 2.4.15-r2 as stable on amd64 and x86. Version bump (#301813).
(Portage version: 2.1.8.3/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.15-r1.ebuild,v 1.1 2009/09/11 18:46:36 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 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 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 if use smartcard ; then
80 echo USE_SMARTCARD=true
81 fi
82 if use extra-algorithms ; then
83 echo USE_EXTRACRYPTO=true
84 fi
85 if use weak-algorithms ; then
86 echo USE_WEAKSTUFF=true
87 fi
88 echo USE_OE=false # by default, turn off Opportunistic Encryption
89 echo USE_LWRES=false # needs bind9 with lwres support
90 local USETHREADS=false
91 if use curl; then
92 echo USE_LIBCURL=true
93 USETHREADS=true
94 fi
95 if use ldap; then
96 echo USE_LDAP=true
97 USETHREADS=true
98 fi
99 echo HAVE_THREADS=${USETHREADS}
100 }
101
102 src_compile() {
103 eval set -- $(get_make_options)
104 emake "$@" \
105 ${MYMAKE} || die "emake failed"
106 }
107
108 src_install() {
109 eval set -- $(get_make_options)
110 emake "$@" \
111 install || die "emake install failed"
112
113 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
114
115 doinitd "${FILESDIR}"/ipsec || die "failed to install init script"
116
117 dodir /var/run/pluto || die "failed to create /var/run/pluto"
118 }
119
120 pkg_postinst() {
121 if kernel_is 2 6; then
122 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
123 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
124 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
125 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
126 check_extra_config
127 fi
128 }

  ViewVC Help
Powered by ViewVC 1.1.20