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/nxserver-freeedition/nxserver-freeedition-3.3.0.14.ebuild,v 1.2 2009/04/04 15:09:48 maekke Exp $ |
4 |
|
5 |
inherit eutils versionator |
6 |
|
7 |
MAJOR_PV="$(get_version_component_range 1-3)" |
8 |
FULL_PV="${MAJOR_PV}-$(get_version_component_range 4)" |
9 |
DESCRIPTION="Free edition NX server from NoMachine" |
10 |
HOMEPAGE="http://www.nomachine.com/" |
11 |
SRC_URI="amd64? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/FE/nxserver-${FULL_PV}.x86_64.tar.gz ) |
12 |
x86? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/FE/nxserver-${FULL_PV}.i386.tar.gz )" |
13 |
|
14 |
LICENSE="nomachine" |
15 |
SLOT="0" |
16 |
KEYWORDS="-* amd64 x86" |
17 |
IUSE="" |
18 |
RESTRICT="strip" |
19 |
|
20 |
DEPEND="=net-misc/nxnode-3.3* |
21 |
!net-misc/nxserver-freenx |
22 |
!net-misc/nxserver-2xterminalserver" |
23 |
RDEPEND="${DEPEND} |
24 |
media-fonts/font-misc-misc |
25 |
media-fonts/font-cursor-misc |
26 |
x11-apps/xauth" |
27 |
|
28 |
S="${WORKDIR}"/NX |
29 |
|
30 |
pkg_preinst() |
31 |
{ |
32 |
enewuser nx -1 -1 /usr/NX/home/nx |
33 |
} |
34 |
|
35 |
src_unpack() |
36 |
{ |
37 |
unpack ${A} |
38 |
cd "${S}" |
39 |
epatch "${FILESDIR}"/nxserver-3.0.0-r4-setup.patch |
40 |
epatch "${FILESDIR}"/nxserver-${MAJOR_PV}-dontupdatekeys.patch |
41 |
} |
42 |
|
43 |
src_install() |
44 |
{ |
45 |
# we install nxserver into /usr/NX, to make sure it doesn't clash |
46 |
# with libraries installed for FreeNX |
47 |
|
48 |
into /usr/NX |
49 |
dobin bin/nxserver |
50 |
|
51 |
dodir /usr/NX/etc/keys |
52 |
insinto /usr/NX/etc |
53 |
doins etc/administrators.db.sample |
54 |
doins etc/guests.db.sample |
55 |
doins etc/passwords.db.sample |
56 |
doins etc/profiles.db.sample |
57 |
doins etc/users.db.sample |
58 |
doins etc/server.lic.sample |
59 |
|
60 |
newins etc/server-debian.cfg.sample server-gentoo.cfg.sample |
61 |
|
62 |
cp -R home "${D}"/usr/NX || die "Unable to install home folder" |
63 |
cp -R lib "${D}"/usr/NX || die "Unable to install lib folder" |
64 |
cp -R scripts "${D}"/usr/NX || die "Unable to install scripts folder" |
65 |
cp -R share "${D}"/usr/NX || die "Unable to install share folder" |
66 |
cp -R var "${D}"/usr/NX || die "Unable to install var folder" |
67 |
|
68 |
newinitd "${FILESDIR}"/nxserver-2.1.0-init nxserver |
69 |
} |
70 |
|
71 |
pkg_postinst () |
72 |
{ |
73 |
usermod -s /usr/NX/bin/nxserver nx || die "Unable to set login shell of nx user!!" |
74 |
usermod -d /usr/NX/home/nx nx || die "Unable to set home directory of nx user!!" |
75 |
|
76 |
# only run install when no configuration file is found |
77 |
if [ -f /usr/NX/etc/server.cfg ]; then |
78 |
einfo "Running NoMachine's update script" |
79 |
"${ROOT}"/usr/NX/scripts/setup/nxserver --update || die "Update script failed" |
80 |
else |
81 |
einfo "Running NoMachine's setup script" |
82 |
"${ROOT}"/usr/NX/scripts/setup/nxserver --install || die "Installation script failed" |
83 |
fi |
84 |
|
85 |
elog "Remember to add nxserver to your default runlevel" |
86 |
} |