#!/bin/bash # # domoticz.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # domoticz.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="domoticz" PACKAGE_EXT="tgz" VERSION=${VERSION:=4.10717} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi if [ "$ARCH" != "x86_64" ]; then echo "Only for 64 bit systems" exit fi check_required SRC="domoticz_linux_x86_64-$VERSION.$PACKAGE_EXT" URL="https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz" get_source $SRC $URL mkdir -p $PKG/opt/domoticz/home cd $PKG/opt/domoticz tar xfvz $CWD/$SRC cd $TMP chown -R 311:311 $PKG/opt/domoticz # Install setup and init scripts mkdir -p $PKG/etc/rc.d/init.d cp $CWD/init.domoticz $PKG/etc/rc.d/init.d/domoticz.new chmod 755 $PKG/etc/rc.d/init.d/domoticz.new mkdir -p $PKG/var/log/setup cp $CWD/setup.domoticz $PKG/var/log/setup chmod 755 $PKG/var/log/setup/setup.domoticz mkdir -p $PKG/etc/default cp $CWD/default.domoticz $PKG/etc/default/domoticz.new mkdir -p $DOCS cp -a $PKG/opt/domoticz/*.txt $DOCS chown root:root $DOCS/* chmod 644 $DOCS/* fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi