summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2022-11-04 17:14:09 +0100
committerRoland Reichwein <mail@reichwein.it>2022-11-04 17:14:09 +0100
commitb4cfb3a4d788d999c737d35ff5da632ffd173f7b (patch)
tree87dfa0d48efe8167b90e4bbe0022666dc0da4f87
parentb3ffb4151dae56bc6d60c3063b6d731937e3f32d (diff)
Automated uploads, date handling
-rw-r--r--Makefile17
-rwxr-xr-xinstall-webserver.sh20
-rw-r--r--plugins/webbox/webbox.cpp2
3 files changed, 36 insertions, 3 deletions
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 <Version>"
+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") + "<br/>(C) 2021 <a href=\"https://www.reichwein.it/\">Reichwein.IT</a>";
+ return p.m_GetServerParam("version") + "<br/>(C) " YEAR " <a href=\"https://www.reichwein.it/\">Reichwein.IT</a>";
}
};