#!/bin/sh # # $Id: mkfhemnightly 13678 2017-03-12 10:18:04Z betateilchen $ # # create nightly build and transfer it to static webspace # (C) 2013-2017 betateilchen # # may be called with optional parameter "quiet" # clear echo "#" echo "# Starting FHEM package build (nightly)" echo "#" QUIET=$1 DATE=`date +%d.%m.%y` TIME=`date +%X` ###################################################################### # update svn repo # cd ~/fhem.svn if [ "$QUIET" = "quiet" ] then svn update > /dev/null else svn update fi MAJOR=`cat Makefile |grep '^VERS=' |sed 's/VERS=//' |sed 's/\r//'` MINOR=`svn info | grep 'Revision' | awk '{ print $2; }'` # ###################################################################### ###################################################################### # replace version infos in various html files # because Amazon S3 does not support shtml # echo "# $MAJOR.$MINOR" echo "#" echo "# $DATE $TIME" echo "#" echo "# updating templates with version infos" cd ~/scripts cp templates/index.template index.html sed -i s/==MAJOR==/$MAJOR/g index.html sed -i s/==MINOR==/$MINOR/g index.html sed -i s/==DATE==/$DATE/g index.html sed -i s/==TIME==/$TIME/g index.html mv index.html ../debianfhemde/ cp templates/nightly.template nightly.html sed -i s/==MAJOR==/$MAJOR/g nightly.html sed -i s/==MINOR==/$MINOR/g nightly.html mv nightly.html ../debianfhemde/html/ cp templates/manual.template manual.html sed -i s/==MAJOR==/$MAJOR/g manual.html mv manual.html ../debianfhemde/html/ #exit # for debugging # ###################################################################### ###################################################################### # build nightly deb package # echo "#" echo "# processing Makefile - be patient..." echo "#" cd ~/fhem.svn if [ "$QUIET" = "quiet" ] then make --silent deb else make deb fi mkdir -p ~/debianfhemde/nightly > /dev/null mv fhem-$MAJOR.deb ~/debianfhemde/nightly/ # ###################################################################### ###################################################################### # create package informations for aptitude # and sign all the stuff # echo "#" echo "# creating package index for aptitude" echo "#" cd ~/debianfhemde/ apt-ftparchive packages nightly > nightly/Packages sed -i s/nightly.//g nightly/Packages cd nightly gzip -c Packages > Packages.gz cd .. apt-ftparchive release nightly > nightly/Release gpg --batch --yes --passphrase-file ~/.gnupg/passphrase.txt --clearsign -o nightly/InRelease nightly/Release gpg --batch --yes --passphrase-file ~/.gnupg/passphrase.txt --output nightly/Release.gpg -bas nightly/Release # ###################################################################### ###################################################################### # sync to Amazon S3 Instance # echo "# starting sync" echo "#" cd ~/debianfhemde if [ "$QUIET" = "quiet" ] then aws s3 sync . s3://debian.fhem.de --delete > /dev/null else aws s3 sync . s3://debian.fhem.de --delete; echo "#"; fi echo "# done." echo "#" # ######################################################################