From 092c3cc12a7092032c77ecfb75b7c6baec1da3cb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 30 Apr 2020 16:35:44 +0200 Subject: Debian packaging --- plugins/webbox/Makefile | 14 ++++++-------- plugins/weblog/procmail/procmail.sh | 29 +++++++++++++++-------------- 2 files changed, 21 insertions(+), 22 deletions(-) (limited to 'plugins') diff --git a/plugins/webbox/Makefile b/plugins/webbox/Makefile index 54c954c..5ff22f7 100644 --- a/plugins/webbox/Makefile +++ b/plugins/webbox/Makefile @@ -97,14 +97,12 @@ install: mkdir -p $(DESTDIR)/usr/lib/webserver/plugins cp $(PROJECTNAME).so $(DESTDIR)/usr/lib/webserver/plugins - mkdir -p $(DESTDIR)/var/www/webbox - cp -r html/* $(DESTDIR)/var/www/webbox/ - - # Minify, conditionally - command -v uglifyjs && uglifyjs html/webbox.js -m -c > $(DESTDIR)/var/www/webbox/webbox.js || true - command -v htmlmin && \ - htmlmin html/index.html $(DESTDIR)/var/www/webbox/index.html || true - command -v cleancss && cleancss -o $(DESTDIR)/var/www/webbox/webbox.css html/webbox.css || true + mkdir -p $(DESTDIR)/usr/lib/webbox/html + cp -r html/* $(DESTDIR)/usr/lib/webbox/html/ + + uglifyjs html/webbox.js -m -c > $(DESTDIR)/usr/lib/webbox/html/webbox.js + htmlmin html/index.html $(DESTDIR)/usr/lib/webbox/html/index.html + cleancss -o $(DESTDIR)/usr/lib/webbox/html/webbox.css html/webbox.css # misc --------------------------------------------------- diff --git a/plugins/weblog/procmail/procmail.sh b/plugins/weblog/procmail/procmail.sh index bafe889..44fa68f 100755 --- a/plugins/weblog/procmail/procmail.sh +++ b/plugins/weblog/procmail/procmail.sh @@ -46,18 +46,6 @@ if echo "$ADDR" | grep -q "weblog-bloginput" ; then exit 1 fi -#if grep -q "^pitch " inmail ; then -# PITCH=`grep "^pitch " inmail|head -n1|sed -e 's/^pitch \([+-]\?[0-9]\+\(\.[0-9]\+\)\?\).*/\1/'` -# if echo "$PITCH" | grep -q "^pitch " ; then -# # no pitch match -# ERRORMSG="Bad pitch syntax." -# exit 1 -# fi -# USERLOG="pitch $PITCH" -#else -# PITCH=0 -#fi - ALLLINES=`wc -l inmail | cut -f1 -d" "` HEADERLINES=`cat inmail | (n=0; while read i ; do @@ -77,12 +65,25 @@ echo "$BODY" > /home/weblog-bloginput/body.txt SUBJECT=`echo "$HEADER" | mimedecode` SUBJECT_PATH=`echo "$SUBJECT" | sed -e 's/[^a-zA-Z0-9]/_/g'` -ARTICLEDIR="$BLOGDIR/`date +%Y/%Y%m%d_%H%M`_$SUBJECT_PATH" +ARTICLEDIR="$BLOGDIR/`date +%Y/%Y%m%d`_$SUBJECT_PATH" mkdir -p $ARTICLEDIR echo "Subject: $SUBJECT" >> $ARTICLEDIR/article.data echo "" >> $ARTICLEDIR/article.data -echo "$BODY" >> $ARTICLEDIR/article.data + +# get attachments +munpack -C $ARTICLEDIR `pwd`/inmail >/dev/null || true + +DATANAME="`ls $ARTICLEDIR/*.desc || true`" 2>/dev/null +if [ "$DATANAME" = "" ] ; then + echo "$BODY" >> $ARTICLEDIR/article.data +else + cat "$DATANAME" >> $ARTICLEDIR/article.data + rm "$DATANAME" +fi + +chmod -R a+r $ARTICLEDIR +chmod a+x $ARTICLEDIR echo "Processed successfully." | mutt -s "Bloginput: $SUBJECT_PATH" -- "$ADDR" >> ~/log 2>&1 -- cgit v1.2.3