forked from heroku/log-shuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·38 lines (31 loc) · 914 Bytes
/
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
#!/usr/bin/env make -f
VERSION := $(shell cat main.go | grep VERSION | head -n1 | cut -d \" -f 2)
tempdir := $(shell mktemp -d)
controldir := $(tempdir)/DEBIAN
installpath := $(tempdir)/usr/bin
define DEB_CONTROL
Package: log-shuttle
Version: $(VERSION)
Architecture: amd64
Maintainer: "Edward Muller" <[email protected]>
Section: heroku
Priority: optional
Description: Move logs from the Dyno to the Logplex.
endef
export DEB_CONTROL
deb: bin/log-shuttle
mkdir -p -m 0755 $(controldir)
echo "$$DEB_CONTROL" > $(controldir)/control
mkdir -p $(installpath)
install bin/log-shuttle $(installpath)/log-shuttle
fakeroot dpkg-deb --build $(tempdir) .
rm -rf $(tempdir)
bin/log-shuttle:
git clone git://github.com/kr/heroku-buildpack-go.git .build
.build/bin/compile . .build/cache/
clean:
rm -rf ./bin/
rm -rf .build/
rm -rf ./.profile.d/
rm -f log-shuttle*.deb
build: bin/log-shuttle