diff options
Diffstat (limited to 'config/Makefile')
-rw-r--r-- | config/Makefile | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/config/Makefile b/config/Makefile index 76b69d3..74cb73f 100644 --- a/config/Makefile +++ b/config/Makefile @@ -15,6 +15,7 @@ # build-devuan: APPNAME = hex-zero +APPNAME_ = hex_zero APPVERSION = 0.0.1 SRCDIR = $(CURDIR)/..# because Makefile is in config/ inside this repo prefix = /usr @@ -29,6 +30,7 @@ SYSVDIR = $(SYSCONFDIR)/init.d SYSDDIR = $(DESTDIR)$(prefix)/lib/systemd/system LOGDIR = $(DESTDIR)/var/log/hex-zero APACHEDIR = $(SYSCONFDIR)/httpd/conf.d# for debian use '$(SYSCONFDIR)/apache2/sites-available' +CRONDIR = $(SYSCONFDIR)/cron.d # variables for deplist DEPTYPE = dep @@ -55,6 +57,10 @@ with_apache ?= YES with_nsfw ?= NO with_init ?= YES with_systemd ?= NO +with_cronjob ?= YES + +all: + -@echo "Nothing to build." && ${truebin} install: install_files @@ -78,9 +84,16 @@ install_files: ${installbin} -m0755 -d ${LOGDIR} ${APPDIR} ${APPDIR}/up ${DOCDIR} ${DEFAULTDIR} ${installbin} -m0644 -t ${APPDIR} ${SRCDIR}/front.html.in ${installbin} -m0644 ${SRCDIR}/config/${APPNAME}.conf.example ${APPDIR}/${APPNAME}.conf - ${installbin} -m0755 -t ${APPDIR} ${SRCDIR}/${APPNAME}.py ${SRCDIR}/${APPNAME}.wsgi + ${installbin} -m0755 -t ${APPDIR} ${SRCDIR}/${APPNAME_}.py ${SRCDIR}/${APPNAME}.wsgi \ + ${SRCDIR}/check-for-short_url.sh ${installbin} -m0644 -t ${DOCDIR} ${SRCDIR}/README* ${installbin} -m0644 ${SRCDIR}/config/${APPNAME}.etc.default ${DEFAULTDIR}/${APPNAME} + + @# the migrations directory is required for the db upgrade command to execute correctly + ${installbin} -m0755 -d ${APPDIR}/migrations/versions + ${installbin} -m0644 -t ${APPDIR}/migrations ${SRCDIR}/migrations/*.ini ${SRCDIR}/migrations/README + ${installbin} -m0755 -t ${APPDIR}/migrations ${SRCDIR}/migrations/*.py* + ${installbin} -m0644 -t ${APPDIR}/migrations/versions ${SRCDIR}/migrations/versions/*py ifeq ($(with_apache),YES) ${installbin} -m0755 -d ${APACHEDIR} ${installbin} -m0644 ${SRCDIR}/config/${APPNAME}.conf.apache ${APACHEDIR}/${APPNAME}.conf @@ -98,19 +111,27 @@ ifeq ($(with_systemd),YES) ${installbin} -m0755 -d ${SYSDDIR} ${installbin} -m0644 ${SRCDIR}/config/0x0.service -t ${SYSDDIR} endif +ifeq ($(with_cronjob),YES) + ${installbin} -m0755 -d ${CRONDIR} + ${installbin} -m0644 -t ${CRONDIR} ${SRCDIR}/config/80_${APPNAME}_cron +endif uninstall: @${echobin} SRCDIR=${SRCDIR} - ${rmbin} -f ${APPDIR}/${APPNAME}.conf ${APPDIR}/${APPNAME}.py ${APPDIR}/${APPNAME}.wsgi \ - ${APPDIR}/front.html.in ${DOCDIR}/* ${DEFAULTDIR}/${APPNAME} || : + ${rmbin} -f ${APPDIR}/${APPNAME}.conf ${APPDIR}/${APPNAME_}.py ${APPDIR}/${APPNAME}.wsgi \ + ${APPDIR}/check-for-short_url.sh \ + ${APPDIR}/front.html.in ${DOCDIR}/* ${DEFAULTDIR}/${APPNAME} \ + ${APPDIR}/migrations/versions/* ${APPDIR}/migrations/* \ + 1>/dev/null 2>&1 || : ${rmbin} -f ${APACHEDIR}/${APPNAME}.conf || : ${rmbin} -f ${APPDIR}/nsfw_model/* ${APPDIR}/nsfw_detect.py || : ${rmbin} -f ${SYSVDIR}/${APPNAME} || : ${rmbin} -f ${SYSDDIR}/0x0.service || : + ${rmbin} -f ${CRONDIR}/80_${APPNAME}_cron || : # remove all installed directories that are now blank. ${rmdirbin} ${APPDIR}/up ${DEFAULTDIR} ${SYSVDIR} ${APPDIR} \ ${APACHEDIR} ${SYSDDIR} ${DOCDIR} ${LOGDIR} 2>/dev/null || : clean: - @${echobin} "target $@ not implemented yet! Gotta say unh." && ${falsebin} + -@${echobin} "target $@ not implemented yet! Gotta say unh." && ${falsebin} |