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

Contents of /net-misc/openconnect/openconnect-4.07-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Mar 26 12:03:32 2013 UTC (6 years, 8 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Remove old

(Portage version: 2.1.11.55/cvs/Linux x86_64, signed Manifest commit with key 7194459F)

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

  ViewVC Help
Powered by ViewVC 1.1.20