summaryrefslogtreecommitdiff
blob: 78986a6319a194ddb691dbabeef1ae7c44d70bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.00.0490.ebuild,v 1.9 2007/08/28 20:58:08 wolf31o2 Exp $

inherit eutils linux-mod

MY_PV=${PV}-k9
TARBALL="vpnclient-linux-x86_64-${MY_PV}.tar.gz"

DESCRIPTION="Cisco VPN Client (3DES)"
HOMEPAGE="http://cco.cisco.com/en/US/products/sw/secursw/ps2308/index.html"
#SRC_URI="vpnclient-linux-x86_64-${MY_PV}.tar.gz"
SRC_URI="http://tuxx-home.at/vpn/Linux/${TARBALL}"

LICENSE="cisco-vpn-client"
SLOT="0"
KEYWORDS="-* amd64 x86"
IUSE=""
RESTRICT="strip"

S=${WORKDIR}/vpnclient

VPNDIR="/opt/cisco-vpnclient"
CFGDIR="/etc/${VPNDIR}"
OLDCFG="/etc/CiscoSystemsVPNClient"

QA_TEXTRELS="${VPNDIR:1}/lib/libvpnapi.so"
QA_EXECSTACK="${VPNDIR:1}/lib/libvpnapi.so
	${VPNDIR:1}/bin/vpnclient
	${VPNDIR:1}/bin/cvpnd
	${VPNDIR:1}/bin/cisco_cert_mgr
	${VPNDIR:1}/bin/ipseclog"

MODULE_NAMES="cisco_ipsec(CiscoVPN)"
BUILD_TARGETS="clean default"

#pkg_nofetch() {
#	einfo "Please visit:"
#	einfo " ${HOMEPAGE}"
#	einfo "and download ${A} to ${DISTDIR}"
#}

src_unpack () {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}"/${PV}-amd64.patch
	epatch "${FILESDIR}"/${PV}-2.6.24.patch
}

src_install() {
	linux-mod_src_install
#	newinitd ${FILESDIR}/vpnclient.rc vpnclient

	# Binaries
	exeinto /opt/cisco-vpnclient/bin
	exeopts -m0111
	doexe vpnclient ipseclog cisco_cert_mgr
	exeopts -m4111
	doexe cvpnd
	# Libraries
	insinto /opt/cisco-vpnclient/lib
	doins libvpnapi.so
	# Includes
	insinto /opt/cisco-vpnclient/include
	doins vpnapi.h

	# Configuration files/profiles/etc
	insinto ${CFGDIR}
	doins vpnclient.ini
	insinto ${CFGDIR}/Profiles
	doins *.pcf
	dodir ${CFGDIR}/Certificates
	keepdir ${CFGDIR}/Certificates
	keepdir ${CFGDIR}/Profiles
}

pkg_postinst() {
	linux-mod_pkg_postinst
	if [ -e "${OLDCFG}" ]
	then
		elog "Found an old ${OLDCFG} configuration directory."
		elog "Moving ${OLDCFG} files to ${CFGDIR}."
		cp -pPR ${OLDCFG}/* ${CFGDIR} && rm -f ${OLDCFG}
	fi
	if [ -e "/etc/init.d/vpnclient" ]
	then
		elog "Removing /etc/init.d/vpnclient, which is no longer needed."
		rm -f /etc/init.d/vpnclient
	fi
	runlevels=`rc-update show | grep vpnclient | cut -d\| -f2`
	if [ -n "$runlevels" ]
	then
		elog "Removing 'vpnclient' from all runlevels."
		rc-update del vpnclient
	fi
	elog "You will need to load the cisco_ipsec module before using the Cisco"
	elog "VPN Client (vpnclient) application."
}