xref: /unit/pkg/rpm/Makefile.ruby (revision 2191:cc6cc1bb1fd9)
1MODULES+=		ruby
2MODULE_SUFFIX_ruby=	ruby
3
4MODULE_SUMMARY_ruby=	Ruby module for NGINX Unit
5
6MODULE_VERSION_ruby=	$(VERSION)
7MODULE_RELEASE_ruby=	1
8
9MODULE_CONFARGS_ruby=	ruby
10MODULE_MAKEARGS_ruby=	ruby
11MODULE_INSTARGS_ruby=	ruby-install
12
13MODULE_SOURCES_ruby=	unit.example-ruby-app \
14			unit.example-ruby-config
15
16RACK_PACKAGE=	rubygem-rack
17
18BUILD_DEPENDS_ruby=	ruby-devel $(RACK_PACKAGE)
19BUILD_DEPENDS+=		$(BUILD_DEPENDS_ruby)
20
21define MODULE_DEFINITIONS_ruby
22BuildRequires: $(BUILD_DEPENDS_ruby)
23Requires: $(RACK_PACKAGE)
24endef
25export MODULE_DEFINITIONS_ruby
26
27define MODULE_PREINSTALL_ruby
28%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-ruby/examples
29%{__install} -m 644 -p %{SOURCE100} \
30    %{buildroot}%{_datadir}/doc/unit-ruby/examples/ruby-app.ru
31%{__install} -m 644 -p %{SOURCE101} \
32    %{buildroot}%{_datadir}/doc/unit-ruby/examples/unit.config
33endef
34export MODULE_PREINSTALL_ruby
35
36define MODULE_FILES_ruby
37%{_libdir}/unit/modules/*
38%{_libdir}/unit/debug-modules/*
39endef
40export MODULE_FILES_ruby
41
42define MODULE_POST_ruby
43cat <<BANNER
44----------------------------------------------------------------------
45
46The $(MODULE_SUMMARY_ruby) has been installed.
47
48To check the sample app, run these commands:
49
50 sudo service unit start
51 cd /usr/share/doc/%{name}/examples
52 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
53 curl http://localhost:8700/
54
55Online documentation is available at https://unit.nginx.org
56
57----------------------------------------------------------------------
58BANNER
59endef
60export MODULE_POST_ruby
61