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

Contents of /net-misc/openswan/openswan-2.6.39-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Jan 5 00:59:30 2014 UTC (5 years, 10 months ago) by floppym
Branch: MAIN
Changes since 1.2: +3 -2 lines
Add blocker on net-misc/libreswan.

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)

1 floppym 1.2 # Copyright 1999-2014 Gentoo Foundation
2 floppym 1.1 # Distributed under the terms of the GNU General Public License v2
3 floppym 1.3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openswan/openswan-2.6.39-r1.ebuild,v 1.2 2014/01/04 18:19:01 floppym Exp $
4 floppym 1.1
5     EAPI="4"
6    
7     inherit eutils linux-info systemd toolchain-funcs flag-o-matic
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://download.openswan.org/openswan/${P}.tar.gz"
12    
13     LICENSE="GPL-2 BSD-4 DES RSA"
14     SLOT="0"
15     KEYWORDS="amd64 ~ppc ~sparc x86"
16     IUSE="caps curl ldap pam ssl extra-algorithms weak-algorithms nocrypto-algorithms ms-bad-proposal nss"
17    
18     RESTRICT="test" # requires user mode linux setup
19    
20     COMMON_DEPEND="!net-misc/strongswan
21     dev-libs/gmp
22     dev-lang/perl
23     caps? ( sys-libs/libcap-ng )
24     curl? ( net-misc/curl )
25     ldap? ( net-nds/openldap )
26     nss? ( dev-libs/nss )
27     ssl? ( dev-libs/openssl )"
28     DEPEND="${COMMON_DEPEND}
29     virtual/linux-sources
30     app-text/xmlto
31     app-text/docbook-xml-dtd:4.1.2" # see bug 237132
32     RDEPEND="${COMMON_DEPEND}
33     virtual/logger
34 floppym 1.3 sys-apps/iproute2
35     !net-misc/libreswan"
36 floppym 1.1
37     pkg_setup() {
38     if use nocrypto-algorithms && ! use weak-algorithms; then
39     ewarn "Enabling nocrypto-algorithms USE flag has no effect when"
40     ewarn "weak-algorithms USE flag is disabled"
41     fi
42    
43     linux-info_pkg_setup
44    
45     if kernel_is -ge 2 6; then
46     einfo "This ebuild will set ${P} to use kernel native IPsec (KAME)."
47     MYMAKE="programs"
48    
49     elif kernel_is 2 4; then
50     if ! [[ -d "${KERNEL_DIR}/net/ipsec" ]]; then
51     eerror "You need to have an IPsec enabled 2.4.x kernel."
52     eerror "Ensure you have one running and make a symlink to it in /usr/src/linux"
53     die
54     fi
55    
56     einfo "Using patched-in IPsec code for kernel 2.4"
57     einfo "Your kernel only supports KLIPS for kernel level IPsec."
58     MYMAKE="confcheck programs"
59    
60     else
61     die "Unsupported kernel version"
62     fi
63    
64     # most code is OK, but programs/pluto code breaks strict aliasing
65     append-cflags -fno-strict-aliasing
66     }
67    
68     src_prepare() {
69     epatch "${FILESDIR}"/${P}-gentoo.patch
70     use ms-bad-proposal && epatch "${FILESDIR}"/${PN}-${PV%.*}-allow-ms-bad-proposal.patch
71    
72     find . -type f -regex '.*[.]\([1-8]\|html\|xml\)' -exec sed -i \
73     -e s:/usr/local:/usr:g '{}' \; ||
74     die "failed to replace text in docs"
75     }
76    
77     usetf() { usex $1 true false ; }
78     get_make_options() {
79     make_options=(
80     KERNELSRC="${KERNEL_DIR}"
81     FINALEXAMPLECONFDIR=/usr/share/doc/${PF}
82     INC_RCDEFAULT=/etc/init.d
83     INC_USRLOCAL=/usr
84     INC_MANDIR=share/man
85     FINALDOCDIR=/usr/share/doc/${PF}/html
86     FINALLIBDIR=/usr/$(get_libdir)/ipsec
87     DESTDIR="${D}"
88     USERCOMPILE="${CFLAGS}"
89     USERLINK="-Wl,-z,relro ${LDFLAGS}"
90     USE_LIBCAP_NG=$(usetf caps)
91     USE_LIBCURL=$(usetf curl)
92     USE_LDAP=$(usetf ldap)
93     USE_XAUTH=true
94     USE_XAUTHPAM=$(usetf pam)
95     USE_LIBNSS=$(usetf nss)
96     HAVE_OPENSSL=$(usetf ssl)
97     USE_EXTRACRYPTO=$(usetf extra-algorithms)
98     USE_WEAKSTUFF=$(usetf weak-algorithms)
99     )
100    
101     if use weak-algorithms && use nocrypto-algorithms ; then
102     make_options+=( USE_NOCRYPTO=true )
103     fi
104    
105     make_options+=( USE_LWRES=false ) # needs bind9 with lwres support
106     if use curl || use ldap || use pam; then
107     make_options+=( HAVE_THREADS=true )
108     else
109     make_options+=( HAVE_THREADS=false )
110     fi
111     }
112    
113     src_compile() {
114     tc-export AR CC
115     local make_options; get_make_options
116     emake "${make_options[@]}" ${MYMAKE}
117     }
118    
119     src_install() {
120     local make_options; get_make_options
121     emake "${make_options[@]}" install
122    
123     dodoc CHANGES README
124     dodoc docs/{KNOWN_BUGS*,RELEASE-NOTES*,PATENTS*,debugging*}
125     docinto quickstarts
126     dodoc docs/quickstarts/*
127    
128     insinto /usr/share/doc/${PF}
129     doins -r contrib
130     docompress -x /usr/share/doc/${PF}/contrib
131    
132     newinitd "${FILESDIR}"/ipsec-initd ipsec
133     systemd_dounit "${FILESDIR}"/ipsec.service
134    
135     # We don't need to install /var/run/pluto.
136     rm -rf "${D}var" || die
137     }
138    
139     pkg_preinst() {
140     if has_version "<net-misc/openswan-2.6.14" && pushd "${ROOT}etc/ipsec"; then
141     ewarn "Following files and directories were moved from '${ROOT}etc/ipsec' to '${ROOT}etc':"
142     local i err=0
143     if [ -h "../ipsec.d" ]; then
144     rm "../ipsec.d" || die "failed to remove ../ipsec.d symlink"
145     fi
146     for i in *; do
147     if [ -e "../$i" ]; then
148     eerror " $i NOT MOVED, ../$i already exists!"
149     err=1
150     elif [ -d "$i" ]; then
151     mv "$i" .. || die "failed to move $i directory"
152     ewarn " directory $i"
153     elif [ -f "$i" ]; then
154     sed -i -e 's:/etc/ipsec/:/etc/:g' "$i" && \
155     mv "$i" .. && ewarn " file $i" || \
156     die "failed to move $i file"
157     else
158     eerror " $i NOT MOVED, it is not a file nor a directory!"
159     err=1
160     fi
161     done
162     popd
163     if [ $err -eq 0 ]; then
164     rmdir "${ROOT}etc/ipsec" || eerror "Failed to remove ${ROOT}etc/ipsec"
165     else
166     ewarn "${ROOT}etc/ipsec is not empty, you will have to remove it yourself"
167     fi
168     fi
169     }
170    
171     pkg_postinst() {
172     if kernel_is -ge 2 6; then
173     CONFIG_CHECK="~NET_KEY ~INET_XFRM_MODE_TRANSPORT ~INET_XFRM_MODE_TUNNEL ~INET_AH ~INET_ESP ~INET_IPCOMP"
174     WARNING_INET_AH="CONFIG_INET_AH:\tmissing IPsec AH support (needed if you want only authentication)"
175     WARNING_INET_ESP="CONFIG_INET_ESP:\tmissing IPsec ESP support (needed if you want authentication and encryption)"
176     WARNING_INET_IPCOMP="CONFIG_INET_IPCOMP:\tmissing IPsec Payload Compression (required for compress=yes)"
177     check_extra_config
178     fi
179     }

  ViewVC Help
Powered by ViewVC 1.1.20