forked from neutrons/reduction_service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (50 loc) · 1.76 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
prefix := /var/www/reduction_service
ifeq ($(OS),Windows_NT)
UNAME_S=Windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
ISLINUX = 1
endif
ifeq ($(UNAME_S),Darwin)
ISOSX = 1
endif
endif
all:
@echo "Run make install to install the reduction application locally"
clean:
rm -rf $(prefix)
rm -f /etc/apache2/other/reduction_service_wsgi.conf
check:
# Check dependencies
# NEEDS django_auth_ldap
@python -c "import django" || echo "\nERROR: Django is not installed: www.djangoproject.com\n"
@python -c "import h5py" || echo "\nERROR: h5py is not installed: www.h5py.org\n"
install: webapp
webapp: check
# Make sure the install directories exist
test -d $(prefix) || mkdir -m 0755 -p $(prefix)
test -d $(prefix)/app || mkdir -m 0755 $(prefix)/app
test -d $(prefix)/static || mkdir -m 0755 $(prefix)/static
# Install application code
cp -R src $(prefix)/app
cp -R templates $(prefix)/app
cp -R static $(prefix)/app
# Install apache config
cp -R apache $(prefix)
# Collect the static files and install them
cd $(prefix)/app/src; python manage.py collectstatic --noinput
# Create the database tables. The database itself must have been
# created on the server already
cd $(prefix)/app/src; python manage.py syncdb
# Prepare web monitor cache: RUN THIS ONCE BY HAND
#cd $(prefix)/app/src; python manage.py createcachetable webcache
@echo "\n\nReady to go: run apachectl restart\n"
# Development environment
test -d /etc/apache2/other && cp $(prefix)/apache/apache_django_wsgi.conf /etc/apache2/other/reduction_service_wsgi.conf
# Linux server environment
#test -d /etc/httpd/conf.d && cp $(prefix)/apache/apache_django_wsgi.conf /etc/httpd/conf.d/reduction_service_wsgi.conf
.PHONY: check
.PHONY: clean
.PHONY: install
.PHONY: webapp