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

Contents of /net-misc/openswan/openswan-2.6.23-r2.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-r2.ebuild,v 1.1 2009/12/05 08:01:44 mrness Exp $
4
5 EAPI="2"
6
7 inherit eutils linux-info toolchain-funcs
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 CC=\"$(tc-getCC)\"
80 if use smartcard ; then
81 echo USE_SMARTCARD=true
82 fi
83 if use extra-algorithms ; then
84 echo USE_EXTRACRYPTO=true
85 else
86 echo USE_EXTRACRYPTO=false
87 fi
88 if use weak-algorithms ; then
89 echo USE_WEAKSTUFF=true
90 if use nocrypto-algorithms; then
91 echo USE_NOCRYPTO=true
92 fi
93 fi
94 echo USE_LWRES=false # needs bind9 with lwres support
95 local USETHREADS=false
96 if use curl; then
97 echo USE_LIBCURL=true
98 USETHREADS=true
99 fi
100 if use ldap; then
101 echo USE_LDAP=true
102 USETHREADS=true
103 fi
104 echo HAVE_THREADS=${USETHREADS}
105 }
106
107 src_compile() {
108 eval set -- $(get_make_options)
109 emake "$@" \
110 ${MYMAKE} || die "emake failed"
111 }
112
113 src_install() {
114 eval set -- $(get_make_options)
115 emake "$@" \
116 install || die "emake install failed"
117
118 dodoc docs/{KNOWN_BUGS*,RELEASE-NOTES*,PATENTS*,debugging*}
119 dohtml doc/*.html
120 docinto quickstarts
121 dodoc doc/quickstarts/*
122
123 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
124
125 dodir /var/run/pluto || die "failed to create /var/run/pluto"
126 }
127
128 pkg_preinst() {
129 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
130 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
131 local i err=0
132 if [ -h "../ipsec.d" ]; then
133 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
134 fi
135 for i in *; do
136 if [ -e "../$i" ]; then
137 eerror " $i NOT MOVED, ../$i already exists!"
138 err=1
139 elif [ -d "$i" ]; then
140 mv "$i" .. || die "failed to move $i directory"
141 ewarn " directory $i"
142 elif [ -f "$i" ]; then
143 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
144 mv "$i" .. && ewarn " file $i" || \
145 die "failed to move $i file"
146 else
147 eerror " $i NOT MOVED, it is not a file nor a directory!"
148 err=1
149 fi
150 done
151 popd
152 if [ $err -eq 0 ]; then
153 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
154 else
155 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
156 fi
157 fi
158 }
159
160 pkg_postinst() {
161 if kernel_is 2 6; then
162 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
163 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
164 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
165 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
166 check_extra_config
167 fi
168 }

  ViewVC Help
Powered by ViewVC 1.1.20