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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Feb 20 17:47:13 2005 UTC (14 years, 9 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Add version 2.3.2(mode config and nat-t seg fault fixes). Remove 2.3.1 due to bug fixes placed into 2.3.2. Remove older versions.
(Portage version: 2.0.51-r15)

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

  ViewVC Help
Powered by ViewVC 1.1.20