Magellan Linux

Annotation of /trunk/deprecated/nxserver-freeedition/nxserver-freeedition-3.5.0-r6.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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