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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed May 19 13:32:09 2004 UTC (15 years, 5 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
New openswan release with a number of fixes.

1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/net-misc/openswan/openswan-2.0.0.ebuild,v 1.3 2004/04/27 21:45:34 agriffis 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 SRC_URI="http://www.openswan.org/code/${MY_P}.tar.gz
11 mirror://gentoo/${MY_P}.tar.gz"
12 HOMEPAGE="http://www.openswan.org/"
13
14 DEPEND="virtual/glibc
15 virtual/linux-sources
16 >=dev-libs/gmp-3.1.1
17 net-misc/host
18 sys-apps/iproute2"
19 RDEPEND=""
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="~x86 -*"
23
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 }
97
98 src_compile() {
99
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
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 dodoc INSTALL COPYING CREDITS BUGS CHANGES README doc/*
122 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
123
124 exeinto /etc/init.d/
125 doexe ${FILESDIR}/ipsec
126
127 }

  ViewVC Help
Powered by ViewVC 1.1.20