Magellan Linux

Annotation of /branches/magellan-next/extras/nxserver-freeedition/nxserver-freeedition-3.5.0-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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