| 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/nxnode/nxnode-3.5.0.9.ebuild,v 1.1 2012/06/07 22:51:16 voyageur Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils user versionator
|
| 8 |
|
| 9 |
MAJOR_PV="$(get_version_component_range 1-3)"
|
| 10 |
FULL_PV="${MAJOR_PV}-$(get_version_component_range 4)"
|
| 11 |
DESCRIPTION="shared components between the different editions of NoMachine's NX Servers"
|
| 12 |
HOMEPAGE="http://www.nomachine.com/"
|
| 13 |
SRC_URI="amd64? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/nxnode-${FULL_PV}.x86_64.tar.gz )
|
| 14 |
x86? ( http://64.34.161.181/download/${MAJOR_PV}/Linux/nxnode-${FULL_PV}.i386.tar.gz )"
|
| 15 |
|
| 16 |
# GPL-2 for Gentoo init script
|
| 17 |
LICENSE="nomachine GPL-2"
|
| 18 |
SLOT="0"
|
| 19 |
KEYWORDS="-* ~amd64 ~x86"
|
| 20 |
IUSE="rdesktop vnc"
|
| 21 |
RESTRICT="strip"
|
| 22 |
|
| 23 |
DEPEND=""
|
| 24 |
RDEPEND="=net-misc/nxclient-${MAJOR_PV}*[cups]
|
| 25 |
sys-process/lsof
|
| 26 |
x11-libs/libICE
|
| 27 |
x11-libs/libXmu
|
| 28 |
x11-libs/libSM
|
| 29 |
x11-libs/libXt
|
| 30 |
x11-libs/libXaw
|
| 31 |
x11-libs/libXpm
|
| 32 |
x11-apps/xrdb
|
| 33 |
rdesktop? ( net-misc/rdesktop )
|
| 34 |
vnc? ( x11-misc/x11vnc
|
| 35 |
net-misc/tightvnc )"
|
| 36 |
|
| 37 |
S=${WORKDIR}/NX
|
| 38 |
|
| 39 |
pkg_preinst()
|
| 40 |
{
|
| 41 |
enewuser nx -1 -1 /usr/NX/home/nx
|
| 42 |
}
|
| 43 |
|
| 44 |
src_prepare()
|
| 45 |
{
|
| 46 |
epatch "${FILESDIR}"/nxnode-3.4.0-setup.patch
|
| 47 |
epatch "${FILESDIR}"/nxnode-3.4.0-cups_path.patch
|
| 48 |
}
|
| 49 |
|
| 50 |
src_install()
|
| 51 |
{
|
| 52 |
# we install nxnode into /usr/NX, to make sure it doesn't clash
|
| 53 |
# with libraries installed for FreeNX
|
| 54 |
|
| 55 |
into /usr/NX
|
| 56 |
for x in nxagent nxnode nxsensor nxspool nxuexec ; do
|
| 57 |
dobin bin/$x
|
| 58 |
done
|
| 59 |
|
| 60 |
dodir /usr/NX/etc
|
| 61 |
cp etc/node-debian.cfg.sample "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die
|
| 62 |
sed -e 's|COMMAND_FUSER = .*|COMMAND_FUSER = "/usr/bin/fuser"|;' -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die
|
| 63 |
cp etc/node.lic.sample "${D}"/usr/NX/etc/node.lic.sample || die
|
| 64 |
|
| 65 |
dodir /usr/NX/lib
|
| 66 |
cp -R lib "${D}"/usr/NX || die
|
| 67 |
|
| 68 |
dodir /usr/NX/scripts
|
| 69 |
cp -R scripts "${D}"/usr/NX || die
|
| 70 |
|
| 71 |
dodir /usr/NX/share
|
| 72 |
cp -R share "${D}"/usr/NX || die
|
| 73 |
|
| 74 |
dodir /usr/NX/var
|
| 75 |
cp -R var "${D}"/usr/NX || die
|
| 76 |
|
| 77 |
dodir /etc/init.d
|
| 78 |
newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor
|
| 79 |
}
|
| 80 |
|
| 81 |
pkg_postinst()
|
| 82 |
{
|
| 83 |
# Only install license file if none is found
|
| 84 |
if [ ! -f /usr/NX/etc/node.lic ]; then
|
| 85 |
cp "${ROOT}"/usr/NX/etc/node.lic.sample "${ROOT}"/usr/NX/etc/node.lic || die
|
| 86 |
chmod 0400 "${ROOT}"/usr/NX/etc/node.lic
|
| 87 |
chown nx:0 "${ROOT}"/usr/NX/etc/node.lic
|
| 88 |
fi
|
| 89 |
|
| 90 |
# only run install on the first time
|
| 91 |
if [ -f /usr/NX/etc/node.cfg ]; then
|
| 92 |
einfo "Running NoMachine's update script"
|
| 93 |
"${ROOT}"/usr/NX/scripts/setup/nxnode --update
|
| 94 |
else
|
| 95 |
einfo "Running NoMachine's setup script"
|
| 96 |
"${ROOT}"/usr/NX/scripts/setup/nxnode --install
|
| 97 |
fi
|
| 98 |
|
| 99 |
elog "If you want server statistics, please add nxsensor to your default runlevel"
|
| 100 |
elog
|
| 101 |
elog " rc-update add nxsensor default"
|
| 102 |
elog
|
| 103 |
elog "You will also need to change EnableSensor to 1 in /usr/NX/etc/node.cfg"
|
| 104 |
}
|