forked from mapgears/scribeui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
64 lines (41 loc) · 3.62 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
SCRIBE_PATH:= $(shell pwd)
SCRIBE_PATH_CLEAN:= $(subst /,\/,$(SCRIBE_PATH))
HOSTNAME:= $(shell hostname)
#default: download_naturalearth_template_data
default: setup init_db
setup:
cp application/runserver.dist.wsgi application/runserver.wsgi
# Set the current path on scribe
sed -i -e 's/<scribeui_path>/$(SCRIBE_PATH_CLEAN)/g' application/runserver.wsgi
cp config.dist.py config.py
# set the hostname of the machine
sed -i -e 's/<hostname_or_ip>/$(HOSTNAME)/g' config.py
cp ScribeUI.conf.example ScribeUI.conf
sed -i -e 's/<path_to_scribeui_root>/$(SCRIBE_PATH_CLEAN)/g' ScribeUI.conf
download_deps:
apt-get install -y apache2 libapache2-mod-wsgi cgi-mapserver sqlite3 python-pip \
gcc python-all-dev
pip install flask
init_db:
( cd application; chmod +x init_db.py; python init_db.py )
install:
# Move elfinder
sudo cp -ap elfinder-python /usr/lib/cgi-bin/
# Change folder owner to www-data
sudo chown -R www-data application/db/ application/workspaces \
application/www /usr/lib/cgi-bin/elfinder-python/
sudo cp ScribeUI.conf /etc/apache2/sites-enabled/ScribeUI.conf
sudo service apache2 reload
load-demo-data:
mkdir -p ./application/data/naturalEarth
test -d ./application/data/naturalEarth/110m_cultural/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m_cultural.zip && unzip -o 110m_cultural.zip -d ./application/data/naturalEarth/110m_cultural/ && rm 110m_cultural.zip)
test -d ./application/data/naturalEarth/110m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/110m_physical.zip && unzip -o 110m_physical.zip -d ./application/data/naturalEarth/110m_physical/ && rm 110m_physical.zip)
test -d ./application/data/naturalEarth/10m_cultural/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/10m_cultural.zip && unzip -o 10m_cultural.zip -d ./application/data/naturalEarth/10m_cultural/ && rm 10m_cultural.zip)
test -d ./application/data/naturalEarth/10m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/10m_physical.zip &&unzip -o 10m_physical.zip -d ./application/data/naturalEarth/10m_physical/ && rm 10m_physical.zip)
test -d ./application/data/naturalEarth/50m_cultural/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/50m_cultural.zip && unzip -o 50m_cultural.zip -d ./application/data/naturalEarth/50m_cultural/ && rm 50m_cultural.zip)
test -d ./application/naturalEarth/50m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/50m_physical.zip && unzip -o 50m_physical.zip -d ./application/data/naturalEarth/50m_physical/ && rm 50m_physical.zip)
load-basescribe-data:
mkdir -p ./application/data/naturalEarth
test -d ./application/data/naturalEarth/110m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip && unzip -o ne_110m_land.zip -d ./application/data/naturalEarth/110m_physical/ && rm ne_110m_land.zip)
test -d ./application/data/naturalEarth/50m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/physical/ne_50m_land.zip && unzip -o ne_50m_land.zip -d ./application/data/naturalEarth/50m_physical/ && rm ne_50m_land.zip)
test -d ./application/data/naturalEarth/10m_physical/ || (wget -c http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/physical/ne_10m_land.zip &&unzip -o ne_10m_land.zip -d ./application/data/naturalEarth/10m_physical/ && rm ne_10m_land.zip)