/[gentoo-x86]/eclass/nxserver-1.4.eclass
Gentoo

Contents of /eclass/nxserver-1.4.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Mon Nov 30 04:19:36 2009 UTC (4 years, 9 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
Remove eclasses that have been marked as deprecated for >=2 years; schedule other deprecated eclasses for removal

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/nxserver-1.4.eclass,v 1.14 2007/07/02 14:24:27 peper Exp $
4 #
5 # DEPRECATED
6 # eclass for handling the different nxserver binaries available
7 # from nomachine's website
8 #
9 # now handles freenx as well
10
11 inherit rpm eutils
12
13
14 HOMEPAGE="http://www.nomachine.com/"
15 IUSE=""
16 LICENSE="nomachine"
17 SLOT="0"
18 RESTRICT="mirror strip"
19
20 SRC_URI="nxserver-${MY_PV}.i386.rpm"
21 DEPEND=">=sys-apps/shadow-4.0.3-r6
22 >=net-misc/openssh-3.6.1_p2
23 =net-misc/nxssh-1.4*
24 =net-misc/nxproxy-1.4*
25 =net-misc/nxclient-1.4*
26 =net-misc/nx-x11-1.4*"
27
28 RDEPEND=">=media-libs/jpeg-6b-r3
29 >=sys-libs/glibc-2.3.2-r1
30 >=sys-libs/zlib-1.1.4-r1
31 >=net-misc/openssh-3.6.1_p2
32 >=dev-lang/perl-5.8.0-r12"
33
34 S="${WORKDIR}"
35
36 DESCRIPTION="an X11/RDP/VNC proxy server especially well suited to low bandwidth links such as wireless, WANS, and worse"
37
38 EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst
39
40 nxserver-1.4_pkg_setup() {
41 einfo "Adding user 'nx' for the NX server"
42 enewuser nx -1 -1 /usr/NX/home/nx
43 }
44
45 nxserver-1.4_src_compile() {
46 return;
47 }
48
49 nxserver-1.4_src_install() {
50 einfo "Installing"
51 find usr/NX/lib -type l -exec rm {} \;
52
53 # NX changed the name of the passwords sample file in 1.3.0
54
55 for x in passwd.sample passwords.sample ; do
56 if [ -f usr/NX/etc/$x ]; then
57 mv usr/NX/etc/$x usr/NX/etc/`basename $x .sample`
58 fi
59 done
60
61 # remove binaries installed by other packages
62 for x in nxagent nxdesktop nxpasswd nxviewer ; do
63 if [ -f usr/NX/bin/$x ]; then
64 rm -f usr/NX/bin/$x
65 fi
66 done
67
68 # remove libraries installed by other packages
69 for x in usr/NX/lib/*.so.* ; do
70 if [ -f $x ]; then
71 rm -f $x
72 fi
73 done
74
75 tar -cf - * | ( cd ${D} ; tar -xf - )
76
77 dodir /usr/NX/var
78 keepdir /usr/NX/var/sessions
79
80 doenvd ${FILESDIR}/1.3.0/50nxserver
81 }
82
83 nxserver-1.4_pkg_postinst() {
84
85 # arg - the 'nx' user's home directory keeps moving
86 #
87 # release user homedir
88 # 1.2.2 nx /usr/NX/home/nx
89 # 1.3.0 nx /usr/NX/home
90 # 1.3.2 nx /usr/NX/home/nx
91 # 1.4.0 nx /usr/NX/home/nx
92
93 l_szPasswd=passwd
94
95 if [ -f /usr/NX/etc/passwd -a -f /usr/NX/etc/passwords ]; then
96 mv /usr/NX/etc/passwd /usr/NX/etc/passwords
97 fi
98 if [ -f /usr/NX/etc/passwords ]; then
99 l_szPasswd=passwords
100 fi
101
102 # end of upgrade support
103
104 # now that nxserver has been installed, we can change the shell
105 # of the nx user to be the correct one
106
107 echo "Setting nx's homedir to /usr/NX/bin/nxserver"
108 chsh -s /usr/NX/bin/nxserver nx
109
110 # we do this to move the home directory of older installs
111
112 einfo "Setting home directory of user 'nx' to /usr/NX/home/nx"
113 usermod -d /usr/NX/home/nx nx
114
115 einfo "Changing permissions for files under /usr/NX"
116 chown nx:root /usr/NX/etc/$l_szPasswd
117 chmod 0600 /usr/NX/etc/$l_szPasswd
118 chown -R nx:root /usr/NX
119 chmod u+x /usr/NX/var/db/*
120 chmod 755 /usr/NX/etc
121
122 einfo "Generating SSH keys for the 'nx' user"
123 if [ ! -f /usr/NX/etc/users.id_dsa ]; then
124 ssh-keygen -q -t dsa -N '' -f /usr/NX/etc/users.id_dsa
125 fi
126 chown nx:root /usr/NX/etc/users.id_dsa
127
128 cp -f /usr/NX/home/nx/.ssh/server.id_dsa.pub.key /usr/NX/home/nx/.ssh/authorized_keys2
129 chown nx:root /usr/NX/home/nx/.ssh/authorized_keys2
130 chmod 0600 /usr/NX/home/nx/.ssh/authorized_keys2
131
132 if [ ! -f /usr/NX/var/broadcast.txt ]; then
133 einfo "Creating NX user registration database"
134 touch /usr/NX/var/broadcast.txt
135 chown nx:root /usr/NX/var/broadcast.txt
136
137 ewarn "None of your system users are registered to use the NX Server."
138 ewarn "To authorise a user, run:"
139 ewarn "'/usr/NX/bin/nxserver --useradd <username>'"
140 fi
141
142 if [ ! -f /usr/NX/etc/key.txt ] ; then
143 ewarn
144 ewarn "You need to place your NX key.txt file into /usr/NX/etc/"
145 ewarn "If you don't have one already, you can get an evaluation"
146 ewarn "key, or purchase a full license, from www.nomachine.com"
147 ewarn
148 ewarn "The key.txt file must be chmod'd 0400 and must owned by"
149 ewarn "by the 'nx' user."
150 fi
151
152 if [ ! -f /usr/NX/etc/node.conf ] ; then
153 ewarn
154 ewarn "To complete the installation, you must create a file called"
155 ewarn "'/usr/NX/etc/node.conf'. An example configuration file can"
156 ewarn "be found in /usr/NX/etc"
157 fi
158
159 # regen the ld.so cache, because Portage sometimes doesn't
160 ldconfig -v > /dev/null 2>&1
161 }

  ViewVC Help
Powered by ViewVC 1.1.20