/[gentoo-x86]/net-misc/openswan/openswan-2.4.3.ebuild
Gentoo

Contents of /net-misc/openswan/openswan-2.4.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Nov 28 07:50:03 2005 UTC (13 years, 10 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump.
(Portage version: 2.0.53_rc7)

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/openswan/openswan-2.4.3.ebuild,v 1.1 2005/11/15 04:12:35 pfeifer Exp $
4
5 inherit eutils
6
7 MY_P=${P/_p/_kb}
8 S=${WORKDIR}/${MY_P}
9 DESCRIPTION="Open Source implementation of IPsec for the Linux operating system (was SuperFreeS/WAN)."
10 HOMEPAGE="http://www.openswan.org/"
11 SRC_URI="http://www.openswan.org/download/${MY_P}.tar.gz
12 mirror://gentoo/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="-* ~x86 ~amd64 ~ppc"
17 IUSE=""
18
19 DEPEND="!net-misc/strongswan
20 virtual/libc
21 virtual/linux-sources
22 >=dev-libs/gmp-3.1.1
23 net-dns/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 or kernel tree has not been configured!"
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
100 src_compile() {
101 make \
102 DESTDIR=${D} \
103 USERCOMPILE="${CFLAGS}" \
104 FINALCONFDIR=/etc/ipsec \
105 INC_RCDEFAULT=/etc/init.d \
106 INC_USRLOCAL=/usr \
107 INC_MANDIR=share/man \
108 ${MYMAKE} || die
109 }
110
111 src_install() {
112 make \
113 DESTDIR=${D} \
114 USERCOMPILE="${CFLAGS}" \
115 FINALCONFDIR=/etc/ipsec \
116 INC_RCDEFAULT=/etc/init.d \
117 INC_USRLOCAL=/usr \
118 INC_MANDIR=share/man \
119 install || die
120
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