/[gentoo-alt]/trunk/prefix/eclass/nxserver.eclass
Gentoo

Contents of /trunk/prefix/eclass/nxserver.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 3898 byte(s)
Initial eclass import from gentoo-x86
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.eclass,v 1.19 2005/07/11 15:08:06 swegener Exp $
4 #
5 # eclass for handling the different nxserver binaries available
6 # from nomachine's website
7
8 inherit rpm
9
10
11 HOMEPAGE="http://www.nomachine.com/"
12 IUSE=""
13 LICENSE="nomachine"
14 SLOT="0"
15 KEYWORDS="x86 -ppc -sparc -alpha -mips"
16 RESTRICT="nomirror strip"
17
18 SRC_URI="nxserver-${MY_PV}.i386.rpm"
19 RDEPEND=">=media-libs/jpeg-6b-r3
20 >=sys-libs/glibc-2.3.2-r1
21 >=sys-libs/zlib-1.1.4-r1
22 virtual/x11
23 >=net-misc/openssh-3.6.1_p2
24 >=dev-lang/perl-5.8.0-r12"
25
26 DEPEND=">=sys-apps/shadow-4.0.3-r6
27 >=net-misc/openssh-3.6.1_p2"
28
29 S="${WORKDIR}"
30
31 DESCRIPTION="an X11/RDP/VNC proxy server especially well suited to low bandwidth links such as wireless, WANS, and worse"
32
33 EXPORT_FUNCTIONS pkg_nofetch src_compile src_install pkg_postinst
34
35 nxserver_pkg_nofetch () {
36 eerror "This package requires you to purchase NX Server from:"
37 eerror
38 eerror " http://www.nomachine.com/download.php"
39 eerror
40 eerror "Please purchase the *$1* edition of NX Server packaged for"
41 eerror "RedHat 9.0 and put the RPM file nxserver-1.2.2-72.i386.rpm"
42 eerror "into $DISTDIR/"
43 eerror
44 eerror "This ebuild will also work with the evaluation version of"
45 eerror "the *$1* edition of NX Server packaged for RedHat 9.0"
46
47 die "Automatic download not supported"
48 }
49
50 nxserver_src_compile() {
51 return;
52 }
53
54 nxserver_src_install() {
55 einfo "Installing"
56 find usr/NX/lib -type l -exec rm {} \;
57
58 # NX changed the name of the passwords sample file in 1.3.0
59
60 for x in passwd.sample passwords.sample ; do
61 if [ -f usr/NX/etc/$x ]; then
62 mv usr/NX/etc/$x usr/NX/etc/`basename $x .sample`
63 fi
64 done
65
66 tar -cf - * | ( cd ${D} ; tar -xf - )
67
68 dodir /usr/NX/var
69 dodir /usr/NX/var/sessions
70 touch ${D}/usr/NX/var/sessions/NOT_EMPTY
71
72 insinto /etc/env.d
73 doins ${FILESDIR}/${PV}/50nxserver
74 }
75
76 nxserver_pkg_postinst() {
77
78 # this is support for users upgrading from NX 1.2.2 to 1.3.0
79
80 l_szPasswd=passwd
81
82 if [ -f /usr/NX/etc/passwd -a -f /usr/NX/etc/passwords ]; then
83 mv /usr/NX/etc/passwd /usr/NX/etc/passwords
84 fi
85 if [ -f /usr/NX/etc/passwords ]; then
86 l_szPasswd=passwords
87 fi
88
89 l_szHome=nxhome
90 if [ -d /usr/NX/home ]; then
91 l_szHome=home
92 fi
93
94 if [ -d /usr/NX/nxhome -a -d /usr/NX/home ]; then
95 einfo "Moving home directory of user 'nx' to /usr/NX/home"
96 usermod -d /usr/NX/home nx
97 fi
98
99 # end of upgrade support
100
101 einfo "Adding user 'nx' for the NX server"
102 enewuser nx -1 /usr/NX/bin/nxserver /usr/NX/$l_szHome
103
104 einfo "Changing permissions for files under /usr/NX"
105 chown nx:root /usr/NX/etc/$l_szPasswd
106 chmod 0600 /usr/NX/etc/$l_szPasswd
107 chown -R nx:root /usr/NX/$l_szHome
108 chown -R nx:root /usr/NX/var
109
110 einfo "Generating SSH keys for the 'nx' user"
111 if [ ! -f /usr/NX/etc/users.id_dsa ]; then
112 ssh-keygen -q -t dsa -N '' -f /usr/NX/etc/users.id_dsa
113 fi
114 chown nx:root /usr/NX/etc/users.id_dsa
115 cp -f /usr/NX/$l_szHome/.ssh/server.id_dsa.pub.key /usr/NX/$l_szHome/.ssh/authorized_keys2
116
117 if [ ! -f /usr/NX/var/broadcast.txt ]; then
118 einfo "Creating NX user registration database"
119 touch /usr/NX/var/broadcast.txt
120 chown nx:root /usr/NX/var/broadcast.txt
121
122 ewarn "None of your system users are registered to use the NX Server."
123 ewarn "To authorise a user, run:"
124 ewarn "'/usr/NX/bin/nxserver --useradd <username>'"
125 fi
126
127 if [ ! -f /usr/NX/etc/key.txt ] ; then
128 ewarn
129 ewarn "You need to place your NX key.txt file into /usr/NX/etc/"
130 ewarn "If you don't have one already, you can get an evaluation"
131 ewarn "key, or purchase a full license, from www.nomachine.com"
132 ewarn
133 fi
134
135 if [ ! -f /usr/NX/etc/node.conf ] ; then
136 ewarn
137 ewarn "To complete the installation, you must create a file called"
138 ewarn "'/usr/NX/etc/node.conf'. An example configuration file can"
139 ewarn "be found in /usr/NX/etc"
140 ewarn
141 fi
142 }

  ViewVC Help
Powered by ViewVC 1.1.20