Magellan Linux

Annotation of /trunk/deprecated/nxserver-freeedition/nxserver-freeedition-4.0.181-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12139 - (hide annotations) (download)
Tue May 8 11:22:08 2012 UTC (12 years, 1 month ago) by niro
Original Path: trunk/extras/nxserver-freeedition/nxserver-freeedition-4.0.181-r2.smage2
File size: 15346 byte(s)
-do not install libcrypto and libssl, use system-wide libs or sshd may fail
1 niro 12138 # $Id$
2    
3     PNAME="nxserver-freeedition"
4     PVER="4.0.181"
5     PBUILD="r2"
6    
7     PCAT="net-misc"
8     SPLIT_PACKAGES="nxcommon nxclient nxplayer nxnode nxserver-freeedition nxmanager nxwebplayer"
9    
10     STATE="unstable"
11     HOMEPAGE="http://www.nomachine.com/"
12    
13     # use system-wide libs or include the provided one
14     # 1=enabled, 0=disabled
15     USE_SYSTEMWIDE_LIBS=0
16    
17     COMMON_DEPEND=">= virtual/glibc
18     >= sys-libs/libgcc-4.6
19     >= sys-libs/libstdc++-4.6"
20     CLIENT_DEPEND="${COMMON_DEPEND}"
21     if [[ ${USE_SYSTEMWIDE_LIBS} = 1 ]]
22     then
23     CLIENT_DEPEND="${COMMON_DEPEND}
24     >= dev-libs/expat-2
25     >= dev-libs/openssl-1
26     >= media-libs/alsa-lib-1.0.25
27     >= media-libs/fontconfig-2.9
28     >= media-libs/giflib-4.1
29     >= media-libs/libtheora-1.1
30     >= media-libs/libvorbis-1.3
31     >= media-libs/speex-1.1
32     >= sys-libs/zlib-1.2
33     >= x11-libs/libfontenc-1.1"
34     fi
35     # todo: gdsu
36     NODE_DEPEND="${COMMON_DEPEND}
37     >= sys-apps/gawk-4.0
38     >= sys-apps/coreutils-8
39     >= sys-apps/lsof-4.86
40     >= sys-apps/sed-4
41     >= sys-apps/procps-3.2
42     >= sys-apps/sysvinit-tools-2.88
43     >= x11-apps/xdpyinfo-1.3
44     >= x11-apps/xmodmap-1
45     >= x11-apps/xkbcomp-1.2
46     >= net-misc/openssh-6.0
47     >= net-misc/rdesktop-1.7
48     >= virtual/vnc-client"
49    
50     SERVER_DEPEND="${COMMON_DEPEND}
51     >= x11-apps/xauth-1
52     >= media-fonts/font-misc-misc-1
53     >= media-fonts/font-cursor-misc-1"
54    
55     MANAGER_DEPEND="${COMMON_DEPEND}"
56     PLAYER_DEPEND="${COMMON_DEPEND}
57     >= media-sound/pulseaudio-x11-1.1"
58    
59     WEBPLAYER_DEPEND="${COMMON_DEPEND}"
60    
61     SDEPEND="${CLIENT_DEPEND}
62     ${NODE_DEPEND}
63     ${SERVER_DEPEND}
64     ${MANAGER_DEPEND}
65     ${PLAYER_DEPEND}
66     ${WEBPLAYER_DEPEND}"
67    
68     NXPVER="${PVER}-2"
69     SRCFILE_x86="nxserver-${NXPVER}.i686.tar.gz"
70     SRCFILE_x86_64="nxserver-${NXPVER}.x86_64.tar.gz"
71     SRCFILE="$(marchsrcfile)"
72     SRCDIR="${BUILDDIR}/NX"
73    
74     sminclude mtools xdg
75    
76     SRC_URI=(
77     http://64.34.161.181/download/${PVER%.*}/Linux/S/${SRCFILE_x86}
78     http://64.34.161.181/download/${PVER%.*}/Linux/S/${SRCFILE_x86_64}
79     mirror://${PNAME}/${SRCFILE_x86}
80     mirror://${PNAME}/${SRCFILE_x86_64}
81     mirror://${PNAME}/nxclient-wrapper
82     mirror://${PNAME}/${PNAME}-${PVER}-nxclient-magellan.patch
83     mirror://${PNAME}/${PNAME}-${PVER}-nxnode-magellan-2.patch
84     mirror://${PNAME}/${PNAME}-${PVER}-nxserver-magellan-2.patch
85     mirror://${PNAME}/${PNAME}-${PVER}-nxmanager-magellan.patch
86     mirror://${PNAME}/${PNAME}-${PVER}-nxplayer-magellan.patch
87     mirror://${PNAME}/${PNAME}-${PVER}-nxwebplayer-magellan.patch
88     )
89    
90     UP2DATE="updatecmd ${HOMEPAGE}/sources.php | grep nx-X11 | sed 's/.*nx-X11-\(.*\)-.*/\1/;q'"
91    
92     split_info_nxcommon()
93     {
94     DESCRIPTION="Common files for NX."
95     DEPEND=""
96     }
97    
98     split_info_nxclient()
99     {
100     DESCRIPTION="A client for NX servers."
101     DEPEND="== net-misc/nxcommon-${PVER}
102     ${CLIENT_DEPEND}"
103     }
104    
105     split_info_nxplayer()
106     {
107     DEPEND="== net-misc/nxcommon-${PVER}
108     == net-misc/nxclient-${PVER}
109     ${PLAYER_DEPEND}"
110     }
111    
112     split_info_nxnode()
113     {
114     DESCRIPTION="Shared NX components for several NX Server Editions."
115     # nxclient includes the server certificate requiered by nxnode
116     DEPEND="== net-misc/nxcommon-${PVER}
117     == net-misc/nxclient-${PVER}
118     ${NODE_DEPEND}"
119     }
120    
121     split_info_nxserver-freeedition()
122     {
123     DESCRIPTION="NoMachine NX Free Edition server."
124     DEPEND="== net-misc/nxcommon-${PVER}
125     == net-misc/nxnode-${PVER}
126     ${SERVER_DEPEND}"
127     }
128    
129     split_info_nxmanager()
130     {
131     DESCRIPTION="Webinterface to manage NX servers."
132     DEPEND="== net-misc/nxcommon-${PVER}
133     == net-misc/nxclient-${PVER}
134     == net-misc/nxnode-${PVER}
135     == net-misc/nxserver-freeedition-${PVER}
136     ${MANAGER_DEPEND}"
137     }
138    
139     split_info_nxwebplayer()
140     {
141     DEPEND="== net-misc/nxcommon-${PVER}
142     == net-misc/nxclient-${PVER}
143     == net-misc/nxnode-${PVER}
144     == net-misc/nxserver-freeedition-${PVER}
145     == net-misc/nxplayer-${PVER}
146     ${WEBPLAYER_DEPEND}"
147     }
148    
149     src_prepare()
150     {
151     munpack ${SRCFILE} || die
152     cd ${SRCDIR}
153    
154     # all packages are provided by this tarball
155     install -d ${SRCDIR}/src-nxclient || die
156     tar xvzf etc/NX/server/packages/nxclient.tar.gz -C src-nxclient || die
157    
158     install -d ${SRCDIR}/src-nxnode || die
159     tar xvzf etc/NX/server/packages/nxnode.tar.gz -C src-nxnode || die
160    
161     install -d ${SRCDIR}/src-nxserver || die
162     tar xvzf etc/NX/server/packages/nxserver.tar.gz -C src-nxserver || die
163    
164     install -d ${SRCDIR}/src-nxmanager || die
165     tar xvzf etc/NX/server/packages/nxmanager.tar.gz -C src-nxmanager || die
166    
167     install -d ${SRCDIR}/src-nxplayer || die
168     tar xvzf etc/NX/server/packages/nxplayer.tar.gz -C src-nxplayer || die
169    
170     install -d ${SRCDIR}/src-nxwebplayer || die
171     tar xvzf etc/NX/server/packages/nxwebplayer.tar.gz -C src-nxwebplayer || die
172    
173     # patch everything to be magellan compatible
174     cd ${SRCDIR}/src-nxclient
175     mpatch ${PNAME}-${PVER}-nxclient-magellan.patch || die
176    
177     cd ${SRCDIR}/src-nxnode
178     mpatch ${PNAME}-${PVER}-nxnode-magellan-2.patch || die
179    
180     cd ${SRCDIR}/src-nxserver
181     mpatch ${PNAME}-${PVER}-nxserver-magellan-2.patch || die
182    
183     cd ${SRCDIR}/src-nxmanager
184     mpatch ${PNAME}-${PVER}-nxmanager-magellan.patch || die
185    
186     cd ${SRCDIR}/src-nxplayer
187     mpatch ${PNAME}-${PVER}-nxplayer-magellan.patch || die
188    
189     cd ${SRCDIR}/src-nxwebplayer
190     mpatch ${PNAME}-${PVER}-nxwebplayer-magellan.patch || die
191     }
192    
193     src_install_nxcommon()
194     {
195     cd ${SRCDIR}
196     minstalldir /etc/env.d || die
197     local MCONFIG=/etc/env.d/50nx
198     mclearconfig || die
199     maddconfig 'NX_MPKG_PACKAGE="server"' || die
200     maddconfig 'CONFIG_PROTECT_MASK="/etc/NX"' || die
201     }
202    
203     src_install_nxclient()
204     {
205     cd ${SRCDIR}/src-nxclient/NX
206     local i
207    
208     # bin
209     minstalldir /usr/bin || die
210     minstalldir /usr/NX/bin || die
211     minstallexec bin/nxclient.bin /usr/NX/bin || die
212     for i in nxauth nxclient nxexec nxmpeg nxsh
213     do
214     minstallexec -s nxclient-wrapper /usr/bin/${i} || die
215     minstallexec bin/${i} /usr/NX/bin || die
216     done
217    
218     # libs
219     minstalldir /usr/NX/lib || die
220     for i in nx nxcomp nxcompau nxcompde nxcompim nxdisp nxdispfb nxdispft nxdispex nxslavcf
221     do
222     mcopy -a lib/lib${i}.so\* /usr/NX/lib || die
223     done
224     if [[ ${USE_SYSTEMWIDE_LIBS} = 0 ]]
225     then
226 niro 12139 # do not install libcrypto and libssl or the local ssh-server may fail
227     for i in asound expat fontconfig fontenc freetype gif jpeg ogg png qt \
228     speex speexdsp theora vorbis vorbisenc vorbisfile vpx z
229 niro 12138 do
230     mcopy -a lib/lib${i}.so\* /usr/NX/lib || die
231     done
232     fi
233    
234     # other components
235     mcopy -R scripts /usr/NX || die
236     mcopy -R share /usr/NX || die
237     # fix permissions
238     mchmod 0755 /usr/NX/scripts/setup/nxclient || die
239    
240     # global config
241     minstalldir /etc/NX/server/localhost || die
242     minstallfile scripts/etc/localhost/client.cfg /etc/NX/server/localhost || die
243    
244     # install some desktop icons
245     minstallpixmap share/icons/48x48/NoMachine-icon.png nxclient.png
246     minstall_desktop_icon \
247     --name NXClient \
248     --comment "NoMachine NX Client" \
249     --file "nxclient" \
250     --exec "nxclient" \
251     --icon "nxclient.png" \
252     --categories Network \
253     || die
254    
255     minstallpixmap share/icons/48x48/NoMachine-admin.png nxadmin.png
256     minstall_desktop_icon \
257     --name NXAdmin \
258     --comment "NoMachine NX Administration Console" \
259     --file "nxadmin" \
260     --exec "nxclient --admin" \
261     --icon "nxadmin.png" \
262     --categories Network \
263     || die
264    
265     minstallpixmap share/icons/48x48/NoMachine-icon.png nxwizard.png
266     minstall_desktop_icon \
267     --name NXWizard \
268     --comment "NoMachine NX Configuration Wizard" \
269     --file "nxwizard" \
270     --exec "nxclient --wizard" \
271     --icon "nxwizard.png" \
272     --categories Network \
273     || die
274     }
275    
276     src_install_nxnode()
277     {
278     cd ${SRCDIR}/src-nxnode/NX
279     local i
280    
281     # bin
282     minstalldir /usr/NX/bin || die
283     for i in nxadministrator{,.bin} nxagent nxkbcomp nxnode{,.bin} nxprint nxsensor nxspool
284     do
285     minstallexec bin/${i} /usr/NX/bin || die
286     done
287    
288     # other components
289     for i in home lib scripts share
290     do
291     mcopy -R ${i} /usr/NX || die
292     done
293     # fix permissions
294     mchown -R nx:root /usr/NX/home/nx || die
295     mchmod 0700 /usr/NX/home/nx || die
296     mchmod 0755 /usr/NX/scripts/setup/nxnode || die
297    
298     # etc
299     minstalldir /usr/NX/etc || die
300     minstallfile etc/node-magellan.cfg.sample /usr/NX/etc || die
301     minstallfile etc/node-magellan.cfg.sample.personal /usr/NX/etc || die
302     minstallfile etc/node.lic.sample /usr/NX/etc || die
303    
304     # global config
305     minstalldir /etc/NX/server/localhost || die
306     minstallfile scripts/etc/localhost/node.cfg /etc/NX/server/localhost || die
307     minstallexec scripts/etc/nxnode /etc/NX || die
308     }
309    
310     src_install_nxserver-freeedition()
311     {
312     cd ${SRCDIR}/src-nxserver/NX
313     local i
314    
315     # bin
316     minstalldir /usr/NX/bin || die
317     for i in nxhttpd{,.bin} nxserver{,.bin} nxstat{,.bin}
318     do
319     minstallexec bin/${i} /usr/NX/bin || die
320     done
321    
322     # other components
323     for i in lib scripts share var
324     do
325     mcopy -R ${i} /usr/NX || die
326     done
327     # fix permissions
328     mchmod 0755 /usr/NX/scripts/setup/nxserver || die
329    
330     # ssh-keys
331     minstalldir /usr/NX/etc || die
332     mcopy -R etc/keys /usr/NX/etc || die
333    
334     # http-server cert
335     minstallfile etc/httpd.crt /usr/NX/etc || die
336     minstallfile etc/httpd.key /usr/NX/etc || die
337    
338     # mimetypes and magic
339     minstallfile etc/magic /usr/NX/etc || die
340     minstallfile etc/mime.types /usr/NX/etc || die
341    
342     # some sample configs
343     minstallfile etc/administrators.db.sample /usr/NX/etc || die
344     minstallfile etc/guests.db.sample /usr/NX/etc || die
345     minstallfile etc/httpd.cfg.sample /usr/NX/etc || die
346     minstallfile etc/passwords.db.sample /usr/NX/etc || die
347     minstallfile etc/profiles.db.sample /usr/NX/etc || die
348     minstallfile etc/users.db.sample /usr/NX/etc || die
349     minstallfile etc/server.lic.sample /usr/NX/etc || die
350     minstallfile etc/server-magellan.cfg.sample /usr/NX/etc || die
351    
352     # global config
353     minstalldir /etc/NX/server/localhost || die
354     minstallfile scripts/etc/localhost/server.cfg /etc/NX/server/localhost || die
355     minstallexec scripts/etc/nxserver /etc/NX || die
356     }
357    
358     src_install_nxmanager()
359     {
360     cd ${SRCDIR}/src-nxmanager/NX
361     local i
362    
363     # bin
364     minstalldir /usr/NX/bin || die
365     for i in nxmanager{,.bin}
366     do
367     minstallexec bin/${i} /usr/NX/bin || die
368     done
369    
370     # other components
371     for i in lib scripts share var
372     do
373     mcopy -R ${i} /usr/NX || die
374     done
375     # fix permissions
376     mchmod 0755 /usr/NX/scripts/setup/nxmanager || die
377    
378     # configs
379     minstalldir /usr/NX/etc || die
380     minstallfile etc/manager.cfg.sample /usr/NX/etc || die
381     minstallfile etc/manager.inc.sample /usr/NX/etc || die
382    
383     # global config
384     minstalldir /etc/NX/server/localhost || die
385     minstallfile scripts/etc/localhost/manager.cfg /etc/NX/server/localhost || die
386     minstallexec scripts/etc/nxmanager /etc/NX || die
387     }
388    
389     src_install_nxplayer()
390     {
391     cd ${SRCDIR}/src-nxplayer/NX
392     local i
393    
394     # bin
395     minstalldir /usr/bin || die
396     minstalldir /usr/NX/bin || die
397     minstallexec bin/nxplayer.bin /usr/NX/bin || die
398     for i in nxesd nxplayer
399     do
400     minstallexec -s nxclient-wrapper /usr/bin/${i} || die
401     minstallexec bin/${i} /usr/NX/bin || die
402     done
403    
404     # other components
405     mcopy -R scripts /usr/NX || die
406     mcopy -R share /usr/NX || die
407     # fix permissions
408     mchmod 0755 /usr/NX/scripts/setup/nxplayer || die
409    
410     # global config
411     minstalldir /etc/NX/server/localhost || die
412     minstallfile scripts/etc/localhost/player.cfg /etc/NX/server/localhost || die
413    
414     # install some desktop icons
415     minstallpixmap share/icons/48x48/nxplayer-icon.png nxplayer.png
416     minstall_desktop_icon \
417     --name NXPlayer \
418     --comment "NoMachine NX Client Player" \
419     --file "nxplayer" \
420     --exec "nxplayer" \
421     --icon "nxplayer.png" \
422     --categories Network \
423     || die
424     }
425    
426     src_install_nxwebplayer()
427     {
428     cd ${SRCDIR}/src-nxwebplayer/NX
429     local i
430    
431     # bin
432     minstalldir /usr/NX/bin || die
433     for i in nxwebclient{,.bin} nxwebplayer{,.bin}
434     do
435     minstallexec bin/${i} /usr/NX/bin || die
436     done
437    
438     # other components
439     for i in lib scripts share var
440     do
441     mcopy -R ${i} /usr/NX || die
442     done
443     # fix permissions
444     mchmod 0755 /usr/NX/scripts/setup/nxwebplayer || die
445    
446     # configs
447     minstalldir /usr/NX/etc || die
448     minstallfile etc/webplayer.cfg.sample /usr/NX/etc || die
449     minstallfile etc/webplayer.inc.sample /usr/NX/etc || die
450    
451     # global config
452     minstalldir /etc/NX/server/localhost || die
453     minstallfile scripts/etc/localhost/webplayer.cfg /etc/NX/server/localhost || die
454     minstallexec scripts/etc/nxwebplayer /etc/NX || die
455     }
456    
457     preinstall_nxnode()
458     {
459     ${MLIBDIR}/mgroupadd nx
460     ${MLIBDIR}/museradd -o "-g nx -s /usr/NX/bin/nxserver -d /usr/NX/home/nx" nx
461     }
462    
463     preinstall_nxserver-freeedition()
464     {
465     # abort install if freenx is installed
466     if [[ -n $(magequery -n nxserver-freenx) ]]
467     then
468     echo
469     echo "You have 'net-misc/nxserver-freenx' installed on your system."
470     echo
471     echo "Both ${PCAT}/${PNAME} and 'net-misc/nxserver-freenx'"
472     echo "cannot be installed at the same time. Please uninstall nxserver-freenx first!"
473     echo
474     die "net-misc/nxserver-freenx found."
475     fi
476    
477     ${MLIBDIR}/mgroupadd nxhttpd
478     ${MLIBDIR}/museradd -o "-g nxhttpd -s /bin/false -d /usr/NX/share/htdocs" nxhttpd
479     }
480    
481     postinstall_nxclient()
482     {
483     if [[ -f /usr/NX/etc/client.cfg ]]
484     then
485     echo "Running NoMachine's update script"
486     ${MROOT}/usr/NX/scripts/setup/nxclient --update
487     else
488     echo "Running NoMachine's setup script"
489     ${MROOT}/usr/NX/scripts/setup/nxclient --install
490     fi
491     }
492    
493     postinstall_nxnode()
494     {
495     # autoscramble nx system-user password if none was set
496     if [[ -n $(passwd -S nx | grep '[[:space:]][N|L][P| ]') ]]
497     then
498     usermod -p $(openssl passwd -1 $(mktemp -u | cut -d. -f2)) nx
499     fi
500    
501     if [[ ! -d /usr/NX/home/nx ]]
502     then
503     install /usr/NX/home/nx
504     fi
505     chown -R nx:root /usr/NX/home/nx
506     chmod 0700 /usr/NX/home/nx
507    
508     if [[ ! -f /usr/NX/etc/node.lic ]]
509     then
510     cp ${MROOT}/usr/NX/etc/node.lic.sample ${MROOT}/usr/NX/etc/node.lic || die
511     chown nx:root ${MROOT}/usr/NX/etc/node.lic
512     chmod 0400 ${MROOT}/usr/NX/etc/node.lic
513     fi
514    
515     if [[ -f /usr/NX/etc/node.cfg ]]
516     then
517     echo "Running NoMachine's update script"
518     ${MROOT}/usr/NX/scripts/setup/nxnode --update
519     else
520     echo "Running NoMachine's setup script"
521     ${MROOT}/usr/NX/scripts/setup/nxnode --install
522     fi
523     }
524    
525     postinstall_nxserver-freeedition()
526     {
527     # autoscramble nxhttpd system-user password if none was set
528     if [[ -n $(passwd -S nxhttpd | grep '[[:space:]][N|L][P| ]') ]]
529     then
530     usermod -p $(openssl passwd -1 $(mktemp -u | cut -d. -f2)) nxhttpd
531     fi
532    
533     # only run install when no configuration file is found
534     if [[ -f /usr/NX/etc/server.cfg ]]
535     then
536     echo "Running NoMachine's update script"
537     ${MROOT}/usr/NX/scripts/setup/nxserver --update
538     else
539     echo "Running NoMachine's setup script"
540     ${MROOT}/usr/NX/scripts/setup/nxserver --install
541     fi
542    
543     echo
544     echo "You also need to set a password for the user nx or pam permits ssh logins."
545     echo "To add a NX user run '/usr/NX/bin/nxserver --useradd [username]'"
546     echo "and set a password with '/usr/NX/bin/nxserver --passwd [username]'."
547     echo
548     }
549    
550     postinstall_nxmanager()
551     {
552     if [[ -f /usr/NX/etc/manager.cfg ]]
553     then
554     echo "Running NoMachine's update script"
555     ${MROOT}/usr/NX/scripts/setup/nxmanager --update
556     else
557     echo "Running NoMachine's setup script"
558     ${MROOT}/usr/NX/scripts/setup/nxmanager --install
559     fi
560    
561     # restart nx
562     if [[ ! -z $(/etc/NX/nxserver --status | grep "nxserver enabled") ]]
563     then
564     /etc/NX/nxserver --restart
565     fi
566     }
567    
568     postinstall_nxplayer()
569     {
570     if [[ -f /usr/NX/etc/player.cfg ]]
571     then
572     echo "Running NoMachine's update script"
573     ${MROOT}/usr/NX/scripts/setup/nxplayer --update
574     else
575     echo "Running NoMachine's setup script"
576     ${MROOT}/usr/NX/scripts/setup/nxplayer --install
577     fi
578     }
579    
580     postinstall_nxwebplayer()
581     {
582     if [[ -f /usr/NX/etc/webplayer.cfg ]]
583     then
584     echo "Running NoMachine's update script"
585     ${MROOT}/usr/NX/scripts/setup/nxwebplayer --update
586     else
587     echo "Running NoMachine's setup script"
588     ${MROOT}/usr/NX/scripts/setup/nxwebplayer --install
589     fi
590    
591     # restart nx
592     if [[ ! -z $(/etc/NX/nxserver --status | grep "nxserver enabled") ]]
593     then
594     /etc/NX/nxserver --restart
595     fi
596     }