1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils linux-info systemd toolchain-funcs
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"
15 KEYWORDS="amd64 arm ppc ppc64 sparc x86"
16 IUSE="resolvconf +gnutls selinux"
21 >=sys-apps/iproute2-2.6.19.20061214[-minimal]
22 gnutls? ( net-libs/gnutls )
23 !gnutls? ( dev-libs/openssl:0= )"
25 resolvconf? ( net-dns/openresolv )
26 selinux? ( sec-policy/selinux-vpn )
29 RESTRICT="!gnutls? ( bindist )"
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"
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"
44 epatch "${FILESDIR}"/${PN}-0.5.3_p514-as-needed.patch
46 sed -e 's:test/cert0.pem::g' -i Makefile || die
51 -e 's:/var/run:/run:g' \
52 -i ChangeLog config.c TODO || die
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
63 systemd_dotmpfilesd "${FILESDIR}"/vpnc-tmpfiles.conf
64 systemd_newunit "${FILESDIR}"/vpnc.service vpnc@.service
66 # COPYING file resides here, should not be installed
67 rm -rf "${ED}"/usr/share/doc/vpnc/ || die
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"