# $Id$ PNAME="nxserver-freeedition" PVER="3.5.0" PBUILD="r2" PCATEGORIE="net-misc" STATE="unstable" DESCRIPTION="NoMachine NX Free Edition server." HOMEPAGE="http://www.nomachine.com/" DEPEND="== net-misc/nxnode-${PVER} >= sys-apps/coreutils-8 >= x11-apps/xauth-1 >= media-fonts/font-misc-misc-1 >= media-fonts/font-cursor-misc-1" NXPVER="${PVER}-4" # both files must be fetch or our md5-logic breaks SRCFILE_x86="nxserver-${NXPVER}.i386.tar.gz" SRCFILE_x86_64="nxserver-${NXPVER}.x86_64.tar.gz" # decide between x86 and x86_64 arch SRCFILE="$(eval echo \$SRCFILE_${ARCH/i*86/x86})" SRCDIR="${BUILDDIR}/NX" sminclude mtools SRC_URI=( http://64.34.161.181/download/${PVER}/Linux/FE/${SRCFILE_x86} http://64.34.161.181/download/${PVER}/Linux/FE/${SRCFILE_x86_64} mirror://${PNAME}/${SRCFILE_x86} mirror://${PNAME}/${SRCFILE_x86_64} mirror://${PNAME}/${PNAME}-3.1.0-magellan.patch ) UP2DATE="updatecmd ${HOMEPAGE}/sources.php | grep nx-X11 | sed 's/.*nx-X11-\(.*\)-.*/\1/;q'" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # fixes the setup script on magellan mpatch ${PNAME}-3.1.0-magellan.patch || die } src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/NX/etc || die minstalldir /usr/NX/bin || die # install nx environment minstallexec bin/nxserver /usr/NX/bin || die local i for i in home lib scripts share var do cp -R ${i} ${BINDIR}/usr/NX || die done # install the ssh-keys cp -R etc/keys ${BINDIR}/usr/NX/etc || die # install some sample configs minstallfile etc/administrators.db.sample /usr/NX/etc || die minstallfile etc/guests.db.sample /usr/NX/etc || die minstallfile etc/passwords.db.sample /usr/NX/etc || die minstallfile etc/profiles.db.sample /usr/NX/etc || die minstallfile etc/users.db.sample /usr/NX/etc || die minstallfile etc/server.lic.sample /usr/NX/etc || die minstallfile etc/server-debian.cfg.sample /usr/NX/etc/server-magellan.cfg.sample || die } preinstall() { # abort install if freenx is installed if [[ -n $(magequery -n nxserver-freenx) ]] then echo echo "You have 'net-misc/nxserver-freenx' installed on your system." echo echo "Both ${PCATEGORIE}/${PNAME} and 'net-misc/nxserver-freenx'" echo "cannot be installed at the same time. Please uninstall nxserver-freenx first!" echo die "net-misc/nxserver-freenx found." fi } postinstall() { ${MLIBDIR}/museradd -o "-s /usr/NX/bin/nxserver -d /usr/NX/home/nx" nx # autoscramble nx system-user password if none was set if [[ -n $(passwd -S nx | grep ' NP ') ]] then usermod -p $(openssl passwd -1 $(mktemp -u | cut -d. -f2)) nx fi # only run install when no configuration file is found if [[ -f /usr/NX/etc/server.cfg ]] then echo "Running NoMachine's update script" ${MROOT}/usr/NX/scripts/setup/nxserver --update else echo "Running NoMachine's setup script" ${MROOT}/usr/NX/scripts/setup/nxserver --install fi # echo # echo "You must run 'nxserver --install' to complete the installation." # echo "If you are upgrading an old nxserver version you must run 'nxserver --update'." echo echo "You also need to set a password for the user nx or pam permits ssh logins." echo "To add a NX user run '/usr/NX/bin/nxserver --useradd [username]'" echo "and set a password with '/usr/NX/bin/nxserver --passwd [username]'." echo }