From 9f3c9b2c2a37e5464504f066128d3f1fb342459a Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 10 Jan 2016 20:24:36 +0100 Subject: [PATCH] Change ebuild layout Package-Manager: portage-2.2.20 RepoMan-Options: --force --- net-misc/nxnode/ChangeLog | 11 ++ net-misc/nxnode/Manifest | 10 ++ net-misc/nxnode/files/nxnode-3.0.0-init | 68 ++++++++++ .../nxnode/files/nxnode-3.4.0-cups_path.patch | 12 ++ .../nxnode/files/nxnode-3.4.0-setup.patch | 39 ++++++ .../nxnode/files/nxnode-3.4.0-systemd.patch | 32 +++++ net-misc/nxnode/files/nxsensor.service | 9 ++ net-misc/nxnode/metadata.xml | 6 + net-misc/nxnode/nxnode-3.5.0.9.ebuild | 122 ++++++++++++++++++ 9 files changed, 309 insertions(+) create mode 100644 net-misc/nxnode/ChangeLog create mode 100644 net-misc/nxnode/Manifest create mode 100644 net-misc/nxnode/files/nxnode-3.0.0-init create mode 100644 net-misc/nxnode/files/nxnode-3.4.0-cups_path.patch create mode 100644 net-misc/nxnode/files/nxnode-3.4.0-setup.patch create mode 100644 net-misc/nxnode/files/nxnode-3.4.0-systemd.patch create mode 100644 net-misc/nxnode/files/nxsensor.service create mode 100644 net-misc/nxnode/metadata.xml create mode 100644 net-misc/nxnode/nxnode-3.5.0.9.ebuild diff --git a/net-misc/nxnode/ChangeLog b/net-misc/nxnode/ChangeLog new file mode 100644 index 00000000..0df4d247 --- /dev/null +++ b/net-misc/nxnode/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-misc/nxnode +# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*nxnode-3.5.0.9 (10 Jan 2016) + + 10 Jan 2016; +files/nxnode-3.0.0-init, + +files/nxnode-3.4.0-cups_path.patch, +files/nxnode-3.4.0-setup.patch, + +files/nxnode-3.4.0-systemd.patch, +files/nxsensor.service, +metadata.xml, + +nxnode-3.5.0.9.ebuild: + Change ebuild layout diff --git a/net-misc/nxnode/Manifest b/net-misc/nxnode/Manifest new file mode 100644 index 00000000..9ffdb0f4 --- /dev/null +++ b/net-misc/nxnode/Manifest @@ -0,0 +1,10 @@ +AUX nxnode-3.0.0-init 1389 SHA256 f8ac3bbf0fb807e5cd279a4066e197f6cab4af8aa9668670cc8e7aa1664c7b0b SHA512 8ab7b3cfe1b347103cf5fb336df881a60322046c8c24adcdef1243a29f7c20e1e3df5b6180bfa1956ab561ec5f265e6351de87c1306e94fdac4351c14d586c1b WHIRLPOOL 77201639ffd5be32e71efc11e87008411084efbeb566389e312bc888e17d8efd74860055e05670388407dceae49f70aac0c17d1899f85dc16c3d05242b98cf67 +AUX nxnode-3.4.0-cups_path.patch 528 SHA256 17bb5f2636de1ba5550fca8811f877c743ffaba9c5db20a1ce613aec8d5a3587 SHA512 8b20dfa2a2491f41d3739b283bc9d0d31fe5fdc703a9b0aacdf760182b1ce5713dbcbf905929d1d02c07a4a3049ef21cd8f7f4e7625662356f5b7d1dab02d16e WHIRLPOOL 8182a2033eb46385a540658e61223c5c41cee92e2df9f502a429f2a1be6cb236ccd8c0a04d23efbdf88d174beabd384ef02917a08f6a5964004e0a9e3808d887 +AUX nxnode-3.4.0-setup.patch 1216 SHA256 1d1f1e08c073d597db89507f9617aaa90234682c96772be1a5370a49f74ca04b SHA512 7d37097dfdb036560f64c79ea57836ace64211f6413e856bb7166f2fa22614f1cdce92c828a9cf37140ffc10348d221c8f78f2e8861aa6a6f5f11dc9436564ca WHIRLPOOL 51e28171f9a6b1b0f631c52d9be8434fa6477c19daac64cea7170cb7a279a06b01c5282da5ea7cea16207a5fcdcdd0af44b6cbff43470c354981e84c5ca5bd92 +AUX nxnode-3.4.0-systemd.patch 1009 SHA256 a9f7dda5b7107e4fea11752dabe774a233071bd6c0cbae0f9ff9d0afb31cc738 SHA512 26eb9ea389f615b551b22aeed8178dac34798ef36199cbe9fb12ae077f8991ce0793df90d78c65bf2d7a1fe2328e765444cb191a96b41605c150607f3cc607c1 WHIRLPOOL 15501bb4ad5554959953a5dd4f92bf499810bbb3f7460bb2f22f269b1178e8766e7c40429dfb1e7e6bcdcd36faff49810a09775489ac2f5e36eac13853631f67 +AUX nxsensor.service 240 SHA256 a71a6dbe32f3906caddf88fa4ba7b71035467cbb6bf8b17d75f14a0016af6bac SHA512 cc1ac5c825bf6a75186c69f5489efa9648f5a7856327d016cb6c11ef46fcf8e02e2159884d9bbf42ee17cce32dc49033d1d42c694ea453b56be2521421642046 WHIRLPOOL 288da5333c5f5bc09b9246ff28ed0708b1189ef1778e39ece00a40239f6d4db53e08eb69693941c9712617060930e918d727dff4f190dfcfe49a7592d469098d +DIST nxnode-3.5.0-9.i386.tar.gz 6047696 SHA256 93310cd78617ca3619fbf093d6760c00459367ebf824ec643c1c5f20202d8488 SHA512 6d35c0bbc436e1773349c2b2c54039c6c5caabdf95977e0281d1be66402e65a977cbcce6f384f42e068db788785f2722f0ed5a5564acbeef2a64cd7b23f52ef6 WHIRLPOOL 9bda55697ea59d9595ef763d73b6b8c4254941cfe4eb79c8fbfa537f5cdf8cc2ead1c5537daca7b995fbde7a003f2cd8f9c817ccad4c2cabedd15d0cedcce191 +DIST nxnode-3.5.0-9.x86_64.tar.gz 6748262 SHA256 555ed1d18280825075c617effec2cfdc83fd2d8be189b08b09288abefbe86238 SHA512 151858b7417abcbc42fffe55cff4bc43fa2d7245c10d77d83557ff68936d5cd2199e7a7c7b0156c580a1a0b3b6b218313138113c94354e969ce0c27b26fd86f9 WHIRLPOOL 8e824828f929dac83ddda076afd4e99e35dbe52354d265b8bae406f8de4c51f01e690afd547b83028f1bd6c90094631022b549f27bd0d5729fb31350003d5190 +EBUILD nxnode-3.5.0.9.ebuild 3834 SHA256 e08a2c421e401fed9fed243ac666cdaf24b6cb9dbbe495793fbc8a6301c7bc4d SHA512 96a96d1c4250a06786987853839f41559b0c0be29d76a7a97e38a8ec2b9b68fb82b80e2c9f6714309e19dbc7bdc24ed73913c45e2bdd3504fac38991965c6677 WHIRLPOOL 1e5f4c5b8fb044877e9a1b9c40d7ba72ad08b5f732945fa1ce9ee4c2f326e256b6855282d7ca44cc5a2fea11d1449346ccd4b81c76377eb935c3149fa1fb064e +MISC ChangeLog 406 SHA256 9277e4a2512853b13dcc03b0987081412618e87607f8fa274c6023193e72cb00 SHA512 83fdd4653cfdeef9670b381781e5c6a70477803084c3e0ca3b69f145693c01b7e11fae28842bdaad550e3b41c256093794ef9f9ac27a21ba4465afb273088538 WHIRLPOOL 541db9329b480c414a5525291160235b1f843296c70cc00944ccb37e7df683ef1b7f5bc91b0039a23daa64f1939b7b99f4af97c9b7fd300361b913a7801127b5 +MISC metadata.xml 264 SHA256 3eaf6b268d16ec374617534bf70f0e96d2c6399ca1b0d4ffa3eeee619d775171 SHA512 f6cd27b05c66a2890b5b9474cb56820fdc44ebbb7c9e4d23c9581f9c79c11c41e86d16428a47fe12133db8e3f34fd88e815393729232c4a8ee90cf0c4cb5dc32 WHIRLPOOL feac429f964a1c9570264b391868649a23095c71dcec0e78cf233868e5d9ba2341e1228bbaf94db933fde2f85d2d91cd805ed175ea71175374a50138057817a1 diff --git a/net-misc/nxnode/files/nxnode-3.0.0-init b/net-misc/nxnode/files/nxnode-3.0.0-init new file mode 100644 index 00000000..5b93eaa6 --- /dev/null +++ b/net-misc/nxnode/files/nxnode-3.0.0-init @@ -0,0 +1,68 @@ +#!/sbin/runscript +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +NX_NODE_CFG="/usr/NX/etc/node.cfg" +NX_SENSOR_CMD="/usr/NX/bin/nxfaketime '2012-05-19 12:24:45' /usr/NX/bin/nxsensor" +NX_SENSOR_PID="/usr/NX/var/run/nxsensor.pid" +NX_SENSOR_HOST="127.0.0.1" +NX_SENSOR_PORT="19250" + +depend() +{ + need net +} + +is_enabled() +{ + local tmp + + if ! [[ -x $NX_SENSOR_CMD ]] ; then + eerror "$NX_SENSOR_CMD not found" + return 1 + fi + + tmp=`/usr/bin/awk -F'"' '/^EnableSensor/ {print $2}' $NX_NODE_CFG` + if [[ $tmp != "1" ]]; then + eerror "nxsensor is disabled in $NX_NODE_CFG" + return 1 + fi + + tmp=`/usr/bin/awk -F'"' '/^StatisticsHost/ {print $2}' $NX_NODE_CFG` + if [[ -n $tmp ]] ; then + NX_SENSOR_HOST="$tmp" + fi + + tmp=`/usr/bin/awk -F'"' '/^NodeSensorPort/ {print $2}' $NX_NODE_CFG` + if [[ -n $tmp ]] ; then + NX_SENSOR_PORT="$tmp" + fi + + return 0 +} + +start() { + is_enabled || return 1 + ebegin "Starting nxsensor" + $NX_SENSOR_CMD -a $NX_SENSOR_HOST -a "::ffff:$NX_SENSOR_HOST" -P $NX_SENSOR_PORT -d + PID=`ps -ef | grep $NX_SENSOR_CMD | grep -v grep | awk '{print $2}'` + if [[ -z $PID ]] ; then + eend 1 + else + echo $PID > $NX_SENSOR_PID + eend 0 + fi +} + +stop() { + ebegin "Stopping nxsensor" + PID=`cat $NX_SENSOR_PID` + if [[ -z $PID ]] ; then + eerror "nxsensor not started" + eend 1 + else + kill $PID + rm -f $NX_SENSOR_PID + eend 0 + fi +} diff --git a/net-misc/nxnode/files/nxnode-3.4.0-cups_path.patch b/net-misc/nxnode/files/nxnode-3.4.0-cups_path.patch new file mode 100644 index 00000000..a4a3822a --- /dev/null +++ b/net-misc/nxnode/files/nxnode-3.4.0-cups_path.patch @@ -0,0 +1,12 @@ +diff -ruN NX~/scripts/setup/nxnode NX/scripts/setup/nxnode +--- NX~/scripts/setup/nxnode 2010-08-04 12:34:28.000000000 +0200 ++++ NX/scripts/setup/nxnode 2010-10-20 12:34:05.418016564 +0200 +@@ -25,7 +25,7 @@ + + WRAPPER="$NODE_ROOT/bin/nxuexec" + +-CUPS_PATH="/usr /opt/sfw/cups /usr/local /usr/lib /opt/csw" ++CUPS_PATH="/usr /opt/sfw/cups /usr/local /usr/lib /opt/csw /usr/libexec" + SMB_PATH="/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin" + CUPS_CERTS_DIR="/var/run/cups/certs /var/lib/cups/certs /etc/cups/certs" + diff --git a/net-misc/nxnode/files/nxnode-3.4.0-setup.patch b/net-misc/nxnode/files/nxnode-3.4.0-setup.patch new file mode 100644 index 00000000..67dba122 --- /dev/null +++ b/net-misc/nxnode/files/nxnode-3.4.0-setup.patch @@ -0,0 +1,39 @@ +--- scripts/setup/nxnode.orig 2009-09-24 18:12:36.000000000 +0200 ++++ scripts/setup/nxnode 2009-12-15 21:22:27.000000000 +0100 +@@ -481,7 +481,7 @@ + echo "# + # Specify path and name of the command to start the GNOME session. + # +-CommandStartGnome=\"$DBUS_PATH --exit-with-session gnome-session\" ++CommandStartGnome=\"/etc/X11/Sessions/Gnome\" + " >> $CONFIG_FILE; + fi + +@@ -525,7 +525,7 @@ + cmdGnome="/etc/X11/Xsession gnome-session" + elif [ $DBUS = "1" ] && [ "x$DBUS_PATH" != "x" ]; + then +- cmdGnome="$DBUS_PATH --exit-with-session gnome-session" ++ cmdGnome="/etc/X11/Sessions/Gnome" + else + cmdGnome="gnome-session" + fi +@@ -2489,6 +2497,10 @@ + system=fedora + fi + ++if [ -d /usr/portage ]; then ++ system=gentoo ++fi ++ + if [ "x$system" = "x" -a -f /etc/release ]; + then + system=solaris +@@ -2523,6 +2535,7 @@ + "fedora" ) ;; + "debian" ) ;; + "solaris" ) ;; ++ "gentoo" );; + "" ) 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'" ;; + esac diff --git a/net-misc/nxnode/files/nxnode-3.4.0-systemd.patch b/net-misc/nxnode/files/nxnode-3.4.0-systemd.patch new file mode 100644 index 00000000..93439aa7 --- /dev/null +++ b/net-misc/nxnode/files/nxnode-3.4.0-systemd.patch @@ -0,0 +1,32 @@ +--- a/usr/NX/scripts/setup/nxnode 2012-05-19 04:24:46.000000000 -0600 ++++ b/usr/NX/scripts/setup/nxnode 2012-11-16 09:18:10.801770960 -0700 +@@ -1301,6 +1301,10 @@ + } + + removeNXinit () { ++ if [ "$system" = "gentoo" ]; then ++ systemctl disable nxsensor ++ return 0 ++ fi + + if [ "$system" = "fedora" ] || [ "$system" = "redhat" ] || [ "$system" = "suse" ]; + then +@@ -1505,6 +1509,10 @@ + + + addNXinit () { ++ if [ "$system" = "gentoo" ]; then ++ systemctl enable nxsensor ++ return 0 ++ fi + + runCommand "cat $NODE_ROOT/scripts/init/nxsensor > /etc/init.d/nxsensor" "Unable to create: '/etc/init.d/nxsensor'" "warn" + runCommand "chmod +x /etc/init.d/nxsensor" "Cannot set permissions of '/etc/init.d/nxsensor' file" "warn" +@@ -2479,6 +2487,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/nxnode/files/nxsensor.service b/net-misc/nxnode/files/nxsensor.service new file mode 100644 index 00000000..a986db54 --- /dev/null +++ b/net-misc/nxnode/files/nxsensor.service @@ -0,0 +1,9 @@ +[Unit] +Description=NoMachine nxsensor service + +[Service] +ExecStart=/usr/NX/bin/nxfaketime '2012-05-19 12:24:45' /usr/NX/bin/nxsensor "-a" "127.0.0.1" "-a" "::ffff:127.0.0.1" "-P" "19250" +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/nxnode/metadata.xml b/net-misc/nxnode/metadata.xml new file mode 100644 index 00000000..88915d14 --- /dev/null +++ b/net-misc/nxnode/metadata.xml @@ -0,0 +1,6 @@ + + + +nx +Shared components between the different editions of NoMachine's NX Server + diff --git a/net-misc/nxnode/nxnode-3.5.0.9.ebuild b/net-misc/nxnode/nxnode-3.5.0.9.ebuild new file mode 100644 index 00000000..30f1b01b --- /dev/null +++ b/net-misc/nxnode/nxnode-3.5.0.9.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/nxnode/nxnode-3.5.0.9.ebuild,v 1.2 2012/07/12 08:49:36 voyageur Exp $ + +EAPI=4 + +inherit eutils user versionator systemd multilib + +MAJOR_PV="$(get_version_component_range 1-3)" +FULL_PV="${MAJOR_PV}-$(get_version_component_range 4)" +DESCRIPTION="shared components between the different editions of NoMachine's NX Servers" +HOMEPAGE="http://www.nomachine.com/" +SRC_URI="amd64? ( http://ftp.disconnected-by-peer.at/NX/Linux/nxnode-${FULL_PV}.x86_64.tar.gz ) + x86? ( http://ftp.disconnected-by-peer.at/NX/Linux/nxnode-${FULL_PV}.i386.tar.gz )" + +# GPL-2 for Gentoo init script +LICENSE="nomachine GPL-2" +SLOT="0" +KEYWORDS="-* amd64 x86" +IUSE="rdesktop vnc" +RESTRICT="strip" + +DEPEND="" +RDEPEND="=net-misc/nxclient-${MAJOR_PV}*[cups] + net-misc/nxfaketime + sys-process/lsof + x11-libs/libICE + x11-libs/libXmu + x11-libs/libSM + x11-libs/libXt + x11-libs/libXaw + x11-libs/libXpm + x11-apps/xrdb + rdesktop? ( net-misc/rdesktop ) + vnc? ( x11-misc/x11vnc + net-misc/tightvnc )" + +S=${WORKDIR}/NX + +pkg_preinst() +{ + enewuser nx -1 -1 /usr/NX/home/nx +} + +src_prepare() +{ + epatch "${FILESDIR}"/nxnode-3.4.0-setup.patch + epatch "${FILESDIR}"/nxnode-3.4.0-cups_path.patch + epatch "${FILESDIR}"/nxnode-3.4.0-systemd.patch +} + +src_install() +{ + # we install nxnode into /usr/NX, to make sure it doesn't clash + # with libraries installed for FreeNX + + into /usr/NX + for x in nxagent nxnode nxsensor nxspool nxuexec ; do + dobin bin/$x + done + + dodir /usr/NX/etc + cp etc/node-debian.cfg.sample "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + sed -e 's|COMMAND_FUSER = .*|COMMAND_FUSER = "/usr/bin/fuser"|;' -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + sed -e "s|NX/lib|NX/$(get_libdir)|g" -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + sed -e "s|#AgentLibraryPath = .*|AgentLibraryPath = \"/usr/NX/$(get_libdir)\"|;" -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + sed -e "s|#ProxyLibraryPath = .*|ProxyLibraryPath = \"/usr/NX/$(get_libdir)\"|;" -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + #sed -e "s|#ApplicationLibraryPath = .*|ApplicationLibraryPath = \"/usr/NX/$(get_libdir)\"|;" -i "${D}"/usr/NX/etc/node-gentoo.cfg.sample || die + cp etc/node.lic.sample "${D}"/usr/NX/etc/node.lic.sample || die + + for x in esddsp esd expat X11 Xcompext Xcomposite Xcompshad Xdamage Xext Xfixes Xft Xpm Xrandr Xrender Xtst ; do + dolib.so lib/lib${x}.so.* + done + + dodir /usr/NX/$(get_libdir)/perl + cp -R lib/perl "${D}"/usr/NX/$(get_libdir) || die + + # Symlinks for keeping original folder structure and + # add a link lib to $(get_libdir) if we are e.g. on amd64 multilib + if [ "$(get_libdir)" != "lib" ]; then + dosym "$(get_libdir)" /usr/NX/lib + fi + + dodir /usr/NX/scripts + cp -R scripts "${D}"/usr/NX || die + + dodir /usr/NX/share + cp -R share "${D}"/usr/NX || die + + dodir /usr/NX/var + cp -R var "${D}"/usr/NX || die + + dodir /etc/init.d + newinitd "${FILESDIR}"/nxnode-3.0.0-init nxsensor + + systemd_dounit "${FILESDIR}"/nxsensor.service +} + +pkg_postinst() +{ + # Only install license file if none is found + if [ ! -f /usr/NX/etc/node.lic ]; then + cp "${ROOT}"/usr/NX/etc/node.lic.sample "${ROOT}"/usr/NX/etc/node.lic || die + chmod 0400 "${ROOT}"/usr/NX/etc/node.lic + chown nx:0 "${ROOT}"/usr/NX/etc/node.lic + fi + + # only run install on the first time + if [ -f /usr/NX/etc/node.cfg ]; then + einfo "Running NoMachine's update script" + "${ROOT}"/usr/NX/scripts/setup/nxnode --update + else + einfo "Running NoMachine's setup script" + "${ROOT}"/usr/NX/scripts/setup/nxnode --install + fi + + elog "If you want server statistics, please add nxsensor to your default runlevel" + elog + elog " rc-update add nxsensor default" + elog + elog "You will also need to change EnableSensor to 1 in /usr/NX/etc/node.cfg" +}