-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
48 lines (37 loc) · 1.58 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
all:
install:
# create all required dirs
mkdir -p $(DESTDIR)/usr/sbin
mkdir -p $(DESTDIR)/usr/lib/unifi_lab
chmod 755 $(DESTDIR)/usr/lib/unifi_lab
# copy all files and symlink them to into the path
cp unifi_lab.py $(DESTDIR)/usr/lib/unifi_lab/unifi_lab
chmod 755 $(DESTDIR)/usr/lib/unifi_lab/unifi_lab
cp unifi_lab_ctlrobj.py $(DESTDIR)/usr/lib/unifi_lab/unifi_lab_ctlrobj.py
cp config_manager.py $(DESTDIR)/usr/lib/unifi_lab/config_manager.py
cp daemon.py $(DESTDIR)/usr/lib/unifi_lab/daemon.py
# relative symlinks to make packaging easier
@cd $(DESTDIR)/usr/bin/; \
[ -h unifi_lab ] && rm unifi_lab; \
ln -s ../lib/unifi_lab/unifi_lab .
# now copy the config, but don't overwrite any preexisting config
# first: unifi_lab.ini
@if [ -a $(DESTDIR)/etc/unifi_lab/unifi_lab.ini ]; then \
cp unifi_lab_production.ini $(DESTDIR)/etc/unifi_lab/unifi_lab.ini.install; \
chmod 600 $(DESTDIR)/etc/unifi_lab/unifi_lab.ini.install; \
else \
mkdir -p $(DESTDIR)/etc/unifi_lab; \
chmod 755 $(DESTDIR)/etc/unifi_lab; \
cp unifi_lab_production.ini $(DESTDIR)/etc/unifi_lab/unifi_lab.ini; \
chmod 600 $(DESTDIR)/etc/unifi_lab/unifi_lab.ini; \
fi
# second: unifi_lab_mac_auth.list
@if [ -a $(DESTDIR)/etc/unifi_lab/unifi_lab_mac_auth.list ]; then \
cp unifi_lab_mac_auth.list $(DESTDIR)/etc/unifi_lab/unifi_lab_mac_auth.list.install; \
chmod 644 $(DESTDIR)/etc/unifi_lab/unifi_lab_mac_auth.list.install; \
else \
cp unifi_lab_mac_auth.list $(DESTDIR)/etc/unifi_lab/unifi_lab_mac_auth.list; \
chmod 644 $(DESTDIR)/etc/unifi_lab/unifi_lab_mac_auth.list; \
fi
build:
clean: