Use https by default
[gentoo.git] / net-misc / vpnc / vpnc-0.5.3_p527-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit eutils linux-info systemd toolchain-funcs
8
9 DESCRIPTION="Free client for Cisco VPN routing software"
10 HOMEPAGE="http://www.unix-ag.uni-kl.de/~massar/vpnc/"
11 SRC_URI="https://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
12
13 LICENSE="GPL-2 BSD"
14 SLOT="0"
15 KEYWORDS="amd64 arm ppc ppc64 sparc x86"
16 IUSE="resolvconf +gnutls selinux"
17
18 DEPEND="
19         dev-lang/perl
20         dev-libs/libgcrypt:0=
21         >=sys-apps/iproute2-2.6.19.20061214[-minimal]
22         gnutls? ( net-libs/gnutls )
23         !gnutls? ( dev-libs/openssl:0= )"
24 RDEPEND="${DEPEND}
25         resolvconf? ( net-dns/openresolv )
26         selinux? ( sec-policy/selinux-vpn )
27 "
28
29 RESTRICT="!gnutls? ( bindist )"
30
31 CONFIG_CHECK="~TUN"
32
33 src_prepare() {
34         if use gnutls; then
35                 elog "Will build with GnuTLS (default) instead of OpenSSL so you may even redistribute binaries."
36                 elog "See the Makefile itself and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440318"
37         else
38                 sed -i -e '/^#OPENSSL_GPL_VIOLATION/s:#::g' "${S}"/Makefile     || die
39                 ewarn "Building SSL support with OpenSSL instead of GnuTLS.  This means that"
40                 ewarn "you are not allowed to re-distibute the binaries due to conflicts between BSD license and GPL,"
41                 ewarn "see the vpnc Makefile and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440318"
42         fi
43
44         epatch "${FILESDIR}"/${PN}-0.5.3_p514-as-needed.patch
45
46         sed -e 's:test/cert0.pem::g' -i Makefile || die
47
48         tc-export CC
49
50         sed \
51                 -e 's:/var/run:/run:g' \
52                 -i ChangeLog config.c TODO  || die
53 }
54
55 src_install() {
56         emake PREFIX="/usr" DESTDIR="${D}" install
57         dodoc README TODO VERSION
58         keepdir /etc/vpnc/scripts.d
59         newinitd "${FILESDIR}/vpnc-3.init" vpnc
60         newconfd "${FILESDIR}/vpnc.confd" vpnc
61         sed -e "s:/usr/local:/usr:" -i "${D}"/etc/vpnc/vpnc-script || die
62
63         systemd_dotmpfilesd "${FILESDIR}"/vpnc-tmpfiles.conf
64         systemd_newunit "${FILESDIR}"/vpnc.service vpnc@.service
65
66         # COPYING file resides here, should not be installed
67         rm -rf "${ED}"/usr/share/doc/vpnc/ || die
68 }
69
70 pkg_postinst() {
71         elog "You can generate a configuration file from the original Cisco profiles of your"
72         elog "connection by using /usr/bin/pcf2vpnc to convert the .pcf file"
73         elog "A guide is available at https://wiki.gentoo.org/wiki/Vpnc"
74 }