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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Dec 5 08:01:44 2009 UTC (9 years, 10 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Use selected CC (#293277). Install more doc files (#294533).
(Portage version: 2.1.6.13/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.22.ebuild,v 1.2 2009/06/28 09:45:59 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"
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
64 find . -type f -regex '.*[.][1-8]' -exec sed -i \
65 -e s:/usr/local:/usr:g '{}' \; ||
66 die "failed to replace text in xml docs"
67 }
68
69 get_make_options() {
70 echo KERNELSRC=\"${KERNEL_DIR}\" \
71 FINALEXAMPLECONFDIR=/usr/share/doc/${PF} \
72 INC_RCDEFAULT=/etc/init.d \
73 INC_USRLOCAL=/usr \
74 INC_MANDIR=share/man \
75 FINALDOCDIR=/usr/share/doc/${PF}/html \
76 DESTDIR=\"${D}\" \
77 USERCOMPILE=\"${CFLAGS}\"
78 if use smartcard ; then
79 echo USE_SMARTCARD=true
80 fi
81 if use extra-algorithms ; then
82 echo USE_EXTRACRYPTO=true
83 else
84 echo USE_EXTRACRYPTO=false
85 fi
86 if use weak-algorithms ; then
87 echo USE_WEAKSTUFF=true
88 if use nocrypto-algorithms; then
89 echo USE_NOCRYPTO=true
90 fi
91 fi
92 echo USE_LWRES=false # needs bind9 with lwres support
93 local USETHREADS=false
94 if use curl; then
95 echo USE_LIBCURL=true
96 USETHREADS=true
97 fi
98 if use ldap; then
99 echo USE_LDAP=true
100 USETHREADS=true
101 fi
102 echo HAVE_THREADS=${USETHREADS}
103 }
104
105 src_compile() {
106 eval set -- $(get_make_options)
107 emake "$@" \
108 ${MYMAKE} || die "emake failed"
109 }
110
111 src_install() {
112 eval set -- $(get_make_options)
113 emake "$@" \
114 install || die "emake install failed"
115
116 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
117
118 dodir /var/run/pluto || die "failed to create /var/run/pluto"
119 }
120
121 pkg_preinst() {
122 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
123 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
124 local i err=0
125 if [ -h "../ipsec.d" ]; then
126 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
127 fi
128 for i in *; do
129 if [ -e "../$i" ]; then
130 eerror " $i NOT MOVED, ../$i already exists!"
131 err=1
132 elif [ -d "$i" ]; then
133 mv "$i" .. || die "failed to move $i directory"
134 ewarn " directory $i"
135 elif [ -f "$i" ]; then
136 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
137 mv "$i" .. && ewarn " file $i" || \
138 die "failed to move $i file"
139 else
140 eerror " $i NOT MOVED, it is not a file nor a directory!"
141 err=1
142 fi
143 done
144 popd
145 if [ $err -eq 0 ]; then
146 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
147 else
148 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
149 fi
150 fi
151 }
152
153 pkg_postinst() {
154 if kernel_is 2 6; then
155 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
156 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
157 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
158 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
159 check_extra_config
160 fi
161 }

  ViewVC Help
Powered by ViewVC 1.1.20