Contents of /trunk/extras/nxserver-freeedition/nxserver-freeedition-3.5.0-r4.smage2
Parent Directory | Revision Log
Revision 12054 -
(show annotations)
(download)
Thu May 3 13:50:55 2012 UTC (12 years, 4 months ago) by niro
File size: 4344 byte(s)
Thu May 3 13:50:55 2012 UTC (12 years, 4 months ago) by niro
File size: 4344 byte(s)
auto added: ver bump to 4.0.181-r1
1 | # $Id$ |
2 | |
3 | PNAME="nxserver-freeedition" |
4 | PVER="4.0.181" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="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}-2" |
19 | SRCFILE_x86="nxserver-${NXPVER}.i686.tar.gz" |
20 | SRCFILE_x86_64="nxserver-${NXPVER}.x86_64.tar.gz" |
21 | SRCFILE="$(marchsrcfile)" |
22 | SRCDIR="${BUILDDIR}/NX" |
23 | |
24 | sminclude mtools |
25 | |
26 | SRC_URI=( |
27 | http://64.34.161.181/download/${PVER%.*}/Linux/S/${SRCFILE_x86} |
28 | http://64.34.161.181/download/${PVER%.*}/Linux/S/${SRCFILE_x86_64} |
29 | mirror://${PNAME}/${SRCFILE_x86} |
30 | mirror://${PNAME}/${SRCFILE_x86_64} |
31 | mirror://${PNAME}/${PNAME}-3.1.0-magellan.patch |
32 | ) |
33 | |
34 | UP2DATE="updatecmd ${HOMEPAGE}/sources.php | grep nx-X11 | sed 's/.*nx-X11-\(.*\)-.*/\1/;q'" |
35 | |
36 | src_prepare() |
37 | { |
38 | munpack ${SRCFILE} || die |
39 | cd ${SRCDIR} |
40 | |
41 | # all packages are provided by this tarball |
42 | install -d ${SRCDIR}/src-nxclient || die |
43 | tar xvzf etc/NX/server/packages/nxclient.tar.gz -C src-nxclient || die |
44 | cd ${SRCDIR}/src-nxclient |
45 | mpatch ${PNAME}-${PVER}-nxclient-magellan.patch || die |
46 | |
47 | install -d ${SRCDIR}/src-nxnode || die |
48 | tar xvzf etc/NX/server/packages/nxnode.tar.gz -C src-nxnode || die |
49 | cd ${SRCDIR}/src-nxnode |
50 | mpatch ${PNAME}-${PVER}-nxnode-magellan.patch || die |
51 | |
52 | install -d ${SRCDIR}/src-nxserver || die |
53 | tar xvzf etc/NX/server/packages/nxserver.tar.gz -C src-nxserver || die |
54 | cd ${SRCDIR}/src-nxserver |
55 | mpatch ${PNAME}-${PVER}-nxserver-magellan.patch || die |
56 | |
57 | install -d ${SRCDIR}/src-nxmanager || die |
58 | tar xvzf etc/NX/server/packages/nxmanager.tar.gz -C src-nxmanager || die |
59 | cd ${SRCDIR}/src-nxmanager |
60 | mpatch ${PNAME}-${PVER}-nxmanager-magellan.patch || die |
61 | |
62 | install -d ${SRCDIR}/src-nxplayer || die |
63 | tar xvzf etc/NX/server/packages/nxplayer.tar.gz -C src-nxplayer || die |
64 | cd ${SRCDIR}/src-nxplayer |
65 | mpatch ${PNAME}-${PVER}-nxplayer-magellan.patch || die |
66 | |
67 | install -d ${SRCDIR}/src-nxwebplayer || die |
68 | tar xvzf etc/NX/server/packages/nxwebplayer.tar.gz -C src-nxwebplayer || die |
69 | cd ${SRCDIR}/src-nxwebplayer |
70 | mpatch ${PNAME}-${PVER}-nxwebplayer-magellan.patch || die |
71 | } |
72 | |
73 | src_install() |
74 | { |
75 | cd ${SRCDIR} |
76 | |
77 | # needed directories |
78 | minstalldir /usr/NX/etc || die |
79 | minstalldir /usr/NX/bin || die |
80 | |
81 | # install nx environment |
82 | minstallexec bin/nxserver /usr/NX/bin || die |
83 | local i |
84 | for i in home lib scripts share var |
85 | do |
86 | cp -R ${i} ${BINDIR}/usr/NX || die |
87 | done |
88 | |
89 | # install the ssh-keys |
90 | cp -R etc/keys ${BINDIR}/usr/NX/etc || die |
91 | |
92 | # install some sample configs |
93 | minstallfile etc/administrators.db.sample /usr/NX/etc || die |
94 | minstallfile etc/guests.db.sample /usr/NX/etc || die |
95 | minstallfile etc/passwords.db.sample /usr/NX/etc || die |
96 | minstallfile etc/profiles.db.sample /usr/NX/etc || die |
97 | minstallfile etc/users.db.sample /usr/NX/etc || die |
98 | minstallfile etc/server.lic.sample /usr/NX/etc || die |
99 | minstallfile etc/server-debian.cfg.sample /usr/NX/etc/server-magellan.cfg.sample || die |
100 | } |
101 | |
102 | preinstall() |
103 | { |
104 | # abort install if freenx is installed |
105 | if [[ -n $(magequery -n nxserver-freenx) ]] |
106 | then |
107 | echo |
108 | echo "You have 'net-misc/nxserver-freenx' installed on your system." |
109 | echo |
110 | echo "Both ${PCAT}/${PNAME} and 'net-misc/nxserver-freenx'" |
111 | echo "cannot be installed at the same time. Please uninstall nxserver-freenx first!" |
112 | echo |
113 | die "net-misc/nxserver-freenx found." |
114 | fi |
115 | } |
116 | |
117 | postinstall() |
118 | { |
119 | ${MLIBDIR}/museradd -o "-s /usr/NX/bin/nxserver -d /usr/NX/home/nx" nx |
120 | |
121 | # autoscramble nx system-user password if none was set |
122 | if [[ -n $(passwd -S nx | grep ' NP ') ]] |
123 | then |
124 | usermod -p $(openssl passwd -1 $(mktemp -u | cut -d. -f2)) nx |
125 | fi |
126 | |
127 | # only run install when no configuration file is found |
128 | if [[ -f /usr/NX/etc/server.cfg ]] |
129 | then |
130 | echo "Running NoMachine's update script" |
131 | ${MROOT}/usr/NX/scripts/setup/nxserver --update |
132 | else |
133 | echo "Running NoMachine's setup script" |
134 | ${MROOT}/usr/NX/scripts/setup/nxserver --install |
135 | fi |
136 | |
137 | # echo |
138 | # echo "You must run 'nxserver --install' to complete the installation." |
139 | # echo "If you are upgrading an old nxserver version you must run 'nxserver --update'." |
140 | echo |
141 | echo "You also need to set a password for the user nx or pam permits ssh logins." |
142 | echo "To add a NX user run '/usr/NX/bin/nxserver --useradd [username]'" |
143 | echo "and set a password with '/usr/NX/bin/nxserver --passwd [username]'." |
144 | echo |
145 | } |