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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20