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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Dec 3 23:30:28 2008 UTC (10 years, 10 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove obsolete versions.
Correct doc install path (#241976).
Version bump.
(Portage version: 2.1.4.4, RepoMan options: --force)

1 # Copyright 1999-2008 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.13-r1.ebuild,v 1.1 2008/10/12 16:39:13 mrness Exp $
4
5 inherit eutils linux-info
6
7 DESCRIPTION="Open Source implementation of IPsec for the Linux operating system (was SuperFreeS/WAN)."
8 HOMEPAGE="http://www.openswan.org/"
9 SRC_URI="http://www.openswan.org/download/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="amd64 ~ppc ~sparc x86"
14 IUSE="curl ldap smartcard extra-algorithms weak-algorithms"
15
16 COMMON_DEPEND="!net-misc/strongswan
17 dev-libs/gmp
18 dev-lang/perl
19 smartcard? ( dev-libs/opensc )
20 curl? ( net-misc/curl )
21 ldap? ( net-nds/openldap )"
22 DEPEND="${COMMON_DEPEND}
23 virtual/linux-sources"
24 RDEPEND="${COMMON_DEPEND}
25 virtual/logger
26 sys-apps/iproute2"
27
28 pkg_setup() {
29 linux-info_pkg_setup
30
31 if kernel_is 2 6; then
32 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
33 einfo "KLIPS will not be compiled/installed."
34 MYMAKE="programs"
35
36 elif kernel_is 2 4; then
37 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
38 eerror "You need to have an IPsec enabled 2.4.x kernel."
39 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
40 die
41 fi
42
43 einfo "Using patched-in IPsec code for kernel 2.4"
44 einfo "Your kernel only supports KLIPS for kernel level IPsec."
45 MYMAKE="confcheck programs"
46
47 else
48 die "Unsupported kernel version"
49 fi
50 }
51
52 src_unpack() {
53 unpack ${A}
54
55 cd "${S}"
56 epatch "${FILESDIR}"/${P}-gentoo-fixed.patch
57 epatch "${FILESDIR}"/${P}-deprecated-ldap.patch
58
59 find . -regex '.*[.][1-8]' -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[.]secrets:/etc/ipsec/ipsec.secrets:g '{}' \; ||
63 die "failed to replace text in xml docs"
64 }
65
66 get_make_options() {
67 echo KERNELSRC=\"${KERNEL_DIR}\" \
68 FINALCONFDIR=/etc/ipsec \
69 FINALCONFFILE=/etc/ipsec/ipsec.conf \
70 FINALEXAMPLECONFDIR=/usr/share/doc/${P} \
71 INC_RCDEFAULT=/etc/init.d \
72 INC_USRLOCAL=/usr \
73 INC_MANDIR=share/man \
74 FINALDOCDIR=/usr/share/doc/${P} \
75 DESTDIR=\"${D}\" \
76 USERCOMPILE=\"${CFLAGS}\"
77 if use smartcard ; then
78 echo USE_SMARTCARD=true
79 fi
80 if use extra-algorithms ; then
81 echo USE_EXTRACRYPTO=true
82 fi
83 if use weak-algorithms ; then
84 echo USE_WEAKSTUFF=true
85 fi
86 echo USE_OE=false # by default, turn off Opportunistic Encryption
87 echo USE_LWRES=false # needs bind9 with lwres support
88 local USETHREADS=false
89 if use curl; then
90 echo USE_LIBCURL=true
91 USETHREADS=true
92 fi
93 if use ldap; then
94 echo USE_LDAP=true
95 USETHREADS=true
96 fi
97 echo HAVE_THREADS=${USETHREADS}
98 }
99
100 src_compile() {
101 eval set -- $(get_make_options)
102 emake "$@" \
103 ${MYMAKE} || die "emake failed"
104 }
105
106 src_install() {
107 eval set -- $(get_make_options)
108 emake "$@" \
109 install || die "emake install failed"
110
111 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
112
113 doinitd "${FILESDIR}"/ipsec || die "failed to install init script"
114
115 dodir /var/run/pluto || die "failed to create /var/run/pluto"
116 }
117
118 pkg_postinst() {
119 if kernel_is 2 6; then
120 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
121 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
122 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
123 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
124 check_extra_config
125 fi
126 }

  ViewVC Help
Powered by ViewVC 1.1.20