blob: 54decb6b15725fac8dea5e605b09652affddbf35 (
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/nxserver-2xterminalserver/nxserver-2xterminalserver-1.5.0.ebuild,v 1.5 2007/06/11 11:58:59 voyageur Exp $
inherit flag-o-matic eutils
DESCRIPTION="GPL NX server, based on NoMachine 1.5 servers source code"
HOMEPAGE="http://www.2x.com/terminalserver/"
SRC_URI="http://code.2x.com/release/linuxterminalserver/src/linuxterminalserver-1.5.0-server-r21-src.tar.gz
http://code.2x.com/release/linuxterminalserver/src/linuxterminalserver-1.5.0-common-r21-src.tar.gz
http://code.2x.com/release/linuxterminalserver/src/linuxterminalserver-1.5.0-client-r21-src.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="rdesktop vnc"
RDEPEND="dev-libs/glib
dev-libs/openssl
dev-perl/BSD-Resource
dev-perl/DBD-SQLite
dev-perl/DBI
dev-perl/Error
dev-perl/GDGraph
dev-perl/Passwd-Linux
dev-perl/Unix-Syslog
media-libs/jpeg
media-libs/libpng
sys-libs/zlib
x11-libs/libICE
x11-libs/libXmu
x11-libs/libXdmcp
x11-libs/libSM
x11-libs/libXt
x11-libs/libXau
x11-libs/libXaw
x11-libs/libXp
x11-libs/libXpm
x11-libs/libXext
media-fonts/font-misc-misc
media-fonts/font-cursor-misc
x11-apps/xauth"
DEPEND="${RDEPEND}
app-text/rman
net-misc/nxclient-2xterminalserver
x11-misc/gccmakedep
x11-misc/imake
x11-proto/xproto
x11-proto/xextproto
x11-proto/fontsproto
!net-misc/nxserver-freeedition
!net-misc/nxserver-freenx"
S="${WORKDIR}"
pkg_preinst() {
enewuser nx -1 -1 /usr/NX/home/nx
}
src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/1.5.0/nx-x11-1.5.0-amd64.patch || die
epatch ${FILESDIR}/1.5.0/nx-x11-1.5.0-plastik-render-fix.patch || die
epatch ${FILESDIR}/1.5.0/nx-x11-1.5.0-tmp-exec.patch || die
epatch ${FILESDIR}/1.5.0/nx-x11-1.5.0-xorg7-font-fix.patch || die
epatch ${FILESDIR}/1.5.0/nx-x11-1.5.0-windows-linux-resume.patch || die
epatch ${FILESDIR}/1.5.0/${P}-insitu.patch || die
epatch ${FILESDIR}/1.5.0/${P}-external-nxcomp.patch || die
epatch ${FILESDIR}/1.5.0/${P}-setup.patch || die
epatch ${FILESDIR}/1.5.0/${P}-perl.patch || die
epatch ${FILESDIR}/1.5.0/${P}-nxagent-reduced-debugging.patch || die
sed -i 's/-Wnested-externs/-Wnested-externs -fPIC/' \
common/nxcompext/Makefile.in || die "sed failed"
# Set correct product name
einfo "Setting official product name"
find server/nxnode common/nx-X11/programs/Xserver/hw/nxagent/Args.c \
-type f -exec sed -i "s/@PRODUCT_NAME@/2X TerminalServer/g" {} \;
}
src_compile() {
cd ${S}/common/nxcompext
append-ldflags "-L/usr/NX/lib"
econf || die
emake || die
cd ${S}/common/nx-X11
emake World || die
if use rdesktop; then
cd ${S}/client/nxdesktop
CC=(tc-getCC) ./configure || die
emake || die
fi
if use vnc; then
cd ${S}/server/nxviewer
xmkmf -a || die
emake World || die
fi
cd ${S}/server/nxspool/source
econf --without-ldap --without-krb5 || die
# We can't use emake here - it doesn't trigger the right target
# for some reason
make || die
cd ${S}/server/nxsensor
emake glib12=1 || die
cd ${S}/server/nxuexec
emake || die
cd ${S}/server/nxnode/src
./configure || die
make setversion
make nxnode.pl nxserver.pl || die
perl MakeConfigFile.pl DEBIAN > node-gentoo.cfg.sample
}
src_install() {
NODE_SRC=${S}/server/nxnode/src
# Main binaries
into /usr/NX
dobin ${S}/common/nx-X11/programs/Xserver/nxagent
dobin ${S}/server/nxsensor/nxsensor
dobin ${S}/server/nxnode/setup/nxsetup
newbin ${S}/server/nxspool/source/bin/smbspool nxspool
dobin ${S}/server/nxuexec/nxuexec
if use rdesktop; then
dobin ${S}/client/nxdesktop/nxdesktop
fi
if use vnc; then
dobin ${S}/server/nxviewer/nxviewer/nxviewer
dobin ${S}/server/nxviewer/nxpasswd/nxpasswd
fi
# Libraries
dodir /usr/NX/lib
cp -P ${S}/common/nxcompext/libXcompext.so* \
${S}/common/nx-X11/lib/X11/libX11.so* ${D}/usr/NX/lib || die
# And helper scripts
exeinto /usr/NX/scripts
newexe ${S}/server/nxnode/bin/nxnodeenv.sh nxenv.sh
newexe ${S}/server/nxnode/bin/nxnodeenv.csh nxenv.csh
exeinto /usr/NX/scripts/restricted
doexe ${S}/server/nxnode/bin/nxaddinitd.sh
doexe ${S}/server/nxnode/scripts/nxinit.sh
newexe ${S}/server/nxnode/bin/nxprinter.sh-LINUX nxprinter.sh
doexe ${S}/server/nxnode/bin/nxsessreg.sh
doexe ${S}/server/nxnode/bin/nxuseradd.sh
# The server itself (and wrappers and perl modules)
dobin ${NODE_SRC}/nxnode.pl
dobin ${NODE_SRC}/nxserver.pl
make_wrapper nxnode "perl -I/usr/NX/lib/perl /usr/NX/bin/nxnode.pl" /usr/NX/bin /usr/NX/lib /usr/NX/bin
make_wrapper nxserver "perl -I/usr/NX/lib/perl /usr/NX/bin/nxserver.pl" /usr/NX/bin /usr/NX/lib /usr/NX/bin
dodir /usr/NX/lib/perl
cp -RH ${NODE_SRC}/*.pm ${NODE_SRC}/Config ${NODE_SRC}/Exception \
${NODE_SRC}/NXShellDialogs ${NODE_SRC}/handlers ${NODE_SRC}/nxstat \
${D}/usr/NX/lib/perl/ || die
# etc, var, home, ...
dodir /usr/NX/etc/keys
for x in passwords users administrators; do
cp ${S}/server/nxnode/etc/${x} ${D}/usr/NX/etc/${x}.db.sample
done
cp ${NODE_SRC}/node-gentoo.cfg.sample ${D}/usr/NX/etc/ || die
# share/keys/server.id_dsa.key is installed with the client
dodir /usr/NX/share/keys
for x in config fonts keymaps; do
cp -R ${S}/server/nxnode/share/${x} ${D}/usr/NX/share/ || die
done
cp ${S}/server/nxnode/share/keys/default.id_dsa.key \
${D}/usr/NX/share/keys/ ||die
cp -R ${S}/server/nxnode/home ${D}/usr/NX || die
keepdir /usr/NX/var/log
keepdir /usr/NX/var/run
keepdir /usr/NX/var/db/closed
keepdir /usr/NX/var/db/failed
keepdir /usr/NX/var/db/nxstat
keepdir /usr/NX/var/db/running
}
pkg_postinst() {
usermod -s /usr/NX/bin/nxserver nx || die "Unable to set login shell of nx user!!"
usermod -d /usr/NX/home/nx nx || die "Unable to set home directory of nx user!!"
# Workaround fonts link
if has_version '>=x11-base/xorg-x11-7.0' && ! [ -e /usr/lib/X11/fonts ];
then
ln -s /usr/share/fonts /usr/lib/X11/fonts
fi
# only run install when no configuration file is found
if [ -f /usr/NX/etc/node.cfg ]; then
einfo "Running 2X update script"
${ROOT}/usr/NX/bin/nxsetup --update
else
einfo "Running 2X setup script"
${ROOT}/usr/NX/bin/nxsetup --install
fi
}
|