-
Notifications
You must be signed in to change notification settings - Fork 42
/
Makefile.distro
42 lines (34 loc) · 1.33 KB
/
Makefile.distro
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
# -*- mode: GNUmakefile -*-
prefix ?= /usr
libdir ?= $(prefix)/lib
pkglibdir ?= $(libdir)/thingengine-server
localstatedir ?= /var/lib/thingengine-server
systemdsystemunitdir ?= $(prefix)/lib/systemd/system
SUBDIRS = service node_modules
install_sources = main.js
built_sources = service/platform_config.js thingengine-server.service
all: $(built_sources)
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
npm install
find -name obj.target -exec rm -fr '{}' +
find -name .deps -exec rm -fr '{}' +
all-fedora: $(built_sources)
mkdir node_modules
npm link sqlite3
npm link ws
npm install
find -name obj.target -exec rm -fr '{}' +
find -name .deps -exec rm -fr '{}' +
service/platform_config.js:
echo "exports.PKGLIBDIR = '$(prefix)'; exports.LOCALSTATEDIR = '$(localstatedir)';" > $@
thingengine-server.service : thingengine-server.service.in
sed -e 's|@pkglibdir@|$(pkglibdir)|g' $< > $@
# Note the / after engine, forces symlink resolution
install:
install -m 0755 -d $(DESTDIR)$(pkglibdir)
for d in $(SUBDIRS) ; do cp -pr $$d/ $(DESTDIR)$(pkglibdir) ; done
install -m 0644 $(install_sources) $(DESTDIR)$(pkglibdir)
install -m 0755 -d $(DESTDIR)$(systemdsystemunitdir)
install -m 0644 thingengine-server.service $(DESTDIR)$(systemdsystemunitdir)
clean:
rm -f service/platform_config.js