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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat Jun 19 13:39:12 2004 UTC (15 years, 4 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Version bump with security fixes. See ChangeLog for details.

1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/openswan-2.1.1.ebuild,v 1.5 2004/06/15 05:36:44 kugelfang 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/code/${MY_P}.tar.gz
12 mirror://gentoo/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="-* ~x86 amd64"
17 IUSE=""
18
19 DEPEND="virtual/glibc
20 virtual/linux-sources
21 >=dev-libs/gmp-3.1.1
22 net-misc/host
23 sys-apps/iproute2"
24 RDEPEND=""
25
26 check_version_h() {
27 if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ]
28 then
29 eerror "Please verify that your /usr/src/linux symlink is pointing"
30 eerror "to your current kernel sources, and that you have a running kernel"
31 die "/usr/src/linux symlink not setup!"
32 fi
33 }
34
35 get_KV_info() {
36 check_version_h
37
38 # Get the kernel version of sources in /usr/src/linux ...
39 export KV_full="$(awk '/UTS_RELEASE/ { gsub("\"", "", $3); print $3 }' \
40 "${ROOT}/usr/src/linux/include/linux/version.h")"
41 export KV_major="$(echo "${KV_full}" | cut -d. -f1)"
42 export KV_minor="$(echo "${KV_full}" | cut -d. -f2)"
43 export KV_micro="$(echo "${KV_full}" | cut -d. -f3 | sed -e 's:[^0-9].*::')"
44 }
45
46 is_kernel() {
47 [ -z "$1" -o -z "$2" ] && return 1
48
49 get_KV_info
50
51 if [ "${KV_major}" -eq "$1" -a "${KV_minor}" -eq "$2" ]
52 then
53 return 0
54 else
55 return 1
56 fi
57 }
58
59 pkg_setup() {
60 get_KV_info
61
62 einfo "Linux kernel is version ${KV_major}.${KV_minor}.${KV_micro}"
63
64 if is_kernel 2 5
65 then
66 eerror "Kernel version ${KV_major}.${KV_minor}.${KV_micro} will not work with this ebuild."
67 die "Please install a 2.6.x version of the Linux kernel."
68 fi
69
70 if is_kernel 2 6
71 then
72 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
73 einfo "KLIPS will not be compiled/installed."
74 export MYMAKE="programs"
75
76 elif is_kernel 2 4
77 then
78 [ -d /usr/src/linux/net/ipsec ] || {
79 eerror "You need to have an IPsec enabled 2.4.x kernel."
80 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
81 }
82 einfo "Using patched-in IPsec code for kernel 2.4"
83 einfo "Your kernel only supports KLIPS for kernel level IPsec."
84 export MYMAKE="confcheck programs"
85
86 else
87 eerror "Sorry, no support for your kernel version ${KV_major}.${KV_minor}.${KV_micro}."
88 die "Install an IPsec enabled 2.4 or 2.6 kernel."
89 fi
90 }
91
92 src_unpack() {
93 unpack ${A}
94
95 cd ${S}
96 epatch ${FILESDIR}/${P}-gentoo.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