forked from miku/solrbulk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (42 loc) · 1.15 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
48
49
50
51
SHELL := /bin/bash
TARGETS = solrbulk
solrbulk: cmd/solrbulk/solrbulk.go
go build -ldflags "-w -s -linkmode=external" -o $@ $^
.PHONY: all
all: imports test
go build
# http://docs.travis-ci.com/user/languages/go/#Default-Test-Script
.PHONY: test
test:
go get -d && go test -v
.PHONY: imports
imports:
goimports -w .
.PHONY: clean
clean:
go clean
rm -f coverage.out
rm -f $(TARGETS)
rm -f solrbulk-*.x86_64.rpm
rm -f solrbulk*.deb
rm -rf debian/solrbulk/usr
.PHONY: cover
cover:
go get -d && go test -v -coverprofile=coverage.out
go tool cover -html=coverage.out
.PHONY: deb
deb: $(TARGETS)
mkdir -p debian/solrbulk/usr/sbin
cp $(TARGETS) debian/solrbulk/usr/sbin
mkdir -p debian/solrbulk/usr/local/share/man/man1
cp docs/solrbulk.1 debian/solrbulk/usr/local/share/man/man1
cd debian && fakeroot dpkg-deb --build solrbulk .
mv debian/solrbulk_*.deb .
.PHONY: rpm
rpm: $(TARGETS)
mkdir -p $(HOME)/rpmbuild/{BUILD,SOURCES,SPECS,RPMS}
cp ./packaging/solrbulk.spec $(HOME)/rpmbuild/SPECS
cp $(TARGETS) $(HOME)/rpmbuild/BUILD
cp docs/solrbulk.1 $(HOME)/rpmbuild/BUILD
./packaging/buildrpm.sh solrbulk
cp $(HOME)/rpmbuild/RPMS/x86_64/solrbulk*.rpm .