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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Feb 28 16:11:34 2007 UTC (12 years, 9 months ago) by pylon
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Clean out old versions.  Resolve bug #163983 with using emake instead of make.
(Portage version: 2.1.2-r12)

1 # Copyright 1999-2006 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.6.2.ebuild,v 1.2 2006/02/16 17:07:06 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.bz2
10 mirror://gentoo/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="-* ~amd64 ~ppc ~sparc ~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-dns/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 or kernel tree has not been configured!"
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}-gentoo.patch
99
100 if use curl ; then
101 ebegin "Curl support requested. Enabling curl support"
102 sed -i -e 's:USE_LIBCURL?=false:USE_LIBCURL?=true:g' Makefile.inc || die
103 eend $?
104 fi
105
106 if use ldap ; then
107 ebegin "LDAP support requested. Enabling LDAPv3 support"
108 sed -i -e 's:USE_LDAP?=false:USE_LDAP?=true:g' Makefile.inc || die
109 eend $?
110 fi
111
112 if use smartcard ; then
113 ebegin "Smartcard support requested. Enabling opensc support"
114 sed -i -e 's:USE_SMARTCARD?=false:USE_SMARTCARD?=true:g' Makefile.inc || die
115 eend $?
116 fi
117 }
118
119 src_compile() {
120 make \
121 DESTDIR=${D} \
122 USERCOMPILE="${CFLAGS}" \
123 FINALCONFDIR=/etc/ipsec \
124 INC_RCDEFAULT=/etc/init.d \
125 INC_USRLOCAL=/usr \
126 INC_MANDIR=share/man \
127 ${MYMAKE} || die
128 }
129
130 src_install() {
131 make \
132 DESTDIR=${D} \
133 USERCOMPILE="${CFLAGS}" \
134 FINALCONFDIR=/etc/ipsec \
135 INC_RCDEFAULT=/etc/init.d \
136 INC_USRLOCAL=/usr \
137 INC_MANDIR=share/man \
138 install || die
139
140 dohtml doc/*.html
141 rm -f ${S}/doc/*.html
142 dodoc CHANGES* CREDITS INSTALL LICENSE README* doc/*
143 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
144
145 exeinto /etc/init.d/
146 doexe ${FILESDIR}/ipsec
147 }

  ViewVC Help
Powered by ViewVC 1.1.20