mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Cleanup
- .deb work - update package creation - added hyperion package icon - remove V4L2 warning for OSX build
This commit is contained in:
@@ -91,6 +91,15 @@ ln -fs $BINSP/hyperion-x11 $BINTP/hyperion-x11 2>/dev/null
|
||||
ln -fs $BINSP/hyperion-aml $BINTP/hyperion-aml 2>/dev/null
|
||||
ln -fs $BINSP/hyperion-qt $BINTP/hyperion-qt 2>/dev/null
|
||||
|
||||
# install desktop icons
|
||||
echo "---> Install Hyperion desktop icons"
|
||||
mkdir /usr/share/pixmaps/hyperion 2>/dev/null
|
||||
cp /usr/share/hyperion/desktop/*.png /usr/share/pixmaps/hyperion 2>/dev/null
|
||||
desktop-file-install /usr/share/hyperion/desktop/hyperiond.desktop 2>/dev/null
|
||||
|
||||
# cleanup desktop icons
|
||||
rm -r /usr/share/hyperion/desktop 2>/dev/null
|
||||
|
||||
#Check, if dtparam=spi=on is in place
|
||||
if [ $CPU_RPI -eq 1 ]; then
|
||||
BOOT_DIR="/boot"
|
||||
|
61
cmake/rpm/preinst
Normal file
61
cmake/rpm/preinst
Normal file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "---Hyperion ambient light preinst ---"
|
||||
|
||||
# search for users in system, returns first entry
|
||||
FOUND_USR=`who | grep -o '^\w*\b'` || "root"
|
||||
|
||||
# stop running daemon before we install
|
||||
if pgrep hyperiond > /dev/null 2>&1
|
||||
then
|
||||
if grep -m1 systemd /proc/1/comm > /dev/null
|
||||
then
|
||||
echo "--> stop init deamon: systemd"
|
||||
# systemd
|
||||
systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||
|
||||
elif [ -e /sbin/initctl ]
|
||||
then
|
||||
echo "--> stop init deamon: upstart"
|
||||
# upstart
|
||||
initctl stop hyperiond
|
||||
|
||||
else
|
||||
echo "--> stop init deamon: sysV"
|
||||
# sysV
|
||||
service hyperiond stop 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
# In case we don't use a service kill all instances
|
||||
killall hyperiond 2> /dev/null
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
#$USR=hyperionIS;
|
||||
|
||||
#addToGroup()
|
||||
##{
|
||||
# getent group $1 && adduser $USR $1;
|
||||
#}
|
||||
|
||||
#check if user exists
|
||||
#if id $USR >/dev/null 2>&1; then
|
||||
# echo "--> hyperion user exists, skip creation";
|
||||
#else
|
||||
## create user
|
||||
# echo "--> Create Hyperion user";
|
||||
# adduser --system --group $USR;
|
||||
#fi
|
||||
|
||||
# add user to groups if required
|
||||
## secondary user groups that are required to access system things
|
||||
#addToGroup(dialout);
|
||||
#addToGroup(video);
|
||||
#addToGroup(audio);
|
||||
#addToGroup(systemd-journal);
|
||||
# platform specific groups
|
||||
#addToGroup(i2c);
|
||||
#addToGroup(spi);
|
||||
#addToGroup(gpio);
|
50
cmake/rpm/prerm
Normal file
50
cmake/rpm/prerm
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "---Hyperion ambient light prerm ---"
|
||||
|
||||
# search for users in system, returns first entry
|
||||
FOUND_USR=`who | grep -o '^\w*\b'` || "root"
|
||||
|
||||
# stop running daemon before we delete it
|
||||
HYPERION_RUNNING=false
|
||||
pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
|
||||
|
||||
if grep -m1 systemd /proc/1/comm > /dev/null
|
||||
then
|
||||
echo "---> stop init deamon: systemd"
|
||||
# systemd
|
||||
$HYPERION_RUNNING && systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||
# disable user specific symlink
|
||||
echo "---> Disable service and remove entry"
|
||||
systemctl -q disable hyperiond"@${FOUND_USR}"
|
||||
rm -v /etc/systemd/system/hyperiond@.service 2>/dev/null
|
||||
|
||||
elif [ -e /sbin/initctl ]
|
||||
then
|
||||
echo "---> stop init deamon: upstart"
|
||||
# upstart
|
||||
$HYPERION_RUNNING && initctl stop hyperiond
|
||||
echo "---> Remove upstart service"
|
||||
rm -v /etc/init/hyperion* 2>/dev/null
|
||||
initctl reload-configuration
|
||||
|
||||
else
|
||||
echo "---> stop init deamon: sysV"
|
||||
# sysV
|
||||
$HYPERION_RUNNING && service hyperiond stop 2>/dev/null
|
||||
echo "---> Remove sysV service"
|
||||
update-rc.d -f hyperion remove
|
||||
rm /etc/init.d/hyperion* 2>/dev/null
|
||||
fi
|
||||
|
||||
# In case we don't use a service kill all instances
|
||||
killall hyperiond 2> /dev/null
|
||||
|
||||
# delete desktop icons; desktop-file-edit is a workaround to hide the entry and delete it afterwards manual.
|
||||
# TODO Better way for deletion and keep the desktop in sync without logout/login or desktop dependend cmds?
|
||||
echo "---> Delete Hyperion desktop icons"
|
||||
desktop-file-edit --set-key=NoDisplay --set-value=true /usr/share/applications/hyperiond.desktop 2>/dev/null
|
||||
rm -v /usr/share/applications/hyperion* 2>/dev/null
|
||||
rm -rv /usr/share/pixmaps/hyperion 2>/dev/null
|
||||
|
||||
exit 0
|
Reference in New Issue
Block a user