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 sed -e 's:test/cert0.pem::g' -i Makefile || die
49 -e 's:/var/run:/run:g' \
50 -i ChangeLog config.c TODO || die
54 emake PREFIX="/usr" DESTDIR="${D}" install
55 dodoc README TODO VERSION
56 keepdir /etc/vpnc/scripts.d
57 newinitd "${FILESDIR}/vpnc-3.init" vpnc
58 newconfd "${FILESDIR}/vpnc.confd" vpnc
59 sed -e "s:/usr/local:/usr:" -i "${ED}"/etc/vpnc/vpnc-script || die
61 systemd_dotmpfilesd "${FILESDIR}"/vpnc-tmpfiles.conf
62 systemd_newunit "${FILESDIR}"/vpnc.service vpnc@.service
64 # COPYING file resides here, should not be installed
65 rm -rf "${ED}"/usr/share/doc/vpnc/ || die
69 elog "You can generate a configuration file from the original Cisco profiles of your"
70 elog "connection by using /usr/bin/pcf2vpnc to convert the .pcf file"
71 elog "A guide is available at https://wiki.gentoo.org/wiki/Vpnc"