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/strongswan/strongswan-4.1.9.ebuild,v 1.1 2007/12/16 14:32:49 pylon Exp $ |
4 |
|
5 |
inherit eutils linux-info |
6 |
|
7 |
UGID="ipsec" |
8 |
|
9 |
DESCRIPTION="Open Source implementation of IPsec for the Linux operating system." |
10 |
HOMEPAGE="http://www.strongswan.org/" |
11 |
SRC_URI="http://download.strongswan.org/${P}.tar.bz2" |
12 |
|
13 |
LICENSE="GPL-2 RSA-MD2 RSA-MD5 RSA-PKCS11 DES" |
14 |
SLOT="0" |
15 |
KEYWORDS="~ppc ~x86" |
16 |
IUSE="cisco curl debug ldap nat smartcard static xml" |
17 |
|
18 |
COMMON_DEPEND="!net-misc/openswan |
19 |
dev-libs/gmp" |
20 |
DEPEND="${COMMON_DEPEND} |
21 |
virtual/linux-sources |
22 |
sys-kernel/linux-headers |
23 |
curl? ( net-misc/curl ) |
24 |
ldap? ( net-nds/openldap ) |
25 |
smartcard? ( dev-libs/opensc ) |
26 |
xml? ( dev-libs/libxml2 )" |
27 |
RDEPEND="${COMMON_DEPEND} |
28 |
virtual/logger |
29 |
sys-apps/iproute2" |
30 |
|
31 |
src_unpack() { |
32 |
unpack ${A} |
33 |
cd "${S}" |
34 |
|
35 |
epatch "${FILESDIR}"/ipsec-install-${PV}.patch |
36 |
} |
37 |
|
38 |
pkg_setup() { |
39 |
linux-info_pkg_setup |
40 |
|
41 |
einfo "Linux kernel is version ${KV_FULL}" |
42 |
|
43 |
if kernel_is 2 6; then |
44 |
einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)." |
45 |
else |
46 |
eerror "Sorry, no support for your kernel version ${KV_FULL}." |
47 |
die "Install an IPsec enabled 2.6 kernel." |
48 |
fi |
49 |
|
50 |
# change to an unprivileged user by default |
51 |
enewgroup ${UGID} |
52 |
enewuser ${UGID} -1 -1 -1 ${UGID} |
53 |
} |
54 |
|
55 |
src_compile() { |
56 |
local myconf="" |
57 |
|
58 |
# change to an unprivileged user by default |
59 |
myconf="${myconf} --with-uid=$(id -u ${UGID}) --with-gid=$(id -g ${UGID})" |
60 |
# strongswan enables both by default; switch to the user's wish |
61 |
if use static; then |
62 |
myconf="${myconf} --enable-static --disable-shared" |
63 |
else |
64 |
myconf="${myconf} --disable-static --enable-shared" |
65 |
fi |
66 |
|
67 |
econf \ |
68 |
$(use_enable curl http) \ |
69 |
$(use_enable ldap) \ |
70 |
$(use_enable xml) \ |
71 |
$(use_enable smartcard) \ |
72 |
$(use_enable cisco cisco-quirks) \ |
73 |
$(use_enable debug leak-detective) \ |
74 |
$(use_enable nat nat-transport) \ |
75 |
${myconf} \ |
76 |
|| die "econf failed" |
77 |
|
78 |
emake || die "emake failed" |
79 |
} |
80 |
|
81 |
src_install() { |
82 |
einstall || die "einstall failed." |
83 |
|
84 |
doinitd "${FILESDIR}"/ipsec |
85 |
} |
86 |
|
87 |
pkg_postinst() { |
88 |
echo |
89 |
ewarn "Starting with the strongswan-4 branch, the configuration files" |
90 |
ewarn "will be installed into the default directory \"/etc/\"" |
91 |
ewarn "instead of the Gentoo-specific directory \"/etc/ipsec/\"." |
92 |
ewarn "Please adjust your configuration!" |
93 |
echo |
94 |
einfo "The up-to-date configuration manual is available online at" |
95 |
einfo "http://www.strongswan.org/docs/readme.htm" |
96 |
echo |
97 |
} |