Skip to content

Commit 07924b8

Browse files
committed
Preparing 0.3.1 release based on go modules
1 parent a67173f commit 07924b8

File tree

4 files changed

+53
-83
lines changed

4 files changed

+53
-83
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
websocketd
2-
*.swp
3-
*.swo
4-
go
5-
go-v*
2+
go-*

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.3.1 (Jan 28, 2019)
2+
3+
* Minor improvements to websocketd itself
4+
* Use of go modules, gorilla websockets set to 1.4.0
5+
* Binaries build code switched to 1.11.5 (improving underlying protocol handlers)
6+
17
Version 0.3.0 (??, 2017)
28

39
* Migration of underlying websocket server to Gorilla Websocket lib.

Makefile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ SYSTEM_NAME:=$(shell uname -s | tr '[:upper:]' '[:lower:]')
1515
SYSTEM_ARCH:=$(shell uname -m)
1616
GO_ARCH:=$(if $(filter x86_64, $(SYSTEM_ARCH)),amd64,386)
1717
GO_VERSION:=$(GO_VER).$(SYSTEM_NAME)-$(GO_ARCH)
18-
GO_DOWNLOAD_URL:=http://golang.org/dl/go$(GO_VERSION).tar.gz
19-
GO_WORKDIR:=go-v$(GO_VERSION)
18+
GO_DOWNLOAD_URL:=https://dl.google.com/go/go$(GO_VERSION).tar.gz
19+
GO_DIR:=go-$(GO_VER)
2020

2121
# Build websocketd binary
22-
websocketd: $(GO_WORKDIR)/bin/go $(wildcard *.go) $(wildcard libwebsocketd/*.go)
23-
$(GO_WORKDIR)/bin/go build
22+
websocketd: $(GO_DIR)/bin/go $(wildcard *.go) $(wildcard libwebsocketd/*.go)
23+
$(GO_DIR)/bin/go build
24+
25+
localgo: $(GO_DIR)/bin/go
2426

2527
# Download and unpack Go distribution.
26-
$(GO_WORKDIR)/bin/go:
27-
mkdir -p $(GO_WORKDIR)
28+
$(GO_DIR)/bin/go:
29+
mkdir -p $(GO_DIR)
2830
rm -f $@
29-
@echo Downloading and unpacking Go $(GO_VERSION) to $(GO_WORKDIR)
30-
wget -q -O - $(GO_DOWNLOAD_URL) | tar xzf - --strip-components=1 -C $(GO_WORKDIR)
31+
@echo Downloading and unpacking Go $(GO_VERSION) to $(GO_DIR)
32+
curl -s $(GO_DOWNLOAD_URL) | tar xf - --strip-components=1 -C $(GO_DIR)
3133

3234
# Clean up binary
3335
clean:

release/Makefile

Lines changed: 36 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2013 Joe Walnes and the websocketd team.
1+
# Copyright 2013-2019 Joe Walnes and the websocketd team.
22
# All rights reserved.
33
# Use of this source code is governed by a BSD-style
44
# license that can be found in the LICENSE file.
@@ -16,10 +16,12 @@ LAST_PATCH_VERSION:=$(shell git ls-remote [email protected]:joewalnes/websocketd.gi
1616
| sort -n \
1717
| tail -n 1)
1818

19-
VERSION_PATCH:=$(if $(LAST_PATCH_VERSION),$(shell expr $(LAST_PATCH_VERSION)),0)
19+
20+
21+
VERSION_PATCH:=$(shell expr $$(( $(or $(LAST_PATCH_VERSION),-1) + 1 )))
2022
RELEASE_VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
2123

22-
GO_VERSION=1.9.2
24+
GO_VERSION=1.11.5
2325
PLATFORMS=linux_amd64 linux_386 linux_arm linux_arm64 darwin_amd64 freebsd_amd64 freebsd_386 windows_386 windows_amd64 openbsd_386 openbsd_amd64 solaris_amd64
2426

2527

@@ -41,73 +43,47 @@ endif
4143

4244

4345

44-
GO_SRC_URL=https://storage.googleapis.com/golang/go$(GO_VERSION).$(UNAME_SYS)-$(UNAME_ARCH).tar.gz
45-
GO_DOWNLOAD=go-local/$(GO_VERSION).tgz
46-
GO_DIR=go-local/$(GO_VERSION)
47-
GO_UNPACKED=$(GO_DIR)/.unpacked
46+
GO_SRC_URL=https://dl.google.com/go/go$(GO_VERSION).$(UNAME_SYS)-$(UNAME_ARCH).tar.gz
47+
GO_DIR=../go-$(GO_VERSION)
4848

4949
# Prevent any global environment polluting the builds
50-
GOROOT=$(shell readlink -f $(GO_DIR))/go
51-
GOPATH=$(shell readlink -f go-path)
52-
53-
FLAGS_all = GOROOT=$(GOROOT) GOPATH=$(GOPATH)
54-
FLAGS_linux_amd64 = $(FLAGS_all) GOOS=linux GOARCH=amd64
55-
FLAGS_linux_386 = $(FLAGS_all) GOOS=linux GOARCH=386
56-
FLAGS_linux_arm = $(FLAGS_all) GOOS=linux GOARCH=arm GOARM=5 # ARM5 support for Raspberry Pi
57-
FLAGS_linux_arm64 = $(FLAGS_all) GOOS=linux GOARCH=arm64 # no need for GOARM= (which is technically 8)
58-
FLAGS_darwin_amd64 = $(FLAGS_all) GOOS=darwin GOARCH=amd64 CGO_ENABLED=0
59-
FLAGS_darwin_386 = $(FLAGS_all) GOOS=darwin GOARCH=386 CGO_ENABLED=0
60-
FLAGS_freebsd_amd64 = $(FLAGS_all) GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0
61-
FLAGS_freebsd_386 = $(FLAGS_all) GOOS=freebsd GOARCH=386 CGO_ENABLED=0
62-
FLAGS_windows_386 = $(FLAGS_all) GOOS=windows GOARCH=386 CGO_ENABLED=0
63-
FLAGS_windows_amd64 = $(FLAGS_all) GOOS=windows GOARCH=amd64 CGO_ENABLED=0
64-
FLAGS_openbsd_386 = $(FLAGS_all) GOOS=openbsd GOARCH=386 CGO_ENABLED=0
65-
FLAGS_openbsd_amd64 = $(FLAGS_all) GOOS=openbsd GOARCH=amd64 CGO_ENABLED=0
66-
FLAGS_solaris_amd64 = $(FLAGS_all) GOOS=solaris GOARCH=amd64 CGO_ENABLED=0
67-
68-
EXTENSION_windows_386=.exe
69-
EXTENSION_windows_amd64=.exe
50+
FLAGS_linux_amd64 = GOOS=linux GOARCH=amd64
51+
FLAGS_linux_386 = GOOS=linux GOARCH=386
52+
FLAGS_linux_arm = GOOS=linux GOARCH=arm GOARM=5 # ARM5 support for Raspberry Pi
53+
FLAGS_linux_arm64 = GOOS=linux GOARCH=arm64 # no need for GOARM= (which is technically 8)
54+
FLAGS_darwin_amd64 = GOOS=darwin GOARCH=amd64 CGO_ENABLED=0
55+
FLAGS_darwin_386 = GOOS=darwin GOARCH=386 CGO_ENABLED=0
56+
FLAGS_freebsd_amd64 = GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0
57+
FLAGS_freebsd_386 = GOOS=freebsd GOARCH=386 CGO_ENABLED=0
58+
FLAGS_windows_386 = GOOS=windows GOARCH=386 CGO_ENABLED=0
59+
FLAGS_windows_amd64 = GOOS=windows GOARCH=amd64 CGO_ENABLED=0
60+
FLAGS_openbsd_386 = GOOS=openbsd GOARCH=386 CGO_ENABLED=0
61+
FLAGS_openbsd_amd64 = GOOS=openbsd GOARCH=amd64 CGO_ENABLED=0
62+
FLAGS_solaris_amd64 = GOOS=solaris GOARCH=amd64 CGO_ENABLED=0
7063

7164
all: build
72-
.PHONY: all
73-
74-
go-path/src/github.com/joewalnes/websocketd: ../*.go ../libwebsocketd/*.go
75-
rm -f $@
76-
mkdir -p go-path/src/github.com/joewalnes
77-
cd go-path/src/github.com/joewalnes && ln -s ../../../../../ websocketd
78-
79-
80-
# Download Go source code
81-
$(GO_DOWNLOAD):
82-
$(call msg,"Dowloading Go $(GO_VERSION)")
83-
mkdir -p $(dir $@)
84-
curl --silent --fail --output $@ $(GO_SRC_URL)
8565

86-
go-download: $(GO_DOWNLOAD)
87-
.PHONY: go-download
66+
localgo: $(GO_DIR)/bin/go
8867

89-
# Unpack Go source code
90-
$(GO_UNPACKED): $(GO_DOWNLOAD)
91-
$(call msg,"Unpacking Go $(GO_VERSION)")
92-
rm -f $(GO_UNPACKED)
68+
$(GO_DIR)/bin/go:
9369
mkdir -p $(GO_DIR)
94-
tar xzf $(GO_DOWNLOAD) -C $(GO_DIR)
95-
touch $(GO_UNPACKED)
96-
97-
go-unpack: $(GO_UNPACKED)
98-
.PHONY: go-unpack
70+
rm -f $@
71+
@echo Downloading and unpacking Go $(GO_VERSION) to $(GO_DIR)
72+
curl $(GO_DOWNLOAD_URL) | tar xzf - --strip-components=1 -C $(GO_DIR)
9973

10074

10175
# Cross-compile final applications
102-
out/$(RELEASE_VERSION)/%/websocketd out/$(RELEASE_VERSION)/%/websocketd.exe: $(GO_UNPACKED) $(wildcard ../*.go) go-path/src/github.com/joewalnes/websocketd
103-
$(call msg,"Compiling release for $*")
76+
out/$(RELEASE_VERSION)/%/websocketd: ../*.go ../libwebsocketd/*.go $(GO_DIR)/bin/go
77+
rm -f $@
78+
mkdir -p $(dir $@)
79+
$(FLAGS_$*) $(GO_DIR)/bin/go build -ldflags "-X main.version=$(RELEASE_VERSION)" -o out/$(RELEASE_VERSION)/$*/websocketd ..
80+
81+
out/$(RELEASE_VERSION)/%/websocketd.exe: ../*.go ../libwebsocketd/*.go $(GO_DIR)/bin/go
10482
rm -f $@
10583
mkdir -p $(dir $@)
106-
$(FLAGS_$*) $(GO_DIR)/go/bin/go get github.com/gorilla/websocket
107-
$(FLAGS_$*) $(GO_DIR)/go/bin/go build -ldflags "-X main.version=$(RELEASE_VERSION)" -o out/$(RELEASE_VERSION)/$*/websocketd$(EXTENSION_$*) $(wildcard ../*.go)
108-
touch $@
84+
$(FLAGS_$*) $(GO_DIR)/bin/go build -ldflags "-X main.version=$(RELEASE_VERSION)" -o out/$(RELEASE_VERSION)/$*/websocketd.exe ..
10985

110-
out/$(RELEASE_VERSION)/websocketd-$(RELEASE_VERSION)-%.zip: out/$(RELEASE_VERSION)/%/websocketd $(wildcard ../*.go) go-path/src/github.com/joewalnes/websocketd
86+
out/$(RELEASE_VERSION)/websocketd-$(RELEASE_VERSION)-%.zip: out/$(RELEASE_VERSION)/%/websocketd
11187
rm -f $@
11288
zip -j $@ out/$(RELEASE_VERSION)/$*/* ../{README.md,LICENSE,CHANGES}
11389

@@ -118,10 +94,8 @@ DEBS = out/$(RELEASE_VERSION)/websocketd-$(RELEASE_VERSION)_i386.deb out/$(RELEA
11894
RPMS = out/$(RELEASE_VERSION)/websocketd.$(RELEASE_VERSION).i386.rpm out/$(RELEASE_VERSION)/websocketd.$(RELEASE_VERSION).x86_64.rpm
11995

12096
binaries: $(BINARIES)
121-
.PHONY: websocketd
12297

12398
build: out/$(RELEASE_VERSION)/CHECKSUMS
124-
.PHONY: build
12599

126100
out/$(RELEASE_VERSION)/CHECKSUMS: $(BINARIES) $(ZIPS) $(DEBS) $(RPMS)
127101
sha256sum $^ | sed -e 's/out\/$(RELEASE_VERSION)\///' >$@
@@ -134,10 +108,8 @@ DEBFPM=""
134108
RPMFPM=--rpm-os linux
135109

136110
deb: $(DEBS)
137-
.PHONY: deb
138111

139112
rpm: $(RPMS)
140-
.PHONY: rpm
141113

142114

143115
out/$(RELEASE_VERSION)/websocketd-$(RELEASE_VERSION)_i386.deb: $(GO_UNPACKED) out/$(RELEASE_VERSION)/linux_386/websocketd
@@ -175,17 +147,10 @@ out/$(RELEASE_VERSION)/websocketd.$(RELEASE_VERSION).i386.rpm: $(GO_UNPACKED) ou
175147

176148
# Clean up
177149
clobber: clean
178-
.PHONY: clobber
179-
180-
clean: clean-go clean-out
181-
.PHONY: clean
150+
rm -rf $(GO_DIR)
182151

183-
clean-go:
184-
rm -rf go-local
185-
rm -rf go-path
186-
.PHONY: clean-go
187152

188-
clean-out:
153+
clean:
189154
rm -rf out
190-
.PHONY: clean-out
191155

156+
.PHONY: all build deb rpm localgo clobber clean

0 commit comments

Comments
 (0)