Annotation of /branches/magellan-next/extras/nxserver-freeedition/nxserver-freeedition-3.5.0-r3.smage2
Parent Directory | Revision Log
Revision 8895 -
(hide annotations)
(download)
Fri Aug 12 15:07:54 2011 UTC (13 years, 1 month ago) by niro
File size: 3303 byte(s)
Fri Aug 12 15:07:54 2011 UTC (13 years, 1 month ago) by niro
File size: 3303 byte(s)
auto added: ver bump to 3.5.0-r3
1 | niro | 8895 | # $Id$ |
2 | |||
3 | PNAME="nxserver-freeedition" | ||
4 | PVER="3.5.0" | ||
5 | PBUILD="r3" | ||
6 | |||
7 | PCATEGORIE="net-misc" | ||
8 | |||
9 | DESCRIPTION="NoMachine NX Free Edition server." | ||
10 | HOMEPAGE="http://www.nomachine.com/" | ||
11 | |||
12 | DEPEND="== net-misc/nxnode-${PVER} | ||
13 | >= sys-apps/coreutils-8 | ||
14 | >= x11-apps/xauth-1 | ||
15 | >= media-fonts/font-misc-misc-1 | ||
16 | >= media-fonts/font-cursor-misc-1" | ||
17 | |||
18 | NXPVER="${PVER}-5" | ||
19 | # both files must be fetch or our md5-logic breaks | ||
20 | SRCFILE_x86="nxserver-${NXPVER}.i386.tar.gz" | ||
21 | SRCFILE_x86_64="nxserver-${NXPVER}.x86_64.tar.gz" | ||
22 | # decide between x86 and x86_64 arch | ||
23 | SRCFILE="$(eval echo \$SRCFILE_${ARCH/i*86/x86})" | ||
24 | SRCDIR="${BUILDDIR}/NX" | ||
25 | |||
26 | sminclude mtools | ||
27 | |||
28 | SRC_URI=( | ||
29 | http://64.34.161.181/download/${PVER}/Linux/FE/${SRCFILE_x86} | ||
30 | http://64.34.161.181/download/${PVER}/Linux/FE/${SRCFILE_x86_64} | ||
31 | mirror://${PNAME}/${SRCFILE_x86} | ||
32 | mirror://${PNAME}/${SRCFILE_x86_64} | ||
33 | mirror://${PNAME}/${PNAME}-3.1.0-magellan.patch | ||
34 | ) | ||
35 | |||
36 | UP2DATE="updatecmd ${HOMEPAGE}/sources.php | grep nx-X11 | sed 's/.*nx-X11-\(.*\)-.*/\1/;q'" | ||
37 | |||
38 | src_prepare() | ||
39 | { | ||
40 | munpack ${SRCFILE} || die | ||
41 | cd ${SRCDIR} | ||
42 | |||
43 | # fixes the setup script on magellan | ||
44 | mpatch ${PNAME}-3.1.0-magellan.patch || die | ||
45 | } | ||
46 | |||
47 | src_install() | ||
48 | { | ||
49 | cd ${SRCDIR} | ||
50 | |||
51 | # needed directories | ||
52 | minstalldir /usr/NX/etc || die | ||
53 | minstalldir /usr/NX/bin || die | ||
54 | |||
55 | # install nx environment | ||
56 | minstallexec bin/nxserver /usr/NX/bin || die | ||
57 | local i | ||
58 | for i in home lib scripts share var | ||
59 | do | ||
60 | cp -R ${i} ${BINDIR}/usr/NX || die | ||
61 | done | ||
62 | |||
63 | # install the ssh-keys | ||
64 | cp -R etc/keys ${BINDIR}/usr/NX/etc || die | ||
65 | |||
66 | # install some sample configs | ||
67 | minstallfile etc/administrators.db.sample /usr/NX/etc || die | ||
68 | minstallfile etc/guests.db.sample /usr/NX/etc || die | ||
69 | minstallfile etc/passwords.db.sample /usr/NX/etc || die | ||
70 | minstallfile etc/profiles.db.sample /usr/NX/etc || die | ||
71 | minstallfile etc/users.db.sample /usr/NX/etc || die | ||
72 | minstallfile etc/server.lic.sample /usr/NX/etc || die | ||
73 | minstallfile etc/server-debian.cfg.sample /usr/NX/etc/server-magellan.cfg.sample || die | ||
74 | } | ||
75 | |||
76 | preinstall() | ||
77 | { | ||
78 | # abort install if freenx is installed | ||
79 | if [[ -n $(magequery -n nxserver-freenx) ]] | ||
80 | then | ||
81 | echo | ||
82 | echo "You have 'net-misc/nxserver-freenx' installed on your system." | ||
83 | echo | ||
84 | echo "Both ${PCATEGORIE}/${PNAME} and 'net-misc/nxserver-freenx'" | ||
85 | echo "cannot be installed at the same time. Please uninstall nxserver-freenx first!" | ||
86 | echo | ||
87 | die "net-misc/nxserver-freenx found." | ||
88 | fi | ||
89 | } | ||
90 | |||
91 | postinstall() | ||
92 | { | ||
93 | ${MLIBDIR}/museradd -o "-s /usr/NX/bin/nxserver -d /usr/NX/home/nx" nx | ||
94 | |||
95 | # autoscramble nx system-user password if none was set | ||
96 | if [[ -n $(passwd -S nx | grep ' NP ') ]] | ||
97 | then | ||
98 | usermod -p $(openssl passwd -1 $(mktemp -u | cut -d. -f2)) nx | ||
99 | fi | ||
100 | |||
101 | # only run install when no configuration file is found | ||
102 | if [[ -f /usr/NX/etc/server.cfg ]] | ||
103 | then | ||
104 | echo "Running NoMachine's update script" | ||
105 | ${MROOT}/usr/NX/scripts/setup/nxserver --update | ||
106 | else | ||
107 | echo "Running NoMachine's setup script" | ||
108 | ${MROOT}/usr/NX/scripts/setup/nxserver --install | ||
109 | fi | ||
110 | |||
111 | # echo | ||
112 | # echo "You must run 'nxserver --install' to complete the installation." | ||
113 | # echo "If you are upgrading an old nxserver version you must run 'nxserver --update'." | ||
114 | echo | ||
115 | echo "You also need to set a password for the user nx or pam permits ssh logins." | ||
116 | echo "To add a NX user run '/usr/NX/bin/nxserver --useradd [username]'" | ||
117 | echo "and set a password with '/usr/NX/bin/nxserver --passwd [username]'." | ||
118 | echo | ||
119 | } |