-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (43 loc) · 1.69 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
# 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/webauthn2
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=webauthn
# turn off annoying built-ins
.SUFFIXES:
INSTALL_SCRIPT=./install-script
# make this the default target
install: samples/wsgi_webauthn2.conf force
pip3 install --upgrade .
$(MAKE) -C apache_module install
testvars: force
@echo DAEMONUSER=$(DAEMONUSER)
@echo CONFDIR=$(CONFDIR)
@echo SYSPREFIX=$(SYSPREFIX)
@echo SHAREDIR=$(SHAREDIR)
@echo HTTPDCONFDIR=$(HTTPDCONFDIR)
@echo WSGISOCKETPREFIX=$(WSGISOCKETPREFIX)
@echo PYLIBDIR=$(PYLIBDIR)
deploy: install
env SHAREDIR=$(SHAREDIR) HTTPDCONFDIR=$(HTTPDCONFDIR) webauthn2-deploy
$(MAKE) -C apache_module deploy
samples/wsgi_webauthn2.conf: samples/wsgi_webauthn2.conf.in force
./install-script -M sed -R @PYLIBDIR@=$(PYLIBDIR) @WSGISOCKETPREFIX@=$(WSGISOCKETPREFIX) @DAEMONUSER@=$(DAEMONUSER) -o root -g root -m a+r -p -D $< $@
uninstall: force
pip3 uninstall -y webauthn2
preinstall_centos: force
yum -y install python3 python3-psycopg2 python3-dateutil libcurl libcurl-devel httpd-devel
pip install globus-sdk
preinstall_ubuntu: force
apt-get -y install python
pip install globus-sdk
force: