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

Contents of /net-misc/openconnect/openconnect-7.06-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue May 12 01:11:06 2015 UTC (4 years, 4 months ago) by floppym
Branch: MAIN
CVS Tags: HEAD
Revamp init script. Should resolve bug 547970.

(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-7.06.ebuild,v 1.3 2015/04/27 19:01:33 floppym Exp $
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="xml"
9
10 inherit eutils java-pkg-opt-2 linux-info python-any-r1 readme.gentoo
11
12 DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
13 HOMEPAGE="http://www.infradead.org/openconnect.html"
14 VPNC_VER=20140806
15 SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
16 ftp://ftp.infradead.org/pub/vpnc-scripts/vpnc-scripts-${VPNC_VER}.tar.gz"
17
18 LICENSE="LGPL-2.1 GPL-2"
19 SLOT="0/5"
20 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
21 IUSE="doc +gnutls gssapi java libproxy nls static-libs"
22 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"
23 for lang in $ILINGUAS; do
24 IUSE="${IUSE} linguas_${lang}"
25 done
26
27 DEPEND="dev-libs/libxml2
28 sys-libs/zlib
29 !gnutls? (
30 >=dev-libs/openssl-1.0.1h:0[static-libs?]
31 )
32 gnutls? (
33 >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
34 app-misc/ca-certificates
35 )
36 gssapi? ( virtual/krb5 )
37 libproxy? ( net-libs/libproxy )
38 nls? ( virtual/libintl )"
39 RDEPEND="${DEPEND}
40 sys-apps/iproute2
41 !<sys-apps/openrc-0.13"
42 DEPEND="${DEPEND}
43 virtual/pkgconfig
44 doc? ( ${PYTHON_DEPS} sys-apps/groff )
45 java? ( >=virtual/jdk-1.6 )
46 nls? ( sys-devel/gettext )"
47
48 tun_tap_check() {
49 ebegin "Checking for TUN/TAP support"
50 if { ! linux_chkconfig_present TUN; }; then
51 eerror "Please enable TUN/TAP support in your kernel config, found at:"
52 eerror
53 eerror " Device Drivers --->"
54 eerror " [*] Network device support --->"
55 eerror " <*> Universal TUN/TAP device driver support"
56 eerror
57 eerror "and recompile your kernel ..."
58 die "no CONFIG_TUN support detected!"
59 fi
60 eend $?
61 }
62
63 pkg_setup() {
64 java-pkg-opt-2_pkg_setup
65
66 if use doc; then
67 python-any-r1_pkg_setup
68 fi
69
70 if use kernel_linux; then
71 get_version
72 if linux_config_exists; then
73 tun_tap_check
74 else
75 ewarn "Was unable to determine your kernel .config"
76 ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
77 ewarn "kernel .config, Without it, it will not work correctly."
78 # We don't die here, so it's possible to compile this package without
79 # kernel sources available. Required for cross-compilation.
80 fi
81 fi
82 }
83
84 src_configure() {
85 strip-linguas $ILINGUAS
86 echo ${LINGUAS} > po/LINGUAS
87 if ! use doc; then
88 # If the python cannot be found, the docs will not build
89 sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
90 fi
91
92 # stoken and liboath not in portage
93 econf \
94 --with-vpnc-script="${EPREFIX}/etc/openconnect/openconnect.sh" \
95 $(use_enable static-libs static) \
96 $(use_enable nls ) \
97 $(use_with !gnutls openssl) \
98 $(use_with gnutls ) \
99 $(use_with libproxy) \
100 --without-stoken \
101 $(use_with gssapi) \
102 $(use_with java)
103 }
104
105 DOC_CONTENTS="The init script for openconnect supports multiple vpn tunnels.
106
107 You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d
108 instead of calling it directly:
109
110 ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0
111
112 You can then start the vpn tunnel like this:
113
114 /etc/init.d/openconnect.vpn0 start
115
116 If you would like to run preup, postup, predown, and/or postdown scripts,
117 You need to create a directory in /etc/openconnect with the name of the vpn:
118
119 mkdir /etc/openconnect/vpn0
120
121 Then add executable shell files:
122
123 mkdir /etc/openconnect/vpn0
124 cd /etc/openconnect/vpn0
125 echo '#!/bin/sh' > preup.sh
126 cp preup.sh predown.sh
127 cp preup.sh postup.sh
128 cp preup.sh postdown.sh
129 chmod 755 /etc/openconnect/vpn0/*
130 "
131
132 src_install() {
133 emake DESTDIR="${D}" install
134
135 dodoc AUTHORS TODO
136 newinitd "${FILESDIR}"/openconnect.init.in-r4 openconnect
137 dodir /etc/openconnect
138 insinto /etc/openconnect
139 newconfd "${FILESDIR}"/openconnect.conf.in openconnect
140 exeinto /etc/openconnect
141 newexe "${WORKDIR}"/vpnc-scripts-${VPNC_VER}/vpnc-script openconnect.sh
142 insinto /etc/logrotate.d
143 newins "${FILESDIR}"/openconnect.logrotate openconnect
144 keepdir /var/log/openconnect
145
146 # Remove useless .la files
147 prune_libtool_files --all
148
149 readme.gentoo_create_doc
150 }
151
152 pkg_postinst() {
153 readme.gentoo_print_elog
154 if [[ -z ${REPLACING_VERSIONS} ]]; then
155 elog
156 elog "You may want to consider installing the following optional packages."
157 optfeature "resolvconf support" net-dns/openresolv
158 fi
159 }

  ViewVC Help
Powered by ViewVC 1.1.20