summaryrefslogtreecommitdiff
blob: 3d8d7497df799bc4964069f2e429e9b2fb201ddd (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/parallels-workstation/parallels-workstation-2.2.2112-r2.ebuild,v 1.1 2008/02/07 15:43:49 cardoe Exp $

inherit eutils

S=${WORKDIR}/parallels-${PV}-lin
DESCRIPTION="Virtual machine software that runs multiple operating systems and their applications simultaneously on a single PC."
HOMEPAGE="http://www.parallels.com"
SRC_URI="http://download.parallels.com/GA/Parallels-${PV}-lin.tgz"

LICENSE="Parallels"
SLOT="0"
KEYWORDS="-* ~x86"
RESTRICT="strip"

DEPEND="virtual/os-headers
	=x11-libs/qt-3*
	>=sys-libs/libstdc++-v3-3.0.0
"
destdir=/usr/lib/parallels

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

	epatch "${FILESDIR}"/${PN}-2.2.2112-2.6.23.patch
}

src_install() {
	dodoc data/doc/README data/doc/INSTALL data/doc/LICENSE

	dodir ${destdir}/doc
	insinto ${destdir}/doc
	doins data/doc/README data/doc/INSTALL data/doc/LICENSE

	insinto ${destdir}
	doins data/*

	dodir ${destdir}/bugreports
	fperms 1777 ${destdir}/bugreports

	touch ${destdir}/.parallels_common_options
	fperms 666 ${destdir}/.parallels_common_options
	touch ${destdir}/.parallels_license
	fperms 666 ${destdir}/.parallels_license
	touch ${destdir}/.not_configured

	dosym ${destdir}/parallels /usr/bin/parallels
	dosym ${destdir}/imagetool /usr/bin/imagetool
	dosym ${destdir}/parallels-config /usr/bin/parallels-config

	dosym /usr/bin/parallels /usr/bin/Parallels
	dosym /usr/bin/parallels-config /usr/bin/Parallels-config

	newinitd "${FILESDIR}"/parallels.rc parallels
}

pkg_preinst() {
	running=`rc-status -s | grep parallels | grep started`
	if [[ $running != "" ]]; then
		/etc/init.d/parallels stop
	fi
}

pkg_postinst() {
	rm -f $destdir/.ereaded

	$destdir/tools/mimelink associate 2> /dev/null
	chmod 06555 $destdir/parallels-linux

	echo
	elog "You should configure ${PN} ${PV}"
	elog "before starting it for the first time."
	elog "Issue \"parallels-config\" command."
	echo
}

pkg_postrm() {
	if [ -e $destdir/Makefile ]; then
		make -C $destdir clean distclean > /dev/null 2>&1
	fi
}