From 3d712a7078e6cd85dc7f2961628bea46cfea5236 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 24 Dec 2019 17:59:44 +0300 Subject: Packages: making unit-go architecture independent. To support Go modules, the unit-go module should be platform independent. All platform-dependent logic is moved to libunit, so the unit-dev package should be installed before building unit-go. --- pkg/deb/Makefile | 17 +++------ pkg/deb/Makefile.go | 6 ++- pkg/deb/Makefile.go110 | 48 ------------------------ pkg/deb/Makefile.go111 | 48 ------------------------ pkg/deb/Makefile.go112 | 48 ------------------------ pkg/deb/Makefile.go113 | 48 ------------------------ pkg/deb/Makefile.go17 | 48 ------------------------ pkg/deb/Makefile.go18 | 48 ------------------------ pkg/deb/Makefile.go19 | 48 ------------------------ pkg/deb/debian.module/unit.example-go1.10-config | 15 -------- pkg/deb/debian.module/unit.example-go1.11-config | 15 -------- pkg/deb/debian.module/unit.example-go1.12-config | 15 -------- pkg/deb/debian.module/unit.example-go1.13-config | 15 -------- pkg/deb/debian.module/unit.example-go1.7-config | 15 -------- pkg/deb/debian.module/unit.example-go1.8-config | 15 -------- pkg/deb/debian.module/unit.example-go1.9-config | 15 -------- 16 files changed, 10 insertions(+), 454 deletions(-) delete mode 100644 pkg/deb/Makefile.go110 delete mode 100644 pkg/deb/Makefile.go111 delete mode 100644 pkg/deb/Makefile.go112 delete mode 100644 pkg/deb/Makefile.go113 delete mode 100644 pkg/deb/Makefile.go17 delete mode 100644 pkg/deb/Makefile.go18 delete mode 100644 pkg/deb/Makefile.go19 delete mode 100644 pkg/deb/debian.module/unit.example-go1.10-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.11-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.12-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.13-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.7-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.8-config delete mode 100644 pkg/deb/debian.module/unit.example-go1.9-config (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index 855dd6f7..788d5a1f 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -22,8 +22,7 @@ include Makefile.php include Makefile.python27 include Makefile.python37 include Makefile.python38 -include Makefile.go112 -include Makefile.go113 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common @@ -36,8 +35,7 @@ include Makefile.php include Makefile.python27 include Makefile.python37 include Makefile.python38 -include Makefile.go110 -include Makefile.go111 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common @@ -50,8 +48,7 @@ include Makefile.php include Makefile.python27 include Makefile.python36 include Makefile.python37 -include Makefile.go19 -include Makefile.go110 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common @@ -66,8 +63,7 @@ include Makefile.python27 include Makefile.python36 include Makefile.python37 include Makefile.python38 -include Makefile.go19 -include Makefile.go110 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common @@ -99,7 +95,7 @@ ifeq ($(CODENAME),buster) include Makefile.php include Makefile.python27 include Makefile.python37 -include Makefile.go111 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common @@ -111,8 +107,7 @@ ifeq ($(CODENAME),stretch) include Makefile.php include Makefile.python27 include Makefile.python35 -include Makefile.go17 -include Makefile.go18 +include Makefile.go include Makefile.perl include Makefile.ruby include Makefile.jsc-common diff --git a/pkg/deb/Makefile.go b/pkg/deb/Makefile.go index 3399f5ca..cdccb5ed 100644 --- a/pkg/deb/Makefile.go +++ b/pkg/deb/Makefile.go @@ -8,7 +8,7 @@ MODULE_RELEASE_go= 1 MODULE_CONFARGS_go= go --go-path=/usr/share/gocode MODULE_MAKEARGS_go= go -MODULE_INSTARGS_go= go-install +MODULE_INSTARGS_go= go-install-src MODULE_SOURCES_go= unit.example-go-app \ unit.example-go-config @@ -17,7 +17,9 @@ BUILD_DEPENDS_go= golang BUILD_DEPENDS+= $(BUILD_DEPENDS_go) MODULE_BUILD_DEPENDS_go=,golang -MODULE_DEPENDS_go=,golang +MODULE_DEPENDS_go=,golang,unit-dev (= $(VERSION)-$(RELEASE)~$(CODENAME)) + +MODULE_NOARCH_go= true define MODULE_PREINSTALL_go mkdir -p debian/unit-go/usr/share/doc/unit-go/examples/go-app diff --git a/pkg/deb/Makefile.go110 b/pkg/deb/Makefile.go110 deleted file mode 100644 index 0e956d9f..00000000 --- a/pkg/deb/Makefile.go110 +++ /dev/null @@ -1,48 +0,0 @@ -MODULES+= go110 -MODULE_SUFFIX_go110= go1.10 - -MODULE_SUMMARY_go110= Go 1.10 module for NGINX Unit - -MODULE_VERSION_go110= $(VERSION) -MODULE_RELEASE_go110= 1 - -MODULE_CONFARGS_go110= go --go=/usr/lib/go-1.10/bin/go --go-path=/usr/share/gocode -MODULE_MAKEARGS_go110= /usr/lib/go-1.10/bin/go -MODULE_INSTARGS_go110= /usr/lib/go-1.10/bin/go-install - -MODULE_SOURCES_go110= unit.example-go-app \ - unit.example-go1.10-config - -BUILD_DEPENDS_go110= golang-1.10 -BUILD_DEPENDS+= $(BUILD_DEPENDS_go110) - -MODULE_BUILD_DEPENDS_go110=,golang-1.10 -MODULE_DEPENDS_go110=,golang-1.10 - -define MODULE_PREINSTALL_go110 - mkdir -p debian/unit-go1.10/usr/share/doc/unit-go1.10/examples/go-app - install -m 644 -p debian/unit.example-go-app debian/unit-go1.10/usr/share/doc/unit-go1.10/examples/go-app/let-my-people.go - install -m 644 -p debian/unit.example-go1.10-config debian/unit-go1.10/usr/share/doc/unit-go1.10/examples/unit.config -endef -export MODULE_PREINSTALL_go110 - -define MODULE_POST_go110 -cat < Date: Tue, 24 Dec 2019 17:59:52 +0300 Subject: Go: moving source files to the root of the project. This patch includes packaging changes related to files move. --- pkg/deb/Makefile | 2 +- pkg/deb/debian.module/rules-noarch.in | 1 + pkg/deb/debian.module/rules.in | 1 + pkg/deb/debian/rules.in | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index 788d5a1f..13063fd8 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -195,7 +195,7 @@ endif debuild/unit_$(VERSION).orig.tar.gz: | debuild/$(SRCDIR)/debian cd ../.. && tar -czf pkg/deb/debuild/$(SRCDIR).tar.gz \ --transform "s#^#$(SRCDIR)/#" \ - LICENSE NOTICE CHANGES README configure auto src test version + LICENSE NOTICE CHANGES README configure auto src test version go mv debuild/$(SRCDIR).tar.gz debuild/unit_$(VERSION).orig.tar.gz cd debuild && tar zxf unit_$(VERSION).orig.tar.gz diff --git a/pkg/deb/debian.module/rules-noarch.in b/pkg/deb/debian.module/rules-noarch.in index 823675ba..a24602c4 100644 --- a/pkg/deb/debian.module/rules-noarch.in +++ b/pkg/deb/debian.module/rules-noarch.in @@ -27,6 +27,7 @@ config.env.%: cp -Pa $(CURDIR)/LICENSE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/NOTICE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/README $(BUILDDIR_$*)/ + cp -Pa $(CURDIR)/go $(BUILDDIR_$*)/ touch $@ configure.unit: config.env.unit diff --git a/pkg/deb/debian.module/rules.in b/pkg/deb/debian.module/rules.in index 1391e01a..8ee277b3 100755 --- a/pkg/deb/debian.module/rules.in +++ b/pkg/deb/debian.module/rules.in @@ -27,6 +27,7 @@ config.env.%: cp -Pa $(CURDIR)/LICENSE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/NOTICE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/README $(BUILDDIR_$*)/ + cp -Pa $(CURDIR)/go $(BUILDDIR_$*)/ touch $@ configure.unit: config.env.unit diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index bee9223f..a4696793 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -31,6 +31,7 @@ config.env.%: cp -Pa $(CURDIR)/LICENSE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/NOTICE $(BUILDDIR_$*)/ cp -Pa $(CURDIR)/README $(BUILDDIR_$*)/ + cp -Pa $(CURDIR)/go $(BUILDDIR_$*)/ touch $@ configure.unit: config.env.unit -- cgit From 693a458b4ea87b7b387bd9d094de2b42be7ecdbd Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 25 Dec 2019 20:00:32 +0300 Subject: Go: changing import name for "unit.nginx.org/go". This patch includes packaging changes - update unit-go installation directory. --- pkg/deb/debian.module/unit.example-go-app | 2 +- pkg/deb/debian/unit.example-go-app | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/deb') diff --git a/pkg/deb/debian.module/unit.example-go-app b/pkg/deb/debian.module/unit.example-go-app index 7ca0c9fd..6eec1dbb 100644 --- a/pkg/deb/debian.module/unit.example-go-app +++ b/pkg/deb/debian.module/unit.example-go-app @@ -3,7 +3,7 @@ package main import ( "fmt" "net/http" - "nginx/unit" + "unit.nginx.org/go" ) func handler(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/deb/debian/unit.example-go-app b/pkg/deb/debian/unit.example-go-app index 7ca0c9fd..6eec1dbb 100644 --- a/pkg/deb/debian/unit.example-go-app +++ b/pkg/deb/debian/unit.example-go-app @@ -3,7 +3,7 @@ package main import ( "fmt" "net/http" - "nginx/unit" + "unit.nginx.org/go" ) func handler(w http.ResponseWriter, r *http.Request) { -- cgit