xref: /unit/pkg/rpm/Makefile.go (revision 561:111e9f2a1513)
1MODULES+=		go
2MODULE_SUFFIX_go=	go
3
4MODULE_SUMMARY_go=	Go module for NGINX Unit
5
6MODULE_VERSION_go=	$(VERSION)
7MODULE_RELEASE_go=	1
8
9MODULE_CONFARGS_go=	go --go-path=%{gopath}
10MODULE_MAKEARGS_go=	go
11MODULE_INSTARGS_go=	go-install
12
13MODULE_SOURCES_go=	unit.example-go-app \
14			unit.example-go-config
15
16ifeq ($(OSVER), centos6)
17BUILD_DEPENDS_go=	epel-release golang
18else
19BUILD_DEPENDS_go=	golang
20endif
21
22BUILD_DEPENDS+=		$(BUILD_DEPENDS_go)
23
24define MODULE_DEFINITIONS_go
25
26BuildRequires: golang
27BuildArch: noarch
28endef
29export MODULE_DEFINITIONS_go
30
31define MODULE_PREINSTALL_go
32QA_SKIP_BUILD_ROOT=1
33export QA_SKIP_BUILD_ROOT
34
35%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-go/examples/go-app
36%{__install} -m 644 -p %{SOURCE100} \
37    %{buildroot}%{_datadir}/doc/unit-go/examples/go-app/let-my-people.go
38%{__install} -m 644 -p %{SOURCE101} \
39    %{buildroot}%{_datadir}/doc/unit-go/examples/unit.config
40endef
41export MODULE_PREINSTALL_go
42
43define MODULE_FILES_go
44%dir %{gopath}/src/nginx/unit
45%{gopath}/src/nginx/unit/*
46endef
47export MODULE_FILES_go
48
49define MODULE_POST_go
50cat <<BANNER
51----------------------------------------------------------------------
52
53The $(MODULE_SUMMARY_go) has been installed.
54
55To check the sample app, run these commands:
56
57 GOPATH=/usr/share/gocode go build -o /tmp/go-app /usr/share/doc/unit-go/examples/go-app/let-my-people.go
58 sudo service unit start
59 sudo service unit loadconfig /usr/share/doc/unit-go/examples/unit.config
60 curl http://localhost:8500/
61
62Online documentation is available at https://unit.nginx.org
63
64----------------------------------------------------------------------
65BANNER
66endef
67export MODULE_POST_go
68