This repository has been archived by the owner on Apr 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
88 lines (69 loc) · 2.09 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# makefile
#
# Distro detection
DISTRO_ID=`lsb-release -i|cur -f 2`
ifeq ($(strip $(DISTRO_ID)),'Ubuntu')
DISTRO=debian
else ifeq ($(strip $(DISTRO_ID)),'Debian')
DISTRO=debian
else ifeq ($(strip $(DISTRO_ID)),'LinuxMint')
DISTRO=debian
else
DISTRO=redhat
endif
PREFIX ?= /opt/tileman
DESTDIR ?= ${PREFIX}/bin/
HTMLDIR ?= ${PREFIX}/html/
CACHEDIR ?= ${PREFIX}/cache/
STATICDIR?= ${PREFIX}/tiles/
CONFDIR ?= ${PREFIX}/etc/
NGINX ?= ${CONFDIR}/nginx
WORKDIR ?= ${PREFIX}/osmosis
.PHONY: install test test_install test_service_start test_db_load
all:
install: directories nginx_$(DISTRO) utils osmosis statictiles errorimg
directories:
mkdir -p $(DESTDIR)
mkdir -p $(OSMOSIS_WORK)
mkdir -p $(HTMLDIR)
mkdir -p $(CACHEDIR)
chmod 777 $(CACHEDIR)
mkdir -p $(STATICDIR)
statictiles: directories
bzcat data/Liancourt_Rocks_lang_ja_tiles.tar.bz2 |(cd $(STATICDIR);tar xf -)
errorimg: directories
cp data/toomany.png $(HTMLDIR)
nginx_debian:
install nginx/tileproxy_params $(NGINX)/
install nginx/common_location_params $(NGINX)/
install nginx/ssl_params $(NGINX)/
install nginx/conf.d/* $(NGINX)/conf.d/
install nginx/sites/* $(NGINX)/sites-available/
nginx_redhat:
install nginx/tileproxy_params $(NGINX)/
install nginx/common_location_params $(NGINX)/
install nginx/ssl_params $(NGINX)/
install nginx/conf.d/tileman.conf $(NGINX)/conf.d/_tileman.conf
install nginx/sites/tileman-proxy $(NGINX)/conf.d/tileman-proxy.conf.ex
install nginx/sites/tileman-proxy-ssl $(NGINX)/conf.d/tileman-proxy-ssl.conf.ex
install nginx/sites/tileman-server $(NGINX)/conf.d/tileman-server.conf.ex
install nginx/sites/tileman-server-ssl $(NGINX)/conf.d/tileman-server-ssl.conf.ex
utils:
install -c bin/* $(DESTDIR)
install -c etc/*.conf $(CONFDIR)
osmosis:
cp osmosis/fabrik.txt $(WORKDIR)/configuration.txt
test: test_$(DISTRO)
test_debian:
test_redhat:
test_install: test_install_$(DISTRO)
test_install_debian:
sudo test/test_install.sh
test_install_redhat:
test_service_start:
sudo service tirex-backend-manager start
sudo service tirex-master start
sudo service nginx start
test_dbload:
sudo test/load.sh