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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sat Jun 19 13:25:04 2004 UTC (15 years, 7 months ago) by pfeifer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump with security fixes. See ChangeLog for details.

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

  ViewVC Help
Powered by ViewVC 1.1.20