xref: /unit/pkg/rpm/Makefile.go (revision 489)
1372Sdefan@nginx.comMODULES+=		go
2372Sdefan@nginx.com
3372Sdefan@nginx.comMODULE_SUMMARY_go=	Go module for NGINX Unit
4372Sdefan@nginx.com
5372Sdefan@nginx.comMODULE_VERSION_go=	$(VERSION)
6372Sdefan@nginx.comMODULE_RELEASE_go=	1
7372Sdefan@nginx.com
8399Smax.romanov@nginx.comMODULE_CONFARGS_go=	go --go-path=%{gopath}
9372Sdefan@nginx.comMODULE_MAKEARGS_go=	go
10372Sdefan@nginx.comMODULE_INSTARGS_go=	go-install
11372Sdefan@nginx.com
12372Sdefan@nginx.comMODULE_SOURCES_go=	unit.example-go-app \
13372Sdefan@nginx.com			unit.example-go-config
14372Sdefan@nginx.com
15*489Sdefan@nginx.comBUILD_DEPENDS_go=	golang
16*489Sdefan@nginx.comBUILD_DEPENDS+=		$(BUILD_DEPENDS_go)
17372Sdefan@nginx.com
18372Sdefan@nginx.comdefine MODULE_DEFINITIONS_go
19372Sdefan@nginx.com
20372Sdefan@nginx.comBuildRequires: golang
21399Smax.romanov@nginx.comBuildArch: noarch
22372Sdefan@nginx.comendef
23372Sdefan@nginx.comexport MODULE_DEFINITIONS_go
24372Sdefan@nginx.com
25372Sdefan@nginx.comdefine MODULE_PREINSTALL_go
26372Sdefan@nginx.comQA_SKIP_BUILD_ROOT=1
27372Sdefan@nginx.comexport QA_SKIP_BUILD_ROOT
28372Sdefan@nginx.com
29372Sdefan@nginx.com%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-go/examples/go-app
30372Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE100} \
31372Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-go/examples/go-app/let-my-people.go
32372Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE101} \
33372Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-go/examples/unit.config
34372Sdefan@nginx.comendef
35372Sdefan@nginx.comexport MODULE_PREINSTALL_go
36372Sdefan@nginx.com
37372Sdefan@nginx.comdefine MODULE_FILES_go
38399Smax.romanov@nginx.com%dir %{gopath}/src/nginx/unit
39399Smax.romanov@nginx.com%{gopath}/src/nginx/unit/*
40372Sdefan@nginx.comendef
41372Sdefan@nginx.comexport MODULE_FILES_go
42372Sdefan@nginx.com
43372Sdefan@nginx.comdefine MODULE_POST_go
44372Sdefan@nginx.comcat <<BANNER
45372Sdefan@nginx.com----------------------------------------------------------------------
46372Sdefan@nginx.com
47372Sdefan@nginx.comThe $(MODULE_SUMMARY_go) has been installed.
48372Sdefan@nginx.com
49372Sdefan@nginx.comTo check the sample app, run these commands:
50372Sdefan@nginx.com
51399Smax.romanov@nginx.com GOPATH=/usr/share/gocode go build -o /tmp/go-app /usr/share/doc/unit-go/examples/go-app/let-my-people.go
52372Sdefan@nginx.com sudo service unit start
53372Sdefan@nginx.com sudo service unit loadconfig /usr/share/doc/unit-go/examples/unit.config
54372Sdefan@nginx.com curl http://localhost:8500/
55372Sdefan@nginx.com
56372Sdefan@nginx.comOnline documentation is available at https://unit.nginx.org
57372Sdefan@nginx.com
58372Sdefan@nginx.com----------------------------------------------------------------------
59372Sdefan@nginx.comBANNER
60372Sdefan@nginx.comendef
61372Sdefan@nginx.comexport MODULE_POST_go
62