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

Contents of /net-misc/strongswan/strongswan-2.1.3-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Sat Sep 18 02:24:56 2004 UTC (15 years, 3 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bump.

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

  ViewVC Help
Powered by ViewVC 1.1.20