hyperion.ng/cmake/rpm/postinst
redPanther 0940872870 create debian packages / multiple configs (#650)
* implement make install
set CMAKE_INSTALL_PREFIX e.g. to /opt to install to /opt/hyperion
set ENABLE_SYSTEM_INSTALL to ON to activate installation
after compiling use
make install
or
make install/strip
(for performance/size optimized binaries - compile in Release to get best performance)

* cleanup cmake files
use
cmake -DINSTALL_PREFIX=/opt/hyperion ..
to install all files to hyperion or
cmake -DINSTALL_PREFIX=/usr/
to install to usr. install folders are linux standard. bin go to bin folder and additionals (effects) go to share/hyperion

* add uninstall target - be patient with that, this will remove files from your system
install service files to share/hyperion - if you want to use them you have to make a symlink to your location of service files

* optimize build release script
install service files into hyperion share folder (services not activated, this must be done by distribution package script)
initial support of cmake option -DPLATFORM= option. This selects platform specific cmake flags. no need for -DENABLE_... options (unless you want some special things)
automatic detect for apple build

* update submodule

* fix cmake error when no platform is given

* initial support for deb,rpm and tgz packages - no usefull content atm!

* make packeages contain usefull stuff

* add license
make packes more functional. package specific install missing yet

* implement debian postinstall

* disable rpm generation until it has a working state

* add hypercon compat

* add posibility for multiple config files. first one found is taken


Former-commit-id: 1c2669961da98fd05a97359e75f1d6d68e126715
2016-05-24 19:56:43 +02:00

58 lines
1.5 KiB
Bash

#!/bin/sh
install_file()
{
src="$1"
dest="$2"
if [ -e "$dest" ] && ! cmp --quiet "$src" "$dest"
then
cp "$src" "${dest}.new"
else
cp "$src" "${dest}"
fi
}
echo "--- hyperion ambilight postinstall ---"
echo "- install configuration template"
mkdir -p /etc/hyperion
install_file /usr/share/hyperion/config/hyperion.config.json /etc/hyperion/hyperion.config.json
if grep -m1 systemd /proc/1/comm > /dev/null
then
# systemd
echo
systemctl stop hyperion 2> /dev/null
install_file /usr/share/hyperion/service/hyperion.systemd.sh /etc/systemd/system/hyperion.service
systemctl -q enable hyperion.service
# if [ $OS_OSMC -eq 1 ]; then
# echo '---> Modify systemd script for OSMC usage'
# # Wait until kodi is sarted (for kodi checker)
# sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service
# sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service
# sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service
# sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service
# systemctl -q daemon-reload
# fi
systemctl start hyperion
elif [ -e /sbin/initctl ]
then
# upstart
install_file /usr/share/hyperion/service/hyperion.initctl.sh /etc/init/hyperion.conf
initctl reload-configuration
initctl start hyperion
else
# sysV
service hyperion stop 2>/dev/null
install_file /usr/share/hyperion/service/hyperion.init.sh /etc/init.d/hyperion
chmod +x /etc/init.d/hyperion
update-rc.d hyperion defaults 98 02
service hyperion start
fi
echo "- done"