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

Contents of /net-misc/openswan/openswan-2.6.23-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Aug 15 20:45:47 2010 UTC (9 years, 2 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Mark version 2.4.15-r2 as stable on amd64 and x86. Version bump (#301813).
(Portage version: 2.1.8.3/cvs/Linux x86_64)

1 # Copyright 1999-2009 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.6.23-r1.ebuild,v 1.1 2009/09/17 16:07:06 mrness Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info
8
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/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
16 IUSE="curl ldap smartcard extra-algorithms weak-algorithms nocrypto-algorithms ms-bad-proposal"
17
18 COMMON_DEPEND="!net-misc/strongswan
19 dev-libs/gmp
20 dev-lang/perl
21 smartcard? ( dev-libs/opensc )
22 curl? ( net-misc/curl )
23 ldap? ( net-nds/openldap )"
24 DEPEND="${COMMON_DEPEND}
25 virtual/linux-sources
26 app-text/xmlto
27 app-text/docbook-xml-dtd:4.1.2" # see bug 237132
28 RDEPEND="${COMMON_DEPEND}
29 virtual/logger
30 sys-apps/iproute2"
31
32 pkg_setup() {
33 if use nocrypto-algorithms && ! use weak-algorithms; then
34 ewarn "Enabling nocrypto-algorithms USE flag has no effect when"
35 ewarn "weak-algorithms USE flag is disabled"
36 fi
37
38 linux-info_pkg_setup
39
40 if kernel_is 2 6; then
41 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
42 einfo "KLIPS will not be compiled/installed."
43 MYMAKE="programs"
44
45 elif kernel_is 2 4; then
46 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
47 eerror "You need to have an IPsec enabled 2.4.x kernel."
48 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
49 die
50 fi
51
52 einfo "Using patched-in IPsec code for kernel 2.4"
53 einfo "Your kernel only supports KLIPS for kernel level IPsec."
54 MYMAKE="confcheck programs"
55
56 else
57 die "Unsupported kernel version"
58 fi
59 }
60
61 src_prepare() {
62 epatch "${FILESDIR}"/${P}-gentoo.patch
63 use ms-bad-proposal && epatch "${FILESDIR}"/${PN}-${PV%.*}-allow-ms-bad-proposal.patch
64
65 find . -type f -regex '.*[.]\([1-8]\|html\|xml\)' -exec sed -i \
66 -e s:/usr/local:/usr:g '{}' \; ||
67 die "failed to replace text in docs"
68 }
69
70 get_make_options() {
71 echo KERNELSRC=\"${KERNEL_DIR}\" \
72 FINALEXAMPLECONFDIR=/usr/share/doc/${PF} \
73 INC_RCDEFAULT=/etc/init.d \
74 INC_USRLOCAL=/usr \
75 INC_MANDIR=share/man \
76 FINALDOCDIR=/usr/share/doc/${PF}/html \
77 DESTDIR=\"${D}\" \
78 USERCOMPILE=\"${CFLAGS}\"
79 if use smartcard ; then
80 echo USE_SMARTCARD=true
81 fi
82 if use extra-algorithms ; then
83 echo USE_EXTRACRYPTO=true
84 else
85 echo USE_EXTRACRYPTO=false
86 fi
87 if use weak-algorithms ; then
88 echo USE_WEAKSTUFF=true
89 if use nocrypto-algorithms; then
90 echo USE_NOCRYPTO=true
91 fi
92 fi
93 echo USE_LWRES=false # needs bind9 with lwres support
94 local USETHREADS=false
95 if use curl; then
96 echo USE_LIBCURL=true
97 USETHREADS=true
98 fi
99 if use ldap; then
100 echo USE_LDAP=true
101 USETHREADS=true
102 fi
103 echo HAVE_THREADS=${USETHREADS}
104 }
105
106 src_compile() {
107 eval set -- $(get_make_options)
108 emake "$@" \
109 ${MYMAKE} || die "emake failed"
110 }
111
112 src_install() {
113 eval set -- $(get_make_options)
114 emake "$@" \
115 install || die "emake install failed"
116
117 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
118
119 dodir /var/run/pluto || die "failed to create /var/run/pluto"
120 }
121
122 pkg_preinst() {
123 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
124 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
125 local i err=0
126 if [ -h "../ipsec.d" ]; then
127 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
128 fi
129 for i in *; do
130 if [ -e "../$i" ]; then
131 eerror " $i NOT MOVED, ../$i already exists!"
132 err=1
133 elif [ -d "$i" ]; then
134 mv "$i" .. || die "failed to move $i directory"
135 ewarn " directory $i"
136 elif [ -f "$i" ]; then
137 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
138 mv "$i" .. && ewarn " file $i" || \
139 die "failed to move $i file"
140 else
141 eerror " $i NOT MOVED, it is not a file nor a directory!"
142 err=1
143 fi
144 done
145 popd
146 if [ $err -eq 0 ]; then
147 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
148 else
149 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
150 fi
151 fi
152 }
153
154 pkg_postinst() {
155 if kernel_is 2 6; then
156 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
157 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
158 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
159 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
160 check_extra_config
161 fi
162 }

  ViewVC Help
Powered by ViewVC 1.1.20