-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (37 loc) · 1.07 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
TARGET=deb
PACKAGE_NAME=tlsproxy
PACKAGE_VERSION=20160602
PACKAGE_REVISION=1
PACKAGE_ARCH=amd64
PACKAGE_FILE=$(PACKAGE_NAME)_$(PACKAGE_VERSION)-$(PACKAGE_REVISION)_$(PACKAGE_ARCH).$(TARGET)
GOPKG=github.com/QubitProducts/tlsproxy
BINNAME=tlsproxy
PWD=$(shell pwd)
all: package
binary: clean-binary
mkdir -p build/$(PACKAGE_NAME)/src/$(GOPKG)
cp *.go build/$(PACKAGE_NAME)/src/$(GOPKG)
GOPATH=$(PWD)/build/$(PACKAGE_NAME) cd build/$(PACKAGE_NAME)/src/${GOPKG} && go build -a -o target ./
mkdir -p dist/usr/local/bin
install -m755 build/$(PACKAGE_NAME)/src/${GOPKG}/target dist/usr/local/bin/$(BINNAME)
mkdir -p dist/etc/init
install -m644 $(BINNAME).conf dist/etc/init/$(BINNAME).conf
clean-binary:
rm -f dist/usr/local/bin/$(BINNAME)
package: clean binary
cd dist && \
fpm \
-t $(TARGET) \
-m $(PACKAGE_MAINTAINER) \
-n $(PACKAGE_NAME) \
-a $(PACKAGE_ARCH) \
-v $(PACKAGE_VERSION) \
--iteration $(PACKAGE_REVISION) \
-s dir \
-p ../$(PACKAGE_FILE) \
.
clean:
rm -f $(PACKAGE_FILE)
rm -rf dist
rm -rf build