-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathMakefile
42 lines (36 loc) · 1.21 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
SRC = *.go
PKG = groundcontrol README.md groundcontrol.json.sample web support
PKG_NAME = groundcontrol
DEBPKG = groundcontrol README.md web
VERSION=$(shell cat version.go | perl -n -e'/VERSION = "(.*?)"/ && print $$1')
build: $(SRC)
go build
package: $(PKG)
mkdir -p groundcontrol-$(VERSION)
cp -r $(PKG) groundcontrol-$(VERSION)/
tar -cvzf groundcontrol-$(VERSION).tar.gz groundcontrol-$(VERSION)
rm -rf groundcontrol-$(VERSION)/
package_deb: clean build
mkdir -p ./build/opt/groundcontrol
mkdir -p ./build/etc/init.d
cp -r $(DEBPKG) ./build/opt/groundcontrol/.
cp groundcontrol.json.sample ./build/etc/groundcontrol.json
cp support/init.d/groundcontrol ./build/etc/init.d/.
fpm -s dir \
-t deb \
-n $(PKG_NAME) \
-v $(VERSION) \
--license "MIT" \
-m "Jochen Breuer <[email protected]>" \
--description "Manage and monitor your Raspberry Pi with ease." \
--url "http://jondot.github.io/groundcontrol" \
--deb-user root \
--deb-group root \
-C ./build \
etc opt
clean:
rm -rf ./build
rm -f groundcontrol
rm -f groundcontrol-$(VERSION).tar.gz
rm -f groundcontrol_$(VERSION)*.deb
.PHONY: clean