-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
46 lines (39 loc) · 1.5 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
.PHONY: all
all: lovebeat
dashboard-assets:
$(MAKE) -C dashboard
dependencies: dashboard-assets
go get -t ./...
GO_FILES := $(shell find . -name "*.go" -print)
lovebeat: $(GO_FILES) dependencies dashboard-assets
go build -ldflags "-s -w -X main.version=`git describe --tags --dirty --always`-local"
.PHONY: clean
clean:
rm -f lovebeat
.PHONY: install
install: lovebeat
mkdir -p $(DESTDIR)/usr/sbin
install -m 0755 --strip lovebeat $(DESTDIR)/usr/sbin
mkdir -p $(DESTDIR)/etc/lovebeat.conf.d
install -m 0644 lovebeat.cfg $(DESTDIR)/etc/lovebeat.conf.d
# To be able to build a Debian package from any commit and get a
# meaningful result, use "git describe" to find the current version
# number and compare it to the most recent entry in debian/changelog
# (which is what Debian build system uses when creating a package).
# If those versions are different, write a new entry with the current
# version.
#
# Replace hyphens with plus signs to comply with Debian policy and
# transform '-rcX' to '~rcX' so that a release candidate is considered
# older than the final release.
.PHONY: deb
deb:
CURRENT_VERSION=$$(sed -n '1s/^[^ ]* (\([^)]*\)).*/\1/p' \
< debian/changelog) && \
ACTUAL_VERSION=$$(git describe --tags --always | \
sed 's/-rc/~rc/; s/-/+/g') && \
if [ "$$CURRENT_VERSION" != "$$ACTUAL_VERSION" ] ; then \
dch --force-bad-version --newversion $$ACTUAL_VERSION \
"Autogenerated changelog entry" ; \
fi
debuild --preserve-envvar GOPATH -uc -us