# $Header: /magellan-cvs/smage/nxserver-freenx/nxserver-freenx-0.7.2-r5.smage2,v 1.1 2008/04/20 12:55:19 niro Exp $ PNAME="nxserver-freenx" PVER="0.7.2" PBUILD="r5" PCATEGORIE="net-misc" STATE="unstable" DESCRIPTION="A free NX server implementation." HOMEPAGE="http://freenx.berlios.de/" # binutils is only needed for the strings binary! DEPEND=">= net-misc/openssh-4 >= dev-util/expect-5.43 >= sys-apps/gawk-1.3.5 >= net-misc/netcat-0.7.1 >= net-misc/nx-3.0.0 >= net-misc/rdesktop-1 >= net-misc/vnc-4 >= x11-apps/xauth-1 >= x11-apps/xdm-1 >= x11-apps/xrdb-1 >= x11-apps/xmessage-1 >= media-fonts/font-misc-misc-1 >= media-fonts/font-cursor-misc-1 >= sys-dev/binutils-2.18 >= sys-apps/coreutils-6.10" SDEPEND=">= sys-apps/sed-4" SRCFILE="freenx-server-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/freenx-server-${PVER}" sminclude mtools SRC_URI=( http://download.berlios.de/freenx/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-0.7.1-xorg71.patch mirror://${PNAME}/${PNAME}-${PVER}-nx32-backend.patch mirror://${PNAME}/${PNAME}-0.6.1-fullscreen.patch mirror://${PNAME}/${PNAME}-${PVER}-reconnect.patch mirror://${PNAME}/${PNAME}-0.5.0-libdir.patch mirror://${PNAME}/${PNAME}-0.5.0-enable-arts.patch mirror://${PNAME}/${PNAME}-0.6.1-enable-cups.patch mirror://${PNAME}/${PNAME}-${PVER}-nxagent-path.patch mirror://${PNAME}/${PNAME}-${PVER}-libxrender.patch ) UP2DATE="updatecmd_berlios freenx freenx-server" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # xorg7.1 compat mpatch ${PNAME}-0.7.1-xorg71.patch || die # enable nx-2/3.[012].0 backend compatibility mpatch ${PNAME}-${PVER}-nx32-backend.patch || die # fix fullscreen sessions mpatch ${PNAME}-0.6.1-fullscreen.patch || die # enable auto-reconnect mpatch ${PNAME}-${PVER}-reconnect.patch || die # fix nx lib path mpatch ${PNAME}-0.5.0-libdir.patch || die # enable arts support mpatch ${PNAME}-0.5.0-enable-arts.patch || die # enable cups support mpatch ${PNAME}-0.6.1-enable-cups.patch || die # fixes the path to the real nxagent binary mpatch ${PNAME}-${PVER}-nxagent-path.patch || die # fixes search path of libXrender.so.1 mpatch ${PNAME}-${PVER}-libxrender.patch || die # fixup multilib pathes sed -i "/PATH_LIB=/s/lib/$(mlibdir)/g" nxloadconfig || die sed -i "/NXAGENT_PATH_BIN=/s/lib/$(mlibdir)/g" nxloadconfig || die } src_compile() { cd ${SRCDIR} # compile nxserver-helper mmake -C nxserver-helper || die # compile nxredir mmake -C nxredir || die } src_install() { cd ${SRCDIR} minstallexec nxcups-gethost || die minstallexec nxdesktop_helper || die minstallexec nxdialog || die minstallexec nxkeygen || die minstallexec nxloadconfig || die minstallexec nxnode || die minstallexec nxnode-login || die minstallexec nxprint || die minstallexec nxserver || die minstallexec nxsetup || die minstallexec nxviewer_helper || die # install nxserver-helper minstallexec nxserver-helper/nxserver-helper || die # install nx's cups samba backend minstalldir /usr/$(mlibdir)/cups/backend || die minstalldir /usr/$(mlibdir)/NX/lib || die minstallexec nxredir/nxredir || die minstalllib nxredir/libnxredir.so.0 /usr/$(mlibdir)/NX/lib || die minstallexec nxredir/nxsmb /usr/$(mlibdir)/cups/backend || die # create needed empty directories and files mkeepdir /etc/nxserver || die memptyfile /etc/nxserver/passwords || die memptyfile /etc/nxserver/passwords.orig || die mchmod 0600 /etc/nxserver/passwords || die mchmod 0600 /etc/nxserver/passwords.orig || die # install the default config file minstallfile node.conf.sample /etc/nxserver/node.conf || die mkeepdir /var/lib/nxserver/home || die mchown nx.nx /var/lib/nxserver/home || die mkeepdir /var/lib/nxserver/db/running || die mchmod 0700 /var/lib/nxserver/db/running || die mkeepdir /var/lib/nxserver/db/closed || die mchmod 0700 /var/lib/nxserver/db/closed || die } preinstall() { # block if nx free-edition is installed if [[ -n $(magequery -n nxserver-freeedition) ]] then echo echo "You have 'net-misc/nxserver-freeedition' installed on your system." echo echo "Both ${PCATEGORIE}/${PNAME} and 'net-misc/nxserver-freeedition'" echo "cannot be installed at the same time. Please uninstall nxserver-freeedition first!" echo die "net-misc/nxserver-freeedition found." fi } postinstall() { # fix permissions chown -R nx.nx /var/lib/nxserver/home ${MLIBDIR}/museradd -o "-s /usr/bin/nxserver -d /var/lib/nxserver/home" 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 # shutup install errors if kde is not installed on the system install -d ${MROOT}/${HOME}/.kde/share/config touch ${MROOT}/${HOME}/.kde/share/config/kdeprintrc echo "Running freenx's setup script" ${MROOT}/usr/bin/nxsetup --setup-nomachine-key --install echo # echo "You must run 'nxsetup --setup-nomachine-key --install' to complete the installation." echo "You also need to set a password for the user nx or pam permits ssh logins." echo "To add a NX user run 'nxserver --adduser [username]'" echo "and set a password with 'nxserver --passwd [username]'." echo }