aboutsummaryrefslogtreecommitdiff
path: root/net-im/nextcloud-spreed-signaling/files/patch-Makefile
blob: 0c749be520b641dfca89cd4d429cfb655e0d6cc1 (plain) (blame)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
--- Makefile.orig	2020-12-08 13:00:05 UTC
+++ Makefile
@@ -1,8 +1,8 @@
 all: build
 
 GO := $(shell which go)
-GOPATH := "$(CURDIR)/vendor:$(CURDIR)"
-BINDIR := "$(CURDIR)/bin"
+GOPATH := $(CURDIR)/vendor:$(CURDIR)
+BINDIR := $(CURDIR)/bin
 VERSION := $(shell "$(CURDIR)/scripts/get-version.sh")
 TARVERSION := $(shell "$(CURDIR)/scripts/get-version.sh" --tar)
 ifneq ($(VERSION),)
@@ -35,26 +35,10 @@ ifneq ($(COUNT),)
 TESTARGS := $(TESTARGS) -count $(COUNT)
 endif
 
-hook:
-	[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
-
-godeps:
-	GOPATH=$(GOPATH) $(GO) get github.com/rogpeppe/godeps
-
-easyjson: dependencies
-	GOPATH=$(GOPATH) $(GO) get -d github.com/mailru/easyjson/...
+easyjson:
 	GOPATH=$(GOPATH) $(GO) build -o ./vendor/bin/easyjson ./vendor/src/github.com/mailru/easyjson/easyjson/main.go
 
-dependencies: hook godeps
-	GOPATH=$(GOPATH) ./vendor/bin/godeps -u dependencies.tsv
 
-dependencies.tsv: godeps
-	set -e ;\
-	TMP=$$(mktemp -d) ;\
-	echo Make sure to remove $$TMP on error ;\
-	cp -r "$(CURDIR)/vendor" $$TMP ;\
-	GOPATH=$$TMP/vendor:"$(CURDIR)" "$(CURDIR)/vendor/bin/godeps" ./src/... > "$(CURDIR)/dependencies.tsv" ;\
-	rm -rf $$TMP
 
 src/signaling/continentmap.go:
 	$(CURDIR)/scripts/get_continent_map.py $@
@@ -73,27 +57,28 @@ get:
 fmt: hook
 	$(GO) fmt ./src/...
 
-vet: dependencies common
+vet: common
 	GOPATH=$(GOPATH) $(GO) vet ./src/...
 
-test: dependencies vet common
+test: vet common
 	GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) $(TESTARGS) ./src/...
 
-cover: dependencies vet common
+cover: vet common
 	rm -f cover.out && \
 	GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out ./src/signaling/... && \
 	sed -i "/_easyjson/d" cover.out && \
 	GOPATH=$(GOPATH) $(GO) tool cover -func=cover.out
 
-coverhtml: dependencies vet common
+coverhtml: vet common
 	rm -f cover.out && \
 	GOPATH=$(GOPATH) $(GO) test -v -timeout $(TIMEOUT) -coverprofile cover.out ./src/signaling/... && \
 	sed -i "/_easyjson/d" cover.out && \
 	GOPATH=$(GOPATH) $(GO) tool cover -html=cover.out -o coverage.html
 
-%_easyjson.go: %.go
+%_easyjson.go: %.go | easyjson
 	PATH=$(shell dirname $(GO)):$(PATH) GOPATH=$(GOPATH) ./vendor/bin/easyjson -all $*.go
 
+
 common: easyjson \
 	src/signaling/api_signaling_easyjson.go \
 	src/signaling/api_backend_easyjson.go \
@@ -101,17 +86,17 @@ common: easyjson \
 	src/signaling/natsclient_easyjson.go \
 	src/signaling/room_easyjson.go
 
-client: dependencies common
+client: common
 	mkdir -p $(BINDIR)
 	GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/client ./src/client/...
 
-server: dependencies common
+server: common
 	mkdir -p $(BINDIR)
 	GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/signaling ./src/server/...
 
-proxy: dependencies common
+proxy: common
 	mkdir -p $(BINDIR)
-	GOPATH=$(GOPATH) $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./src/proxy/...
+	GOPATH="$(GOPATH)" $(GO) build $(BUILDARGS) -ldflags '$(INTERNALLDFLAGS)' -o $(BINDIR)/proxy ./src/proxy/...
 
 clean:
 	rm -f src/signaling/*_easyjson.go
@@ -123,6 +108,13 @@ tarball:
 		--prefix=nextcloud-spreed-signaling-$(TARVERSION)/ \
 		-o nextcloud-spreed-signaling-$(TARVERSION).tar.gz \
 		HEAD
+install:
+	install -d $(DESTDIR)$(PREFIX)/etc/ncs/
+	install -m 644 server.conf.in $(DESTDIR)$(PREFIX)/etc/ncs/server.conf.sample
+	install -m 644 proxy.conf.in $(DESTDIR)$(PREFIX)/etc/ncs/proxy.conf.sample
+	install -m 644 gnatsd.conf $(DESTDIR)$(PREFIX)/etc/ncs/gnatsd.conf.sample
+	install -m 755 bin/signaling $(DESTDIR)$(PREFIX)/bin/ncs-signaling
+	install -m 755 bin/proxy $(DESTDIR)$(PREFIX)/bin/ncs-proxy
 
 dist: tarball