/[gentoo-x86]/net-misc/strongswan/strongswan-2.2.0.ebuild
Gentoo

Contents of /net-misc/strongswan/strongswan-2.2.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Aug 31 18:15:42 2004 UTC (15 years, 5 months ago) by pfeifer
Branch: MAIN
Version bump with DPD support!

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils
6
7 DESCRIPTION="Open Source implementation of IPsec for the Linux operating system."
8 HOMEPAGE="http://www.strongswan.org/"
9 SRC_URI="http://download.strongswan.org/${P}.tar.gz
10 mirror://gentoo/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="-* ~x86 ~ppc"
15 IUSE="curl ldap smartcard"
16
17 DEPEND="virtual/libc
18 virtual/linux-sources
19 curl? ( net-misc/curl )
20 ldap? ( =net-nds/openldap-2* )
21 smartcard? ( dev-libs/opensc )
22 >=dev-libs/gmp-3.1.1
23 net-misc/host
24 sys-apps/iproute2"
25 RDEPEND=""
26
27 check_version_h() {
28 if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
29 then
30 eerror "Please verify that your /usr/src/linux symlink is pointing"
31 eerror "to your current kernel sources, and that you have a running kernel"
32 die "/usr/src/linux symlink not setup!"
33 fi
34 }
35
36 get_KV_info() {
37 check_version_h
38
39 # Get the kernel version of sources in /usr/src/linux ...
40 export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
41 "${ROOT}/usr/src/linux/include/linux/version.h")"
42 export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
43 export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
44 export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
45 }
46
47 is_kernel() {
48 [ -z "$1" -o -z "$2" ] && return 1
49
50 get_KV_info
51
52 if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
53 then
54 return 0
55 else
56 return 1
57 fi
58 }
59
60 pkg_setup() {
61 get_KV_info
62
63 einfo "Linux kernel is version ${KV_major}.${KV_minor}.${KV_micro}"
64
65 if is_kernel 2 5
66 then
67 eerror "Kernel version ${KV_major}.${KV_minor}.${KV_micro} will not work with this ebuild."
68 die "Please install a 2.6.x version of the Linux kernel."
69 fi
70
71 if is_kernel 2 6
72 then
73 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
74 einfo "KLIPS will not be compiled/installed."
75 export MYMAKE="programs"
76
77 elif is_kernel 2 4
78 then
79 [ -d /usr/src/linux/net/ipsec ] || {
80 eerror "You need to have an IPsec enabled 2.4.x kernel."
81 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
82 }
83 einfo "Using patched-in IPsec code for kernel 2.4"
84 einfo "Your kernel only supports KLIPS for kernel level IPsec."
85 export MYMAKE="confcheck programs"
86
87 else
88 eerror "Sorry, no support for your kernel version ${KV_major}.${KV_minor}.${KV_micro}."
89 die "Install an IPsec enabled 2.4 or 2.6 kernel."
90 fi
91 }
92
93 src_unpack() {
94 unpack ${A}
95
96 cd ${S}
97 epatch ${FILESDIR}/${P}-gentoo.patch
98
99 cd programs/pluto
100
101 if use curl ; then
102 ebegin "Curl support requested. Enabling curl support"
103 sed -i -e 's:#LIBCURL=1:LIBCURL=1:g' Makefile || die
104 eend $?
105 fi
106
107 if use ldap ; then
108 ebegin "LDAP support requested. Enabling LDAPv3 support"
109 sed -i -e 's:#LDAP_VERSION=3:LDAP_VERSION=3:g' Makefile || die
110 eend $?
111 fi
112
113 if use smartcard ; then
114 ebegin "Smartcard support requested. Enabling opensc support"
115 sed -i -e 's:#SMARTCARD=1:SMARTCARD=1:g' Makefile || die
116 eend $?
117 fi
118 }
119
120 src_compile() {
121 make \
122 DESTDIR=${D} \
123 USERCOMPILE="${CFLAGS}" \
124 FINALCONFDIR=/etc/ipsec \
125 INC_RCDEFAULT=/etc/init.d \
126 INC_USRLOCAL=/usr \
127 INC_MANDIR=share/man \
128 ${MYMAKE} || die
129 }
130
131 src_install() {
132 make \
133 DESTDIR=${D} \
134 USERCOMPILE="${CFLAGS}" \
135 FINALCONFDIR=/etc/ipsec \
136 INC_RCDEFAULT=/etc/init.d \
137 INC_USRLOCAL=/usr \
138 INC_MANDIR=share/man \
139 install || die
140
141 dodoc CHANGES* CREDITS INSTALL LICENSE README* doc/*
142 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
143
144 exeinto /etc/init.d/
145 doexe ${FILESDIR}/ipsec
146 }

  ViewVC Help
Powered by ViewVC 1.1.20