-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (80 loc) · 2.34 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
NAME=certstrap
VERSION=1.0.1
ITERATION=1.lru
PREFIX=/usr/local
LICENSE=Apache-2.0
VENDOR="Square"
MAINTAINER="Ryan Parman"
DESCRIPTION="A simple certificate manager written in Go, to bootstrap your own certificate authority and public key infrastructure."
URL=https://github.com/square/certstrap
RHEL=$(shell rpm -q --queryformat '%{VERSION}' centos-release)
#-------------------------------------------------------------------------------
all: info clean install-deps compile install-tmp package move
#-------------------------------------------------------------------------------
.PHONY: info
info:
@ echo "NAME: $(NAME)"
@ echo "VERSION: $(VERSION)"
@ echo "ITERATION: $(ITERATION)"
@ echo "PREFIX: $(PREFIX)"
@ echo "LICENSE: $(LICENSE)"
@ echo "VENDOR: $(VENDOR)"
@ echo "MAINTAINER: $(MAINTAINER)"
@ echo "DESCRIPTION: $(DESCRIPTION)"
@ echo "URL: $(URL)"
@ echo "RHEL: $(RHEL)"
@ echo " "
#-------------------------------------------------------------------------------
.PHONY: clean
clean:
rm -Rf /tmp/installdir* certstrap*
#-------------------------------------------------------------------------------
.PHONY: install-deps
install-deps:
yum -y install \
golang \
;
#-------------------------------------------------------------------------------
.PHONY: compile
compile:
git clone https://github.com/square/certstrap.git
cd certstrap \
git checkout v$(VERSION) && \
./build \
;
#-------------------------------------------------------------------------------
.PHONY: install-tmp
install-tmp:
mkdir -p /tmp/installdir-$(NAME)-$(VERSION);
cd certstrap && \
cp -Rf * /tmp/installdir-$(NAME)-$(VERSION)/;
#-------------------------------------------------------------------------------
.PHONY: package
package:
# Main package
fpm \
-f \
-s dir \
-t rpm \
-n $(NAME) \
-v $(VERSION) \
-C /tmp/installdir-$(NAME)-$(VERSION) \
-m $(MAINTAINER) \
--iteration $(ITERATION) \
--license $(LICENSE) \
--vendor $(VENDOR) \
--prefix $(PREFIX) \
--url $(URL) \
--description $(DESCRIPTION) \
--rpm-defattrdir 0755 \
--rpm-digest md5 \
--rpm-compression gzip \
--rpm-os linux \
--rpm-changelog CHANGELOG.txt \
--rpm-auto-add-directories \
bin \
;
#-------------------------------------------------------------------------------
.PHONY: move
move:
mv *.rpm /vagrant/repo/