-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
62 lines (52 loc) · 1.68 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
52
53
54
55
56
57
58
59
60
61
62
SHELL := /bin/bash
NAME=gosgp
VERSION=0.1
# Dependencies: golang
.PHONY: all clean clean_all prepare package_deb package_rpm
.SILENT: desc
all: desc
desc:
echo "usage: please use either 'make package_deb' or 'make package_rpm'"
clean:
rm -f $(NAME)*.deb
rm -f $(NAME)*.rpm
rm -rf ./build
clean_all: clean
rm -rf /tmp/gosgp
prepare: clean
mkdir -p ./build/usr/bin/
GOPATH=/tmp/gosgp go get -d
GOPATH=/tmp/gosgp go build -o gosgp
mv gosgp ./build/usr/bin/.
package_deb: prepare
fpm -s dir \
-t deb \
-n $(NAME) \
-m "Jochen Breuer <brejoc@gmail.com>" \
--url "https://github.com/brejoc/gosgp" \
--license "GPLv2" \
--description "Command line SuperGenPass password generator written in go." \
-v $(VERSION) \
--deb-user root \
--deb-group root \
-C ./build \
usr
#############################################################
### Don't forget to 'make clean_all' to delete GOPATH dir ###
#############################################################
package_rpm: prepare
fpm -s dir \
-t rpm \
-n $(NAME) \
-m "Jochen Breuer <brejoc@gmail.com>" \
--url "https://github.com/brejoc/gosgp" \
--license "GPLv2" \
--description "Command line SuperGenPass password generator written in go." \
-v $(VERSION) \
--rpm-user root \
--rpm-group root \
-C ./build \
usr
#############################################################
### Don't forget to 'make clean_all' to delete GOPATH dir ###
#############################################################