/
subway-makefile.diff
46 lines (46 loc) · 1.09 KB
/
subway-makefile.diff
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
Description: Patch add Makefile for packaging
Author: <hugh@atosc.org>
Last-Update: 2013-01-03
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+#******************************************
+#*
+#* Simple Makefile for Subway
+#*
+#*/
+
+COPY = /bin/cp -rp
+INSTALL = /usr/bin/install -c -m 644
+INSTALL_DIR = assets lib views node_modules
+
+etc_prefix = $(DESTDIR)/etc
+lib_prefix = $(DESTDIR)/var/lib
+bin_prefix = $(DESTDIR)/usr/bin
+log_prefix = $(DESTDIR)/var/log
+
+all: build
+
+build:
+ @npm install
+
+clean:
+ ${RM} -rf node_modules
+ ${RM} npm-debug.log
+
+install:
+ mkdir -p $(lib_prefix)/subway
+ @for i in $(INSTALL_DIR); do \
+ echo "install libs ==> $$i";\
+ $(COPY) $$i $(lib_prefix)/subway;\
+ done
+ $(COPY) config.js $(lib_prefix)/subway
+ echo "Deploying Subway"
+ mkdir -p $(bin_prefix)
+ $(INSTALL) subway $(bin_prefix)
+ chown root.root $(bin_prefix)/subway
+ sed -i "s#\./#/var/lib/subway/#" $(bin_prefix)/subway
+ mkdir -p $(log_prefix)/subway
+ touch $(log_prefix)/subway/subway.log
+ mkdir -p $(etc_prefix)/subway
+ ln -s /var/lib/subway/config.js $(etc_prefix)/subway/config.js