debian package (#669)

* 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

* remove hyperion comaptlayer
services is not started automaticly

* rework debian postinstall:
- remove /opt compatibility complety. This makes more trouble as it is usefull
- when hyperiond already started, restart it
- cleanup

* add deb package dependencies

* wipe out last support for /opt installation

* change default effect path in config to /usr

* revert service files and config files


Former-commit-id: 4462021775b71a78497e0f0887a9f58111f91a5e
This commit is contained in:
redPanther 2016-06-02 19:54:37 +02:00 committed by brindosch
parent 57e74e52f5
commit 4f6ab258ef
2 changed files with 49 additions and 22 deletions

View File

@ -7,10 +7,13 @@ install_file()
if [ -e "$dest" ] && ! cmp --quiet "$src" "$dest"
then
echo "INFO: $dest exists, new version copied to ${dest}.new"
cp "$src" "${dest}.new"
else
cp "$src" "${dest}"
return 1
fi
cp "$src" "${dest}"
return 0
}
@ -20,13 +23,33 @@ 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
HYPERION_RUNNING=false
pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
start_msg=""
restart_msg=""
SERVICE_POSTFIX=""
if [ -e /sbin/initctl ]
then
echo "- init deamon: upstart"
# upstart
$HYPERION_RUNNING && initctl stop hyperion
install_file /usr/share/hyperion/service/hyperion.initctl.sh /etc/init/hyperion.conf || SERVICE_POSTFIX=".new"
initctl reload-configuration
start_msg="initctl start hyperion"
$HYPERION_RUNNING && initctl start hyperion
elif grep -m1 systemd /proc/1/comm > /dev/null
then
echo "- init deamon: systemd"
# systemd
echo
systemctl stop hyperion 2> /dev/null
install_file /usr/share/hyperion/service/hyperion.systemd.sh /etc/systemd/system/hyperion.service
$HYPERION_RUNNING && systemctl stop hyperion 2> /dev/null
install_file /usr/share/hyperion/service/hyperion.systemd.sh /etc/systemd/system/hyperion.service || SERVICE_POSTFIX=".new"
systemctl -q enable hyperion.service
start_msg="systemctl start hyperion"
$HYPERION_RUNNING && systemctl start hyperion
# if [ $OS_OSMC -eq 1 ]; then
# echo '---> Modify systemd script for OSMC usage'
# # Wait until kodi is sarted (for kodi checker)
@ -36,25 +59,29 @@ then
# 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
# systemctl start hyperion
else
echo "- init deamon: sysV"
# sysV
service hyperion stop 2>/dev/null
install_file /usr/share/hyperion/service/hyperion.init.sh /etc/init.d/hyperion
$HYPERION_RUNNING && service hyperion stop 2>/dev/null
install_file /usr/share/hyperion/service/hyperion.init.sh /etc/init.d/hyperion || SERVICE_POSTFIX=".new"
chmod +x /etc/init.d/hyperion
update-rc.d hyperion defaults 98 02
service hyperion start
start_msg="service hyperion start"
$HYPERION_RUNNING && service hyperion start
fi
echo "-----------------------------------------------------------------------------"
echo "- hyperion is installed, please check your configuration in /etc/hyperion/ -"
echo "-----------------------------------------------------------------------------"
if [ -e /opt/hyperion/ ]
then
echo
echo "---------------------------------------------------------------------------------"
echo "- It seemd that you have an older version of hyperion installed in /opt/hyerion -"
echo "- please remove it and check your config to avoid problems -"
echo "---------------------------------------------------------------------------------"
fi
echo "- done"
# hypercon compat
mkdir -p /opt/hyperion/config
ln -sf /usr/share/hyperion/effects /opt/hyperion/effects

View File

@ -11,7 +11,7 @@ SET ( CPACK_DEBIAN_PACKAGE_MAINTAINER "hyperion team")
SET ( CPACK_DEBIAN_PACKAGE_NAME "hyperion" )
SET ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst" )
SET ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/hyperion-project/hyperion" )
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4 (>= 4:4.8.0), libqt4-network (>= 4:4.8.0)" )
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "libqtcore4 (>= 4:4.8.0), libqt4-network (>= 4:4.8.0), libusb-1.0-0, libpython2.7, libc6" )
SET ( CPACK_DEBIAN_PACKAGE_SECTION "Miscellaneous" )
SET ( CPACK_RPM_PACKAGE_NAME "hyperion" )