From b4cfb3a4d788d999c737d35ff5da632ffd173f7b Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 4 Nov 2022 17:14:09 +0100 Subject: Automated uploads, date handling --- Makefile | 17 +++++++++++++++-- install-webserver.sh | 20 ++++++++++++++++++++ plugins/webbox/webbox.cpp | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100755 install-webserver.sh diff --git a/Makefile b/Makefile index 3750d74..14f1778 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,10 @@ include common.mk VERSION=$(shell dpkg-parsechangelog --show-field Version) -DISTROS=base base-i386 debian10 debian11 ubuntu2004 ubuntu2104 ubuntu2110 ubuntu2204 +DISTROS=base base-i386 debian10 debian11 ubuntu2004 ubuntu2204 PROJECTNAME=webserver +TGZNAME=$(shell ls -t ../webserver-*.tar.xz | head -n1 | sed -e 's,^../,,') +YEAR=$(shell date +"%Y") PLUGINS= \ cgi \ fcgi \ @@ -13,7 +15,7 @@ PLUGINS= \ webbox \ weblog -CXXFLAGS+=-fPIE -DVERSION=\"$(VERSION)\" +CXXFLAGS+=-fPIE -DVERSION=\"$(VERSION)\" -DYEAR=\"$(YEAR)\" LDLIBS+=\ -lcommon \ @@ -103,12 +105,20 @@ $(DISTROS): deb-src debs: $(DISTROS) +upload: + scp ../$(TGZNAME) antcom.de:/var/www/reichwein.it-download/ + scp -r result antcom.de: + scp -r install-webserver.sh antcom.de: + ssh antcom.de ./install-webserver.sh $(VERSION) + ssh antcom.de rm -rf install-webserver.sh result + clean: -rm -f $(PROJECTNAME) -rm -f plugins/*.so -find . -name '*.o' -o -name '*.d' -o -name '*.gcno' -o -name '*.gcda' -o -name '*.so' | xargs rm -f #for i in $(PLUGINS) ; do $(MAKE) -C plugins/$$i clean ; done for i in libcommon tests ; do $(MAKE) -C $$i clean ; done + -rm -rf result DISTFILES= \ archive.h \ @@ -141,6 +151,7 @@ DISTFILES= \ webserver.1 \ README.txt \ LICENSE.txt \ + install-webserver.sh \ Makefile \ common.mk \ debian/changelog \ @@ -214,6 +225,8 @@ dist: clean rm -rf $(PROJECTNAME)-$(VERSION) ls -l ../$(PROJECTNAME)-$(VERSION).tar.xz +dist-all: dist upload + .PHONY: clean all zip test install deb deb-src debs all $(DISTROS) $(PLUGINS) -include $(wildcard $(SRC:.cpp=.d)) diff --git a/install-webserver.sh b/install-webserver.sh new file mode 100755 index 0000000..9afab7b --- /dev/null +++ b/install-webserver.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Script to be run on webserver to install *.deb and *.tgz +# + +set -e + +if [ "$#" != "1" ] ; then + echo "Usage: install-webserver.sh " +fi + +VERSION=$1 +DISTROS="debian10 debian11 ubuntu2004 ubuntu2204" + +cd /var/www/reichwein.it-debian + +for i in $DISTROS; do + echo "Installing webserver for $i ..." + reprepro -C $i --ignore=wrongdistribution include stable /home/rr/result/$i/webserver_${VERSION}_amd64.changes +done diff --git a/plugins/webbox/webbox.cpp b/plugins/webbox/webbox.cpp index c8e4b38..ac54394 100644 --- a/plugins/webbox/webbox.cpp +++ b/plugins/webbox/webbox.cpp @@ -347,7 +347,7 @@ protected: virtual std::string start(CommandParameters& p) { p.m_SetResponseHeader("content_type", "text/plain"); - return p.m_GetServerParam("version") + "
(C) 2021 Reichwein.IT"; + return p.m_GetServerParam("version") + "
(C) " YEAR " Reichwein.IT"; } }; -- cgit v1.2.3