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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (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.3: +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.4.11.ebuild,v 1.3 2008/06/28 21:28:48 gentoofan23 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"
15
16 COMMON_DEPEND="!net-misc/strongswan
17 >=dev-libs/gmp-4.2.1
18 smartcard? ( dev-libs/opensc )
19 curl? ( net-misc/curl )
20 ldap? ( net-nds/openldap )"
21 DEPEND="${COMMON_DEPEND}
22 virtual/linux-sources"
23 RDEPEND="${COMMON_DEPEND}
24 virtual/logger
25 sys-apps/iproute2"
26
27 pkg_setup() {
28 linux-info_pkg_setup
29
30 if kernel_is 2 6; then
31 einfo "This ebuild will set ${P} to use 2.6 native IPsec (KAME)."
32 einfo "KLIPS will not be compiled/installed."
33 MYMAKE="programs"
34
35 elif kernel_is 2 4; then
36 if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
37 eerror "You need to have an IPsec enabled 2.4.x kernel."
38 eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
39 die
40 fi
41
42 einfo "Using patched-in IPsec code for kernel 2.4"
43 einfo "Your kernel only supports KLIPS for kernel level IPsec."
44 MYMAKE="confcheck programs"
45
46 else
47 die "Unsupported kernel version"
48 fi
49 }
50
51 src_unpack() {
52 unpack ${A}
53
54 cd "${S}"
55 epatch "${FILESDIR}"/${P}-gentoo.patch
56 epatch "${FILESDIR}"/${P}-implicit-decl.patch
57 }
58
59 get_make_options() {
60 echo KERNELSRC=\"${KERNEL_DIR}\" \
61 FINALCONFDIR=/etc/ipsec \
62 INC_RCDEFAULT=/etc/init.d \
63 INC_USRLOCAL=/usr \
64 INC_MANDIR=share/man \
65 FINALEXAMPLECONFDIR=/usr/share/doc/${P} \
66 FINALDOCDIR=/usr/share/doc/${P} \
67 DESTDIR=\"${D}\" \
68 USERCOMPILE=\"${CFLAGS}\"
69 if use smartcard ; then
70 echo USE_SMARTCARD=true
71 fi
72 if use extra-algorithms ; then
73 echo USE_EXTRACRYPTO=true
74 fi
75 if use weak-algorithms ; then
76 echo USE_WEAKSTUFF=true
77 fi
78 echo USE_OE=false # by default, turn off Opportunistic Encryption
79 local USETHREADS=false
80 if use curl; then
81 echo USE_LIBCURL=true
82 USETHREADS=true
83 fi
84 if use ldap; then
85 echo USE_LDAP=true
86 USETHREADS=true
87 fi
88 echo HAVE_THREADS=${USETHREADS}
89 }
90
91 src_compile() {
92 eval set -- $(get_make_options)
93 emake "$@" \
94 ${MYMAKE} || die "emake failed"
95 }
96
97 src_install() {
98 eval set -- $(get_make_options)
99 emake "$@" \
100 install || die "emake install failed"
101
102 dosym /etc/ipsec/ipsec.d /etc/ipsec.d
103
104 doinitd "${FILESDIR}"/ipsec || die "failed to install init script"
105
106 dodir /var/run/pluto || die "failed to create /var/run/pluto"
107 }
108
109 pkg_preinst() {
110 # Try to fix previous openswan-2.4.9 blooper (#193824)
111 if [[ "${ROOT}" == / ]] && has_version "=net-misc/openswan-2.4.9" ; then
112 elog "Trying to remove empty {rundir,subsysdir} erroneously created by openswan-2.4.9"
113 local base dir
114 for base in / /root/ /etc/ ; do
115 for dir in rundir subsysdir ; do
116 if [[ -d "${base}${dir}" ]]; then
117 rmdir "${base}${dir}" \
118 && elog "Empty directory ${base}${dir} has been removed" \
119 || ewarn "Failed to remove ${base}${dir} (perhaps some other package owns it?)"
120 fi
121 done
122 done
123 fi
124 }
125
126 pkg_postinst() {
127 if kernel_is 2 6; then
128 CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
129 WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
130 WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
131 WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
132 check_extra_config
133 fi
134 }

  ViewVC Help
Powered by ViewVC 1.1.20