1 |
# Copyright 1999-2009 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.01.0640.ebuild,v 1.5 2009/07/07 23:15:46 flameeyes Exp $ |
4 |
|
5 |
inherit eutils linux-mod |
6 |
|
7 |
MY_PV=${PV}-k9 |
8 |
|
9 |
DESCRIPTION="Cisco VPN Client (3DES)" |
10 |
HOMEPAGE="http://cco.cisco.com/en/US/products/sw/secursw/ps2308/index.html" |
11 |
SRC_URI="vpnclient-linux-x86_64-${MY_PV}.tar.gz" |
12 |
|
13 |
LICENSE="cisco-vpn-client" |
14 |
SLOT="0" |
15 |
KEYWORDS="-* ~amd64 ~x86" |
16 |
IUSE="" |
17 |
RESTRICT="fetch mirror strip" |
18 |
|
19 |
S=${WORKDIR}/vpnclient |
20 |
|
21 |
VPNDIR="/opt/cisco-vpnclient" |
22 |
CFGDIR="/etc/${VPNDIR}" |
23 |
OLDCFG="/etc/CiscoSystemsVPNClient" |
24 |
|
25 |
QA_TEXTRELS="${VPNDIR:1}/lib/libvpnapi.so" |
26 |
QA_EXECSTACK="${VPNDIR:1}/lib/libvpnapi.so |
27 |
${VPNDIR:1}/bin/vpnclient |
28 |
${VPNDIR:1}/bin/cvpnd |
29 |
${VPNDIR:1}/bin/cisco_cert_mgr |
30 |
${VPNDIR:1}/bin/ipseclog" |
31 |
|
32 |
MODULE_NAMES="cisco_ipsec(CiscoVPN)" |
33 |
BUILD_TARGETS="clean default" |
34 |
|
35 |
pkg_nofetch() { |
36 |
elog "Please visit:" |
37 |
elog " ${HOMEPAGE}" |
38 |
elog "and download ${A} to ${DISTDIR}" |
39 |
} |
40 |
|
41 |
src_unpack () { |
42 |
unpack ${A} |
43 |
cd "${S}" |
44 |
|
45 |
epatch "${FILESDIR}"/${PV}-amd64.patch |
46 |
epatch "${FILESDIR}"/${PV}-2.6.24.patch |
47 |
} |
48 |
|
49 |
src_install() { |
50 |
local binaries="vpnclient ipseclog cisco_cert_mgr" |
51 |
linux-mod_src_install |
52 |
|
53 |
# Binaries |
54 |
exeinto /opt/cisco-vpnclient/bin |
55 |
exeopts -m0111 |
56 |
doexe ${binaries} |
57 |
exeopts -m4111 |
58 |
doexe cvpnd |
59 |
# Libraries |
60 |
insinto /opt/cisco-vpnclient/lib |
61 |
doins libvpnapi.so |
62 |
# Includes |
63 |
insinto /opt/cisco-vpnclient/include |
64 |
doins vpnapi.h |
65 |
|
66 |
# Configuration files/profiles/etc |
67 |
insinto ${CFGDIR} |
68 |
doins vpnclient.ini |
69 |
insinto ${CFGDIR}/Profiles |
70 |
doins *.pcf |
71 |
dodir ${CFGDIR}/Certificates |
72 |
|
73 |
# Create some symlinks |
74 |
dodir /usr/bin |
75 |
for filename in ${binaries} |
76 |
do |
77 |
dosym ${VPNDIR}/bin/${filename} /usr/bin/${filename} |
78 |
done |
79 |
|
80 |
# Make sure we keep these, even if they're empty. |
81 |
keepdir ${CFGDIR}/Certificates |
82 |
keepdir ${CFGDIR}/Profiles |
83 |
} |
84 |
|
85 |
pkg_postinst() { |
86 |
linux-mod_pkg_postinst |
87 |
if [ -e "${OLDCFG}" ] |
88 |
then |
89 |
elog "Found an old ${OLDCFG} configuration directory." |
90 |
elog "Moving ${OLDCFG} files to ${CFGDIR}." |
91 |
cp -pPR ${OLDCFG}/* ${CFGDIR} && rm -rf ${OLDCFG} |
92 |
fi |
93 |
if [ -e "/etc/init.d/vpnclient" ] |
94 |
then |
95 |
elog "Removing /etc/init.d/vpnclient, which is no longer needed." |
96 |
rm -f /etc/init.d/vpnclient |
97 |
fi |
98 |
runlevels=`rc-update show | grep vpnclient | cut -d\| -f2` |
99 |
if [ -n "$runlevels" ] |
100 |
then |
101 |
elog "Removing 'vpnclient' from all runlevels." |
102 |
rc-update del vpnclient |
103 |
fi |
104 |
elog "You will need to load the cisco_ipsec module before using the Cisco" |
105 |
elog "VPN Client (vpnclient) application." |
106 |
} |