Change ebuild layout

Package-Manager: portage-2.2.20
RepoMan-Options: --force
This commit is contained in:
Mario Fetka
2016-01-10 20:24:36 +01:00
parent 5bae05b9f3
commit 9f3c9b2c2a
9 changed files with 309 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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