This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: 1c26699
- Loading branch information
1 parent
409ef38
commit 0940872
Showing
22 changed files
with
218 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2014 hyperion team | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/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" | ||
|
||
# hypercon compat | ||
mkdir -p /opt/hyperion/config | ||
ln -sf /usr/share/hyperion/effects /opt/hyperion/effects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
SET(CPACK_GENERATOR "DEB" "RPM" "TGZ" ) | ||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "hyperion team") | ||
include (CPack) | ||
# cmake file for generating distribution packages | ||
|
||
SET ( CPACK_GENERATOR "DEB" "TGZ" "STGZ" ) # "RPM" | ||
|
||
SET ( CPACK_PACKAGE_NAME "hyperion" ) | ||
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hyperion is an opensource 'AmbiLight' implementation" ) | ||
SET ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" ) | ||
SET ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" ) | ||
|
||
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_SECTION "Miscellaneous" ) | ||
|
||
SET ( CPACK_RPM_PACKAGE_NAME "hyperion" ) | ||
SET ( CPACK_RPM_PACKAGE_URL "https://github.com/hyperion-project/hyperion" ) | ||
SET ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/postinst" ) | ||
|
||
SET(CPACK_PACKAGE_VERSION_MAJOR "1") | ||
SET(CPACK_PACKAGE_VERSION_MINOR "3") | ||
SET(CPACK_PACKAGE_VERSION_PATCH "0") | ||
|
||
SET ( CPACK_COMPONENTS_ALL ambilight ) | ||
SET ( CPACK_ARCHIVE_COMPONENT_INSTALL ON ) | ||
SET ( CPACK_DEB_COMPONENT_INSTALL ON ) | ||
SET ( CPACK_RPM_COMPONENT_INSTALL ON ) | ||
SET ( CPACK_STRIP_FILES ON ) | ||
|
||
# no code after following line! | ||
INCLUDE ( CPack ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,7 +363,7 @@ | |
{ | ||
"paths" : | ||
[ | ||
"/home/dincs/projects/hyperion/effects" | ||
"/opt/hyperion/effects" | ||
] | ||
}, | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.