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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Dec 22 19:21:06 2012 UTC (6 years, 11 months ago) by hwoarang
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove old

(Portage version: 2.1.11.37/cvs/Linux x86_64, signed Manifest commit with key B4AFF2C2)

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

  ViewVC Help
Powered by ViewVC 1.1.20