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/nxserver-freeedition/nxserver-freeedition-3.5.0.5.ebuild,v 1.5 2012/07/12 08:51:13 voyageur Exp $ |
4 |
|
5 |
EAPI=2 |
6 |
inherit eutils user versionator |
7 |
|
8 |
MAJOR_PV="$(get_version_component_range 1-3)" |
9 |
FULL_PV="${MAJOR_PV}-$(get_version_component_range 4)" |
10 |
DESCRIPTION="Free edition NX server from NoMachine" |
11 |
HOMEPAGE="http://www.nomachine.com/" |
12 |
SRC_URI="amd64? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/FE/nxserver-${FULL_PV}.x86_64.tar.gz ) |
13 |
x86? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/FE/nxserver-${FULL_PV}.i386.tar.gz )" |
14 |
|
15 |
# GPL-2 for Gentoo init script |
16 |
LICENSE="nomachine GPL-2" |
17 |
SLOT="0" |
18 |
KEYWORDS="-* amd64 x86" |
19 |
IUSE="" |
20 |
RESTRICT="strip" |
21 |
|
22 |
DEPEND="=net-misc/nxnode-${MAJOR_PV}*" |
23 |
RDEPEND="${DEPEND} |
24 |
media-fonts/font-misc-misc |
25 |
media-fonts/font-cursor-misc |
26 |
x11-apps/xauth |
27 |
x11-apps/xhost" |
28 |
|
29 |
S="${WORKDIR}"/NX |
30 |
|
31 |
pkg_preinst() { |
32 |
enewuser nx -1 -1 /usr/NX/home/nx |
33 |
} |
34 |
|
35 |
src_prepare() { |
36 |
epatch "${FILESDIR}"/nxserver-3.0.0-r4-setup.patch |
37 |
epatch "${FILESDIR}"/nxserver-3.3.0-dontupdatekeys.patch |
38 |
} |
39 |
|
40 |
src_install() { |
41 |
# we install nxserver into /usr/NX, to make sure it doesn't clash |
42 |
# with libraries installed for FreeNX |
43 |
|
44 |
into /usr/NX |
45 |
dobin bin/nxserver |
46 |
|
47 |
dodir /usr/NX/etc/keys |
48 |
insinto /usr/NX/etc |
49 |
doins etc/administrators.db.sample |
50 |
doins etc/guests.db.sample |
51 |
doins etc/passwords.db.sample |
52 |
doins etc/profiles.db.sample |
53 |
doins etc/users.db.sample |
54 |
doins etc/server.lic.sample |
55 |
|
56 |
newins etc/server-debian.cfg.sample server-gentoo.cfg.sample |
57 |
|
58 |
cp -R home "${D}"/usr/NX || die "Unable to install home folder" |
59 |
cp -R lib "${D}"/usr/NX || die "Unable to install lib folder" |
60 |
cp -R scripts "${D}"/usr/NX || die "Unable to install scripts folder" |
61 |
cp -R share "${D}"/usr/NX || die "Unable to install share folder" |
62 |
cp -R var "${D}"/usr/NX || die "Unable to install var folder" |
63 |
|
64 |
newinitd "${FILESDIR}"/nxserver-2.1.0-init nxserver |
65 |
} |
66 |
|
67 |
pkg_postinst () { |
68 |
# Other NX servers ebuilds may have already created the nx account |
69 |
# However they use different login shell/home directory paths |
70 |
if [[ ${ROOT} == "/" ]]; then |
71 |
usermod -s /usr/NX/bin/nxserver nx || die "Unable to set login shell of nx user!!" |
72 |
usermod -d /usr/NX/home/nx nx || die "Unable to set home directory of nx user!!" |
73 |
else |
74 |
elog "If you had another NX server installed before, please make sure" |
75 |
elog "the nx user account is correctly set to:" |
76 |
elog " * login shell: /usr/NX/bin/nxserver" |
77 |
elog " * home directory: /usr/NX/home/nx" |
78 |
fi |
79 |
|
80 |
# only run install when no configuration file is found |
81 |
if [ -f /usr/NX/etc/server.cfg ]; then |
82 |
einfo "Running NoMachine's update script" |
83 |
"${ROOT}"/usr/NX/scripts/setup/nxserver --update || die "Update script failed" |
84 |
else |
85 |
einfo "Running NoMachine's setup script" |
86 |
"${ROOT}"/usr/NX/scripts/setup/nxserver --install || die "Installation script failed" |
87 |
fi |
88 |
|
89 |
if ! has_version net-misc/openssh[pam]; then |
90 |
elog "" |
91 |
elog "net-misc/openssh was not built with PAM support" |
92 |
elog "You will need to unlock the nx account by setting a password for it" |
93 |
fi |
94 |
|
95 |
elog "Remember to add nxserver to your default runlevel" |
96 |
} |