aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2021-06-06 16:51:50 +0100
committerMiquel Lionel <lionelmiquel@sfr.fr>2021-06-06 16:51:50 +0100
commitc737d6aefe406ac52f4e2f913365efdede3f58a4 (patch)
tree7369bbdd5e04750d3f440d042d00ad9a6c338566 /Makefile
parent3b3c85e3221b7bf679c84b442fe1453fc8d83238 (diff)
downloadgpigeon-c737d6aefe406ac52f4e2f913365efdede3f58a4.tar.gz
gpigeon-c737d6aefe406ac52f4e2f913365efdede3f58a4.zip
add make vars to generate a nginx config
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 83d1f8c..98a8a8e 100644
--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,9 @@ gpigeon: gpigeon-template.cgi link-tmpl-template.cgi
$(MAKE) clean ; \
exit 1; \
fi
+
+
+
@if [ '${HAS_MAILSERVER}' == '1' ]; then \
printf "Local mail server setup. ${BOLD}Mail::Sendmail module will be used to send the mails${STOP}.\n"; \
else \
@@ -126,6 +129,10 @@ gpigeon: gpigeon-template.cgi link-tmpl-template.cgi
fi
@sed -e 's|has_mailserver_goes_here|$(HAS_MAILSERVER)|g' link-tmpl-template.cgi > link-tmpl.cgi
@sed -e 's|gpg_homedir_goes_here|$(_GPG_HOMEDIR)|g' link-tmpl-template.cgi > link-tmpl.cgi
+ @if test -n '$(WWWDOMAIN)' && test -n '$(WWWPREFIX)'; then\
+ $(MAKE) nginxconf;\
+ printf "Done generating $(WWWDOMAIN).conf for nginx.";\
+ fi
@printf "\nDone preparing files. You can now type\nsudo make install\nin your terminal.\n"
install:
@@ -137,12 +144,20 @@ install:
install -Dm600 link-tmpl.cgi $(DESTDIR)$(LINK_TEMPLATE_PATH)
install -Dm644 index.html favicon.ico styles.css -t $(DESTDIR)$(WWWPREFIX)/
install -Dm755 merci/* -t $(DESTDIR)$(PREFIX)/merci/
+ @if test -e '$(WWWDOMAIN).conf'; then\
+ printf "\nInstalling $(WWWDOMAIN).conf into $(NGINXCONFDIR)\n";\
+ install -Dm644 $(WWWDOMAIN).conf -t $(DESTDIR)$(NGINXCONFDIR);\
+ fi
+nginxconf: nginx-example.conf
+ @sed -e 's|wwwpath_goes_here|$(WWWPREFIX)|g;s|domain_goes_here|$(WWWDOMAIN)|g' nginx-example.conf > $(WWWDOMAIN).conf ;\
+
+
uninstall:
rm -rf $(DESTDIR)$(PREFIX)
rm -rf $(DESTDIR)$(WWWPREFIX)
clean:
- rm -f genpass.txt gpg.txt link-tmpl.cgi gpigeon.cgi
+ rm -f genpass.txt gpg.txt link-tmpl.cgi gpigeon.cgi $(WWWDOMAIN).conf
.PHONY: clean install uninstall