diff --git a/net-misc/nxserver/ChangeLog b/net-misc/nxserver/ChangeLog new file mode 100644 index 00000000..992f2277 --- /dev/null +++ b/net-misc/nxserver/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-misc/nxserver +# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*nxserver-3.5.0.11-r1 (10 Jan 2016) + + 10 Jan 2016; +files/nxserver-2.1.0-init, + +files/nxserver-3.3.0-dontupdatekeys.patch, + +files/nxserver-3.5.0.11-setup.patch, +files/nxserver-3.5.0.11-systemd.patch, + +files/nxserver.service, +metadata.xml, +nxserver-3.5.0.11-r1.ebuild: + Change ebuild layout diff --git a/net-misc/nxserver/Manifest b/net-misc/nxserver/Manifest new file mode 100644 index 00000000..88659136 --- /dev/null +++ b/net-misc/nxserver/Manifest @@ -0,0 +1,10 @@ +AUX nxserver-2.1.0-init 539 SHA256 ccbfbf3cb117cb132bcd7953f8160a6e053a14b60de3028f281a0722fafe8219 SHA512 da546a2b70bd6ef6a79cf0879f9769d52bbe53a1ff693d921ee92f16557bbaa4ff5b0ca0dac6ee40d9d44f740634b29d765a3781b72913a4daa357b7c7a9e191 WHIRLPOOL dc7e02dd48278fc70901a4d315b2dcc4654b14fb85e63e6d506bfd0ab8d5415d1789f75aea8dec0ee5f164b4faf3803361ac0cf5ea156e2a0c15d800b4e1623a +AUX nxserver-3.3.0-dontupdatekeys.patch 333 SHA256 4b4202a988d9b8841a5aef358b6ef50cc5864644ff4e9192cbd77cab54d1f298 SHA512 e04734582a1a125fa894bbbd49c8b8e78443ac8007df4b33b3f8ceae66a2e440350b814b22bf4719cfd37ba1ef84bd2d461757ae347d434bbad06a755f7dbec3 WHIRLPOOL 08ee75467e417bc169a4d05241192ade7059b27ef004955970a17ba810c73a254362d5a04615da2161cece623563de05cae18bdf6fb69d5bf4fdc72dc913ef6b +AUX nxserver-3.5.0.11-setup.patch 1720 SHA256 c45f953c06ea89d8741c8f1a824d9c9f1a9f6bd6a2b66df58a5e8b0a535abe75 SHA512 bb615b84ee0afc85ece7832da8f9cbda51615d90e8cb51e5d19afb335911a848a26bd15932ceb6565a4ebdb53a973a01b7a9af198943eec92759199bbaceca93 WHIRLPOOL cfc9f5795a4f43384626c59c795bf8eaa36dc2578c7835576ff4e73d2b4ce03c8509d2b2ac9fddfe86f0d3a7856cb03479fc1ba9c587aa3d08ac4be25214655e +AUX nxserver-3.5.0.11-systemd.patch 1050 SHA256 2f4f3d9378189508f2612c47ff91fbb5c160c0ec0592b45f7b7baf36a10fae31 SHA512 c6d38a04f8a445ca07a27e75af5c29d3f6b9e3afe615caf4d5534549041afe1523f9c3e2544b3aafe8dd942e33acb20288f755a734b967624f4fff08b04b2564 WHIRLPOOL 8d3aeda9301a53baee09f5aa1ae143d4b43a88038dd849c48bf98f48fb1a14bdf57500d77399eab22822c869a4cbed0fa0905a7061e1a9567ee59674f0ed0bb8 +AUX nxserver.service 288 SHA256 7ec7b6cc102ec4ae75e5f56b5edf4958688d52ba73b5b9bdd2da2e408ef854c2 SHA512 f9038fd7f86529899369b7ca6d0675e2c5db52111a6c244af75a533001b7130f319a8cdea645d2cb61c2110cc93cd31a0747bd71191b6def303389614059e8ca WHIRLPOOL 0ff4bea8e5e6cee8ed740f592c06a0158a26854bd930d669404b46872956be39b70c5aee0051e587c7e6fc380e8595837c94c37fba88a66eca9eeaeb831918c8 +DIST nxserver-3.5.0-11.i386.tar.gz 6866158 SHA256 860a5de07e247e38d951f77b87f4dae3eb338120d768f2098df6332e63910074 SHA512 c457f8b114b526058329c8925b6388d74b5c72221d2625c67eac81baacc9a8575daa1ec21f17fba2fbee3808b920e896aa5c140cea0acaf31504849444484448 WHIRLPOOL df37a856c30528e9239cc3072c10f00c198876b349db1e9a94acbc2b45e1b60d31f48b6d13f30151a4e288eb48724c22167f5fd00e4fd03caf0f8e92543420fa +DIST nxserver-3.5.0-11.x86_64.tar.gz 7903110 SHA256 05b462bf6b888dbdd22246a521a0b6ed18ba5d55de673a53c5ae9d9c6dd68c63 SHA512 6a2483c874acbe824b766e06b01ad364d163380df02d9a36f7449762a1feeecf3106663503acd3d3435fe9bc6e7adea8e146b8d4d6d3d0a9c38c85c3c85a3d29 WHIRLPOOL 7d73064dffdcc231a72a9e8fdcdc9979b5c4c01af67923b50c2b9ea4a527a6b6d564876c61d607ad664d6ddec4e0a81835f5dee4eb0771e5c5c2c294a26bd41f +EBUILD nxserver-3.5.0.11-r1.ebuild 3433 SHA256 24a52c5ded199a7ffe9d5a60461a990bb490031083d95793b4e8d9a81c48e605 SHA512 37f12c942e45016cfa807da56bd8d008f74062502b629033937740696b622e0eea16d83c25fdf114effcfd2b3bb28ec9f03d675e33e544ad603ab9bb5c70d2d6 WHIRLPOOL 708705eb159c3cc542674e7d5c26399dcbcd19346ab4a194c26d421de41cd989710caf929265f0f6cb79322c08b0b8ff1d26271c3aeb1a47daaec2c3e2a2d08d +MISC ChangeLog 439 SHA256 d31c58c422dba2f34488f5fb0cf0259a02453c9ba028c0afb917e0a1139212e0 SHA512 440f968106ebdf4d740b533e1bec644e0923706771906a32dbc7bc6d958affe14cc04a4a492694977e0f6e1f3e1f87294e89144616de0c9ab208a0314c97e5b5 WHIRLPOOL e6ce6ce9efa77b32268f0ef7cdd6bdd9babe4a6ce7c08591087516d1012b4805d56465138141064210b181909b7aad66b9b0ee26416eba2a9b83c067a5365b49 +MISC metadata.xml 229 SHA256 445516ce54a07930b5cf708034023dddbc5fd8125be710709912ef849e623bc5 SHA512 25d354f2acdedcc4aacd99ded3c1ab0a88e038f87c8cbcd7bea1096c12e9450c9ec9666822157c9491483dfcb6d03eeeb31987d8639486ce46529a8121a04e9b WHIRLPOOL cba8e7212166ca371409754f9929209a5378f8b75d95ffaf67b7e2d1f38370f9dacbe2c4a0868e38dee117aee508ed2d782a2a12b3afa34d31703cff42aa966c diff --git a/net-misc/nxserver/files/nxserver-2.1.0-init b/net-misc/nxserver/files/nxserver-2.1.0-init new file mode 100644 index 00000000..25d13d6a --- /dev/null +++ b/net-misc/nxserver/files/nxserver-2.1.0-init @@ -0,0 +1,31 @@ +#!/sbin/runscript +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# opts="${opts} reload configtest" + +NX_SERVER_CMD="/usr/NX/bin/nxfaketime '2012-05-19 12:24:45' /usr/NX/bin/nxserver" + +depend() +{ + need net + use nxsensor +} + +start() { + ebegin "Starting nxserver" + $NX_SERVER_CMD --start + if [ $? = 0 ]; then + $NX_SERVER_CMD --statistics start + eend $? + else + eend 1 + fi +} + +stop() { + ebegin "Stopping nxserver" + $NX_SERVER_CMD --stop + $NX_SERVER_CMD --statistics stop + eend 0 +} diff --git a/net-misc/nxserver/files/nxserver-3.3.0-dontupdatekeys.patch b/net-misc/nxserver/files/nxserver-3.3.0-dontupdatekeys.patch new file mode 100644 index 00000000..ff9d2b38 --- /dev/null +++ b/net-misc/nxserver/files/nxserver-3.3.0-dontupdatekeys.patch @@ -0,0 +1,11 @@ +--- scripts/setup/nxserver.orig 2008-11-24 10:24:26.000000000 +0100 ++++ scripts/setup/nxserver 2008-11-24 10:27:38.000000000 +0100 +@@ -3149,8 +3149,6 @@ + # addNXinit + startNXStat + +- updateAutorizedKey +- + checkStr=`$NXSHELL --upgradecheck 2>&1` + result=`echo "$checkStr" | grep -c "expired" 2>&1` + if [ "$result" != "0" ]; diff --git a/net-misc/nxserver/files/nxserver-3.5.0.11-setup.patch b/net-misc/nxserver/files/nxserver-3.5.0.11-setup.patch new file mode 100644 index 00000000..b8a499dd --- /dev/null +++ b/net-misc/nxserver/files/nxserver-3.5.0.11-setup.patch @@ -0,0 +1,57 @@ +--- scripts/setup/nxserver.orig 2012-05-19 11:45:03.000000000 +0200 ++++ scripts/setup/nxserver 2013-01-21 22:40:41.958166294 +0100 +@@ -967,6 +975,12 @@ + } + + addNXUserLinux () { ++ ++ # does the NX user already exist? ++ if id nx > /dev/null 2>&1 ; then ++ return ++ fi ++ + if [ "x$system" != "xdebian" ] + then + sysuser=`useradd --help 2>&1|grep "\-r"`; +@@ -2679,6 +2693,11 @@ + system=fedora + fi + ++if grep -q "ID=gentoo" /etc/os-release || [ -f /etc/gentoo-release ]; ++then ++ system=gentoo ++fi ++ + if [ "x$system" = "x" -a -f /etc/release ]; + then + system=solaris +@@ -2713,6 +2732,7 @@ + "mandrake" ) ;; + "fedora" ) ;; + "debian" ) ;; ++ "gentoo" ) ;; + "solaris" ) ;; + "" ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unable to autodetect the operating system type, please specify it" ;; + * ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unsupported operating system '$system'" ;; +@@ -2892,21 +2912,6 @@ + fi + fi + +- +- result=`id nx 2>&1` +- if [ $? = 0 ]; +- then +-# printMsg "Cannot add user: nx. User: nx already exists" "error" +-# printMsg "Please try to fix the problem by reinstalling the server" "error" +- printMsg "Cannot add user: nx" "error" +- printMsg "User: nx already exists" "error" +- printMsgNoDot "To fix the problem, you may try to completely uninstall NX" +- printMsgNoDot "Server and install it from scratch. If this is not enough," +- printMsgNoDot "please delete the nx user by using the system commands and" +- printMsg "proceed with a new installation of NX Server" +- exit 1 +- fi +- + LOGFILE="$INSTALLOG" + createLogdirectory + startLog diff --git a/net-misc/nxserver/files/nxserver-3.5.0.11-systemd.patch b/net-misc/nxserver/files/nxserver-3.5.0.11-systemd.patch new file mode 100644 index 00000000..27145299 --- /dev/null +++ b/net-misc/nxserver/files/nxserver-3.5.0.11-systemd.patch @@ -0,0 +1,34 @@ +--- a/usr/NX/scripts/setup/nxserver 2012-05-19 03:45:03.000000000 -0600 ++++ b/usr/NX/scripts/setup/nxserver 2012-11-16 09:44:04.615561778 -0700 +@@ -649,6 +649,11 @@ + + removeNXinit () { + ++ if [ "$system" = "gentoo" ]; then ++ systemctl disable nxserver ++ return 0 ++ fi ++ + if [ "$system" = "fedora" ] || [ "$system" = "redhat" ] || [ "$system" = "suse" ]; + then + if [ -f "/sbin/chkconfig" ]; +@@ -853,6 +858,11 @@ + + addNXinit () { + ++ if [ "$system" = "gentoo" ]; then ++ systemctl enable nxserver ++ return 0 ++ fi ++ + runCommand "cat $NODE_ROOT/scripts/init/nxserver > /etc/init.d/nxserver" "Unable to create: '/etc/init.d/nxserver'" "warn" + runCommand "chmod +x /etc/init.d/nxserver" "Cannot set permissions of '/etc/init.d/nxserver' file" "warn" + +@@ -2600,6 +2610,7 @@ + echo " debian Debian Woody 3.0, Unstable, Ubuntu, etc." + echo " solaris Sun Solaris 8.0, 9.0, 10.0, etc." + echo " fedora Fedora Core 1, 2, 3, 4, 5, etc. " ++ echo " gentoo Gentoo Linux" + + echo "$errMsg" + diff --git a/net-misc/nxserver/files/nxserver.service b/net-misc/nxserver/files/nxserver.service new file mode 100644 index 00000000..96b82f87 --- /dev/null +++ b/net-misc/nxserver/files/nxserver.service @@ -0,0 +1,13 @@ +[Unit] +Description=NoMachine NX Server +Requires=sshd.service +After=sshd.service + +[Service] +ExecStart=/usr/NX/bin/nxfaketime '2012-05-19 12:24:45' /usr/NX/bin/nxserver --start +ExecStop=/usr/NX/bin/nxserver --shutdown +Type=oneshot +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/nxserver/metadata.xml b/net-misc/nxserver/metadata.xml new file mode 100644 index 00000000..acb35c32 --- /dev/null +++ b/net-misc/nxserver/metadata.xml @@ -0,0 +1,7 @@ + + + +nx +Free edition NX server from NoMachine + + diff --git a/net-misc/nxserver/nxserver-3.5.0.11-r1.ebuild b/net-misc/nxserver/nxserver-3.5.0.11-r1.ebuild new file mode 100644 index 00000000..dbe28b1d --- /dev/null +++ b/net-misc/nxserver/nxserver-3.5.0.11-r1.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/nxserver-freeedition/nxserver-freeedition-3.5.0.11-r1.ebuild,v 1.1 2013/01/22 00:15:11 voyageur Exp $ + +EAPI=4 + +inherit eutils user versionator systemd + +MAJOR_PV="$(get_version_component_range 1-3)" +FULL_PV="${MAJOR_PV}-$(get_version_component_range 4)" +DESCRIPTION="Free edition NX server from NoMachine" +HOMEPAGE="http://www.nomachine.com/" +SRC_URI="amd64? ( http://ftp.disconnected-by-peer.at/NX/Linux/nxserver-${FULL_PV}.x86_64.tar.gz ) + x86? ( http://ftp.disconnected-by-peer.at/NX/Linux/nxserver-${FULL_PV}.i386.tar.gz )" +# GPL-2 for Gentoo init script +LICENSE="nomachine GPL-2" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="" +RESTRICT="strip" + +DEPEND="=net-misc/nxnode-${MAJOR_PV}*" +RDEPEND="${DEPEND} + net-misc/nxfaketime + media-fonts/font-misc-misc + media-fonts/font-cursor-misc + x11-apps/xauth + x11-apps/xhost" + +S="${WORKDIR}"/NX + +pkg_preinst() { + enewuser nx -1 -1 /usr/NX/home/nx +} + +src_prepare() { + epatch "${FILESDIR}"/nxserver-3.3.0-dontupdatekeys.patch + epatch "${FILESDIR}"/nxserver-3.5.0.11-setup.patch + epatch "${FILESDIR}"/nxserver-3.5.0.11-systemd.patch +} + +src_install() { + # we install nxserver into /usr/NX, to make sure it doesn't clash + # with libraries installed for FreeNX + + into /usr/NX + dobin bin/nxserver + + dodir /usr/NX/etc/keys + insinto /usr/NX/etc + doins etc/administrators.db.sample + doins etc/guests.db.sample + doins etc/passwords.db.sample + doins etc/profiles.db.sample + doins etc/users.db.sample + doins etc/server.lic.sample + + newins etc/server-debian.cfg.sample server-gentoo.cfg.sample + sed -e "s|#EnableStatistics = .*|EnableStatistics = \"1\"|;" -i "${D}"/usr/NX/etc/server-gentoo.cfg.sample || die + + cp -R home "${D}"/usr/NX || die "Unable to install home folder" + + dodir /usr/NX/$(get_libdir)/perl + cp -R lib/perl "${D}"/usr/NX/$(get_libdir) || die + + cp -R scripts "${D}"/usr/NX || die "Unable to install scripts folder" + cp -R share "${D}"/usr/NX || die "Unable to install share folder" + cp -R var "${D}"/usr/NX || die "Unable to install var folder" + + newinitd "${FILESDIR}"/nxserver-2.1.0-init nxserver + + systemd_dounit "${FILESDIR}"/nxserver.service + +} + +pkg_postinst () { + # Other NX servers ebuilds may have already created the nx account + # However they use different login shell/home directory paths + if [[ ${ROOT} == "/" ]]; then + usermod -s /usr/NX/bin/nxserver nx || die "Unable to set login shell of nx user!!" + usermod -d /usr/NX/home/nx nx || die "Unable to set home directory of nx user!!" + else + elog "If you had another NX server installed before, please make sure" + elog "the nx user account is correctly set to:" + elog " * login shell: /usr/NX/bin/nxserver" + elog " * home directory: /usr/NX/home/nx" + fi + + # only run install when no configuration file is found + if [ -f /usr/NX/etc/server.cfg ]; then + einfo "Running NoMachine's update script" + "${ROOT}"/usr/NX/scripts/setup/nxserver --update || die "Update script failed" + else + einfo "Running NoMachine's setup script" + "${ROOT}"/usr/NX/scripts/setup/nxserver --install || die "Installation script failed" + fi + + if ! has_version net-misc/openssh[pam]; then + elog "" + elog "net-misc/openssh was not built with PAM support" + elog "You will need to unlock the nx account by setting a password for it" + fi + + elog "Remember to add nxserver to your default runlevel" +}