xref: /unit/pkg/deb/Makefile.go (revision 901)
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
11373Sdefan@nginx.comMODULE_INSTARGS_go=	go-install
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
20373Sdefan@nginx.comMODULE_DEPENDS_go=,golang
21373Sdefan@nginx.com
22373Sdefan@nginx.comdefine MODULE_PREINSTALL_go
23373Sdefan@nginx.com	mkdir -p debian/unit-go/usr/share/doc/unit-go/examples/go-app
24373Sdefan@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
25373Sdefan@nginx.com	install -m 644 -p debian/unit.example-go-config debian/unit-go/usr/share/doc/unit-go/examples/unit.config
26373Sdefan@nginx.comendef
27373Sdefan@nginx.comexport MODULE_PREINSTALL_go
28373Sdefan@nginx.com
29373Sdefan@nginx.comdefine MODULE_POST_go
30373Sdefan@nginx.comcat <<BANNER
31373Sdefan@nginx.com----------------------------------------------------------------------
32373Sdefan@nginx.com
33373Sdefan@nginx.comThe $(MODULE_SUMMARY_go) has been installed.
34373Sdefan@nginx.com
35373Sdefan@nginx.comTo check out the sample app, run these commands:
36373Sdefan@nginx.com
37787Sdefan@nginx.com GOPATH=/usr/share/gocode go build -o /tmp/go-app /usr/share/doc/unit-$(MODULE_SUFFIX_go)/examples/go-app/let-my-people.go
38373Sdefan@nginx.com sudo service unit restart
39787Sdefan@nginx.com cd /usr/share/doc/unit-$(MODULE_SUFFIX_go)/examples
40*901Sdefan@nginx.com sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/control.unit.sock http://localhost/config
41373Sdefan@nginx.com curl http://localhost:8500/
42373Sdefan@nginx.com
43373Sdefan@nginx.comOnline documentation is available at https://unit.nginx.org
44373Sdefan@nginx.com
45373Sdefan@nginx.com----------------------------------------------------------------------
46373Sdefan@nginx.comBANNER
47373Sdefan@nginx.comendef
48373Sdefan@nginx.comexport MODULE_POST_go
49