xref: /unit/pkg/deb/Makefile.go (revision 2107)
1373Sdefan@nginx.comMODULES+=		go
2373Sdefan@nginx.comMODULE_SUFFIX_go=	go
3373Sdefan@nginx.com
4373Sdefan@nginx.comMODULE_SUMMARY_go=	Go module for NGINX Unit
5373Sdefan@nginx.com
6373Sdefan@nginx.comMODULE_VERSION_go=	$(VERSION)
7821Svbart@nginx.comMODULE_RELEASE_go=	1
8373Sdefan@nginx.com
9399Smax.romanov@nginx.comMODULE_CONFARGS_go=	go --go-path=/usr/share/gocode
10373Sdefan@nginx.comMODULE_MAKEARGS_go=	go
111314Smax.romanov@nginx.comMODULE_INSTARGS_go=	go-install-src
12373Sdefan@nginx.com
13373Sdefan@nginx.comMODULE_SOURCES_go=	unit.example-go-app \
14373Sdefan@nginx.com			unit.example-go-config
15373Sdefan@nginx.com
16489Sdefan@nginx.comBUILD_DEPENDS_go=	golang
17489Sdefan@nginx.comBUILD_DEPENDS+=		$(BUILD_DEPENDS_go)
18373Sdefan@nginx.com
19373Sdefan@nginx.comMODULE_BUILD_DEPENDS_go=,golang
201314Smax.romanov@nginx.comMODULE_DEPENDS_go=,golang,unit-dev (= $(VERSION)-$(RELEASE)~$(CODENAME))
211314Smax.romanov@nginx.com
221314Smax.romanov@nginx.comMODULE_NOARCH_go=	true
23373Sdefan@nginx.com
24373Sdefan@nginx.comdefine MODULE_PREINSTALL_go
25373Sdefan@nginx.com	mkdir -p debian/unit-go/usr/share/doc/unit-go/examples/go-app
26373Sdefan@nginx.com	install -m 644 -p debian/unit.example-go-app debian/unit-go/usr/share/doc/unit-go/examples/go-app/let-my-people.go
27373Sdefan@nginx.com	install -m 644 -p debian/unit.example-go-config debian/unit-go/usr/share/doc/unit-go/examples/unit.config
28373Sdefan@nginx.comendef
29373Sdefan@nginx.comexport MODULE_PREINSTALL_go
30373Sdefan@nginx.com
31373Sdefan@nginx.comdefine MODULE_POST_go
32373Sdefan@nginx.comcat <<BANNER
33373Sdefan@nginx.com----------------------------------------------------------------------
34373Sdefan@nginx.com
35373Sdefan@nginx.comThe $(MODULE_SUMMARY_go) has been installed.
36373Sdefan@nginx.com
37373Sdefan@nginx.comTo check out the sample app, run these commands:
38373Sdefan@nginx.com
39*2107Sthresh@nginx.com GOPATH=/usr/share/gocode GO111MODULE=auto go build -o /tmp/go-app /usr/share/doc/unit-$(MODULE_SUFFIX_go)/examples/go-app/let-my-people.go
40373Sdefan@nginx.com sudo service unit restart
41787Sdefan@nginx.com cd /usr/share/doc/unit-$(MODULE_SUFFIX_go)/examples
42901Sdefan@nginx.com sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/control.unit.sock http://localhost/config
43373Sdefan@nginx.com curl http://localhost:8500/
44373Sdefan@nginx.com
45373Sdefan@nginx.comOnline documentation is available at https://unit.nginx.org
46373Sdefan@nginx.com
47373Sdefan@nginx.com----------------------------------------------------------------------
48373Sdefan@nginx.comBANNER
49373Sdefan@nginx.comendef
50373Sdefan@nginx.comexport MODULE_POST_go
51