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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Oct 22 23:02:50 2007 UTC (12 years ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove obsolete versions.
(Portage version: 2.1.3.9)

1 # Copyright 1999-2007 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.8.ebuild,v 1.2 2007/06/14 18:52:33 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="smartcard extra-algorithms weak-algorithms"
15
16 COMMON_DEPEND="!net-misc/strongswan
17 >=dev-libs/gmp-4.2.1
18 smartcard? ( dev-libs/opensc )"
19 DEPEND="${COMMON_DEPEND}
20 virtual/linux-sources"
21 RDEPEND="${COMMON_DEPEND}
22 virtual/logger
23 sys-apps/iproute2"
24
25 pkg_setup() {
26 linux-info_pkg_setup
27
28 if kernel_is 2 6; then
29 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
30 einfo "KLIPS will not be compiled/installed."
31 MYMAKE="programs"
32
33 elif kernel_is 2 4; then
34 if ! [ -d /usr/src/linux/net/ipsec ]; then
35 eerror "You need to have an IPsec enabled 2.4.x kernel."
36 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
37 die
38 fi
39
40 einfo "Using patched-in IPsec code for kernel 2.4"
41 einfo "Your kernel only supports KLIPS for kernel level IPsec."
42 MYMAKE="confcheck programs"
43
44 else
45 die "Unsupported kernel version"
46 fi
47 }
48
49 src_unpack() {
50 unpack ${A}
51
52 cd "${S}"
53 epatch "${FILESDIR}"/${P}-gentoo.patch
54 epatch "${FILESDIR}"/${P}-type-punned.patch
55 epatch "${FILESDIR}"/${P}-smartcard-typo.patch
56 }
57
58 get_make_options() {
59 local MY_MAKE_OPTIONS="FINALCONFDIR=/etc/ipsec \
60 INC_RCDEFAULT=/etc/init.d \
61 INC_USRLOCAL=/usr \
62 INC_MANDIR=share/man \
63 FINALEXAMPLECONFDIR=/usr/share/doc/${P} \
64 FINALDOCDIR=/usr/share/doc/${P}"
65 if use smartcard ; then
66 MY_MAKE_OPTIONS="${MY_MAKE_OPTIONS} USE_SMARTCARD=true"
67 fi
68 if use extra-algorithms ; then
69 MY_MAKE_OPTIONS="${MY_MAKE_OPTIONS} USE_EXTRACRYPTO=true"
70 fi
71 if use weak-algorithms ; then
72 MY_MAKE_OPTIONS="${MY_MAKE_OPTIONS} USE_WEAKSTUFF=true"
73 fi
74 echo ${MY_MAKE_OPTIONS}
75 }
76
77 src_compile() {
78 make \
79 DESTDIR="${D}" \
80 USERCOMPILE="${CFLAGS}" \
81 $(get_make_options) \
82 ${MYMAKE} || die "make failed"
83 }
84
85 src_install() {
86 make \
87 DESTDIR="${D}" \
88 USERCOMPILE="${CFLAGS}" \
89 $(get_make_options) \
90 install || die "make install failed"
91
92 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
93
94 doinitd "${FILESDIR}"/ipsec
95
96 fperms -R a-X /etc/ipsec /usr/share
97 keepdir /var/run/pluto
98 }
99
100 pkg_postinst() {
101 if kernel_is 2 6; then
102 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
103 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
104 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
105 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
106 check_extra_config
107 fi
108 }

  ViewVC Help
Powered by ViewVC 1.1.20