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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Dec 3 23:30:28 2008 UTC (10 years, 10 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove obsolete versions.
Correct doc install path (#241976).
Version bump.
(Portage version: 2.1.4.4, RepoMan options: --force)

1 # Copyright 1999-2008 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.16.ebuild,v 1.1 2008/09/21 12:42:31 mrness Exp $
4
5 inherit eutils linux-info
6
7 DESCRIPTION="Open Source implementation of IPsec for the Linux operating system (was SuperFreeS/WAN)."
8 HOMEPAGE="http://www.openswan.org/"
9 SRC_URI="http://www.openswan.org/download/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ~ppc ~sparc ~x86"
14 IUSE="curl ldap smartcard extra-algorithms weak-algorithms nocrypto-algorithms"
15
16 COMMON_DEPEND="!net-misc/strongswan
17 dev-libs/gmp
18 dev-lang/perl
19 smartcard? ( dev-libs/opensc )
20 curl? ( net-misc/curl )
21 ldap? ( net-nds/openldap )"
22 DEPEND="${COMMON_DEPEND}
23 virtual/linux-sources
24 app-text/xmlto"
25 RDEPEND="${COMMON_DEPEND}
26 virtual/logger
27 sys-apps/iproute2"
28
29 pkg_setup() {
30 if use nocrypto-algorithms && ! use weak-algorithms; then
31 ewarn "Enabling nocrypto-algorithms USE flag has no effect when"
32 ewarn "weak-algorithms USE flag is disabled"
33 fi
34
35 linux-info_pkg_setup
36
37 if kernel_is 2 6; then
38 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
39 einfo "KLIPS will not be compiled/installed."
40 MYMAKE="programs"
41
42 elif kernel_is 2 4; then
43 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
44 eerror "You need to have an IPsec enabled 2.4.x kernel."
45 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
46 die
47 fi
48
49 einfo "Using patched-in IPsec code for kernel 2.4"
50 einfo "Your kernel only supports KLIPS for kernel level IPsec."
51 MYMAKE="confcheck programs"
52
53 else
54 die "Unsupported kernel version"
55 fi
56 }
57
58 src_unpack() {
59 unpack ${A}
60
61 cd "${S}"
62 epatch "${FILESDIR}"/${P}-gentoo.patch
63 epatch "${FILESDIR}"/${P}-qa-fixes.patch
64 epatch "${FILESDIR}"/${P}-refine-connection.patch
65
66 find . -regex '.*[.][1-8]' -exec sed -i \
67 -e s:/usr/local:/usr:g '{}' \; ||
68 die "failed to replace text in xml docs"
69 }
70
71 get_make_options() {
72 echo KERNELSRC=\"${KERNEL_DIR}\" \
73 FINALEXAMPLECONFDIR=/usr/share/doc/${P} \
74 INC_RCDEFAULT=/etc/init.d \
75 INC_USRLOCAL=/usr \
76 INC_MANDIR=share/man \
77 FINALDOCDIR=/usr/share/doc/${P} \
78 DESTDIR=\"${D}\" \
79 USERCOMPILE=\"${CFLAGS}\"
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 newinitd "${FILESDIR}"/ipsec-initd ipsec || die "failed to install init script"
119
120 dodir /var/run/pluto || die "failed to create /var/run/pluto"
121 }
122
123 pkg_preinst() {
124 if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
125 ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
126 local i err=0
127 if [ -h "../ipsec.d" ]; then
128 rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
129 fi
130 for i in *; do
131 if [ -e "../$i" ]; then
132 eerror " $i NOT MOVED, ../$i already exists!"
133 err=1
134 elif [ -d "$i" ]; then
135 mv "$i" .. || die "failed to move $i directory"
136 ewarn " directory $i"
137 elif [ -f "$i" ]; then
138 sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
139 mv "$i" .. && ewarn " file $i" || \
140 die "failed to move $i file"
141 else
142 eerror " $i NOT MOVED, it is not a file nor a directory!"
143 err=1
144 fi
145 done
146 popd
147 if [ $err -eq 0 ]; then
148 rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
149 else
150 ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
151 fi
152 fi
153 }
154
155 pkg_postinst() {
156 if kernel_is 2 6; then
157 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
158 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
159 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
160 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
161 check_extra_config
162 fi
163 }

  ViewVC Help
Powered by ViewVC 1.1.20