-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
73 lines (54 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# this ugly hack necessitated by Ubuntu... grrr...
SYSPREFIX=$(shell python3 -c 'import site;print(site.getsitepackages()[0])' | sed -e 's|/[^/]\+/[^/]\+/[^/]\+$$||')
# try to find the architecture-neutral lib dir by looking for one of our expected prereqs... double grrr...
PYLIBDIR=$(shell python3 -c 'import site;import os.path;print([d for d in site.getsitepackages() if os.path.exists(d+"/globus_sdk")][0])')
CONFDIR=/etc
SHAREDIR=$(SYSPREFIX)/share/hatrac
ifndef HATRAC_ADMIN_GROUP
override HATRAC_ADMIN_GROUP = "https://auth.globus.org/3938e0d0-ed35-11e5-8641-22000ab4b42b"
endif
ifeq ($(wildcard /etc/httpd/conf.d),/etc/httpd/conf.d)
HTTPSVC=httpd
else
HTTPSVC=apache2
endif
HTTPDCONFDIR=/etc/$(HTTPSVC)/conf.d
WSGISOCKETPREFIX=/var/run/$(HTTPSVC)/wsgi
DAEMONUSER=hatrac
DAEMONHOME=$(shell getent passwd $(DAEMONUSER) | cut -f6 -d: )
# turn off annoying built-ins
.SUFFIXES:
INSTALL=./install-script
# make this the default target
install: force
pip3 install --upgrade .
testvars: force
@echo DAEMONUSER=$(DAEMONUSER)
@echo DAEMONHOME=$(DAEMONHOME)
@echo CONFDIR=$(CONFDIR)
@echo SYSPREFIX=$(SYSPREFIX)
@echo SHAREDIR=$(SHAREDIR)
@echo HTTPDCONFDIR=$(HTTPDCONFDIR)
@echo WSGISOCKETPREFIX=$(WSGISOCKETPREFIX)
@echo PYLIBDIR=$(PYLIBDIR)
wsgi_hatrac.conf: force
su -c \
'python3 -c "import hatrac as m;m.sample_httpd_config()"' \
- hatrac > $@
$(HTTPDCONFDIR)/%.conf: ./%.conf force
$(INSTALL) -o root -g root -m a+r -p -D -n $< $@
$(DAEMONHOME)/%config.json: test/%config.json force
$(INSTALL) -o root -g apache -m a+r -p -D -n $< $@
DEPLOY_FILES=\
$(HTTPDCONFDIR)/wsgi_hatrac.conf \
$(DAEMONHOME)/hatrac_config.json
deploy: $(DEPLOY_FILES) force
su -c "hatrac-deploy $(HATRAC_ADMIN_GROUP)" - hatrac
deploy-full: $(DEPLOY_FILES) force
su -c "createdb -O hatrac hatrac" - postgres
su -c "hatrac-deploy $(HATRAC_ADMIN_GROUP)" - hatrac
mkdir -p /var/www/hatrac
chown hatrac /var/www/hatrac
uninstall: force
pip3 uninstall -y hatrac
force: