/[gentoo-x86]/net-misc/openconnect/openconnect-6.00.ebuild
Gentoo

Contents of /net-misc/openconnect/openconnect-6.00.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Mon Apr 27 19:01:33 2015 UTC (4 years, 4 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Use krb5 virtual, bug 547556. Remove old.

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

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openconnect/openconnect-6.00.ebuild,v 1.3 2015/04/08 18:04:50 mgorny Exp $
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="xml"
9
10 inherit eutils linux-info python-any-r1
11
12 DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
13 HOMEPAGE="http://www.infradead.org/openconnect.html"
14 # New versions of openconnect-script can be found here:
15 # http://git.infradead.org/users/dwmw2/vpnc-scripts.git/history/HEAD:/vpnc-script
16 SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
17 http://dev.gentoo.org/~hasufell/distfiles/openconnect-script-20140311.tar.xz"
18
19 LICENSE="LGPL-2.1 GPL-2"
20 SLOT="0/3"
21 KEYWORDS="~amd64 ~ppc64 ~x86"
22 IUSE="doc +gnutls gssapi java libproxy nls static-libs"
23 ILINGUAS="ar cs de el en_GB en_US es eu fi fr gl id lt nl pa pl pt pt_BR sk sl tg ug uk zh_CN zh_TW"
24 for lang in $ILINGUAS; do
25 IUSE="${IUSE} linguas_${lang}"
26 done
27
28 DEPEND="dev-libs/libxml2
29 sys-libs/zlib
30 !gnutls? (
31 >=dev-libs/openssl-1.0.1h:0[static-libs?]
32 )
33 gnutls? (
34 >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
35 app-misc/ca-certificates
36 )
37 gssapi? ( virtual/krb5 )
38 libproxy? ( net-libs/libproxy )
39 nls? ( virtual/libintl )"
40 RDEPEND="${DEPEND}
41 sys-apps/iproute2
42 java? ( virtual/jre )"
43 DEPEND="${DEPEND}
44 virtual/pkgconfig
45 doc? ( ${PYTHON_DEPS} sys-apps/groff )
46 java? ( virtual/jdk )
47 nls? ( sys-devel/gettext )"
48
49 tun_tap_check() {
50 ebegin "Checking for TUN/TAP support"
51 if { ! linux_chkconfig_present TUN; }; then
52 eerror "Please enable TUN/TAP support in your kernel config, found at:"
53 eerror
54 eerror " Device Drivers --->"
55 eerror " [*] Network device support --->"
56 eerror " <*> Universal TUN/TAP device driver support"
57 eerror
58 eerror "and recompile your kernel ..."
59 die "no CONFIG_TUN support detected!"
60 fi
61 eend $?
62 }
63
64 pkg_setup() {
65 if use doc; then
66 python-any-r1_pkg_setup
67 fi
68
69 if use kernel_linux; then
70 get_version
71 if linux_config_exists; then
72 tun_tap_check
73 else
74 ewarn "Was unable to determine your kernel .config"
75 ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
76 ewarn "kernel .config, Without it, it will not work correctly."
77 # We don't die here, so it's possible to compile this package without
78 # kernel sources available. Required for cross-compilation.
79 fi
80 fi
81 }
82
83 src_configure() {
84 strip-linguas $ILINGUAS
85 echo ${LINGUAS} > po/LINGUAS
86 # Override vpn-script test since the build system violates the sandbox and
87 # needs the path set to the real default path after it's installed
88 sed -e "s#-x \"\$with_vpnc_script\"#-n \"${WORKDIR}/openconnect-script\"#" \
89 -i configure || die
90 if ! use doc; then
91 # If the python cannot be found, the docs will not build
92 sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
93 fi
94
95 # stoken and liboath not in portage
96 econf \
97 --with-vpnc-script=/etc/openconnect/openconnect.sh \
98 $(use_enable static-libs static) \
99 $(use_enable nls ) \
100 $(use_with !gnutls openssl) \
101 $(use_with gnutls ) \
102 $(use_with libproxy) \
103 --without-stoken \
104 --without-liboath \
105 $(use_with gssapi) \
106 $(use_with java)
107 }
108
109 src_install() {
110 emake DESTDIR="${D}" install
111
112 dodoc AUTHORS TODO
113 newinitd "${FILESDIR}"/openconnect.init.in-r2 openconnect
114 dodir /etc/openconnect
115 insinto /etc/openconnect
116 newconfd "${FILESDIR}"/openconnect.conf.in openconnect
117 exeinto /etc/openconnect
118 newexe "${WORKDIR}"/openconnect-script openconnect.sh
119 insinto /etc/logrotate.d
120 newins "${FILESDIR}"/openconnect.logrotate openconnect
121 keepdir /var/log/openconnect
122
123 # Remove useless .la files
124 find "${D}" -name '*.la' -delete || die "la file removal failed"
125 }
126
127 pkg_postinst() {
128 elog "The init script for openconnect has changed and now supports multiple vpn tunnels."
129 elog
130 elog "You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d"
131 elog "instead of calling it directly:"
132 elog
133 elog "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
134 elog
135 elog "You can then start the vpn tunnel like this:"
136 elog
137 elog "/etc/init.d/openconnect.vpn0 start"
138 elog
139 elog "If you would like to run preup, postup, predown, and/or postdown scripts,"
140 elog "You need to create a directory in /etc/openconnect with the name of the vpn:"
141 elog
142 elog "mkdir /etc/openconnect/vpn0"
143 elog
144 elog "Then add executable shell files:"
145 elog
146 elog "mkdir /etc/openconnect/vpn0"
147 elog "cd /etc/openconnect/vpn0"
148 elog "echo '#!/bin/sh' > preup.sh"
149 elog "cp preup.sh predown.sh"
150 elog "cp preup.sh postup.sh"
151 elog "cp preup.sh postdown.sh"
152 elog "chmod 755 /etc/openconnect/vpn0/*"
153 }

  ViewVC Help
Powered by ViewVC 1.1.20