-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (32 loc) · 1.01 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
all: client server jquery
client: client.go core/*
go build -o dimmy client.go
server: jquery server.go devices/* core/* html/*
go build -o dimmyd server.go
clean:
rm dimmy dimmyd html/assets/jquery.js
rm -rf deb
rm dimmy_*.deb
jquery:
wget https://code.jquery.com/jquery-3.4.1.min.js -O html/assets/jquery.js
install:
cp dimmy /usr/bin
cp dimmyd /usr/bin
test -f /etc/dimmy/dimmyd.conf.yaml || cp dimmyd.conf.yaml.example /etc/dimmy/dimmyd.conf.yaml
mkdir -p /usr/share/dimmy
cp -R html/* /usr/share/dimmy
deb: all
rm -rf deb
mkdir -p deb/dimmy/usr/bin
mkdir -p deb/dimmy/etc/dimmy
mkdir -p deb/dimmy/usr/share/dimmy
mkdir deb/dimmy/DEBIAN
cp deb.control deb/dimmy/DEBIAN/control
sed -i'' "s/__version__/$(VERSION)/" deb/dimmy/DEBIAN/control
sed -i'' "s/__arch__/$(ARCH)/" deb/dimmy/DEBIAN/control
cat deb/dimmy/DEBIAN/control
cp dimmy deb/dimmy/usr/bin
cp dimmyd deb/dimmy/usr/bin
cp *.conf.yaml.example deb/dimmy/etc/dimmy/
cp -R html/* deb/dimmy/usr/share/dimmy
dpkg-deb -Zgzip --build deb/dimmy