xref: /unit/pkg/rpm/Makefile.ruby (revision 1225:0f35b3937026)
1600Sdefan@nginx.comMODULES+=		ruby
2600Sdefan@nginx.comMODULE_SUFFIX_ruby=	ruby
3600Sdefan@nginx.com
4600Sdefan@nginx.comMODULE_SUMMARY_ruby=	Ruby module for NGINX Unit
5600Sdefan@nginx.com
6600Sdefan@nginx.comMODULE_VERSION_ruby=	$(VERSION)
7*1225Sdefan@nginx.comMODULE_RELEASE_ruby=	1
8600Sdefan@nginx.com
9600Sdefan@nginx.comMODULE_CONFARGS_ruby=	ruby
10600Sdefan@nginx.comMODULE_MAKEARGS_ruby=	ruby
11600Sdefan@nginx.comMODULE_INSTARGS_ruby=	ruby-install
12600Sdefan@nginx.com
13600Sdefan@nginx.comMODULE_SOURCES_ruby=	unit.example-ruby-app \
14600Sdefan@nginx.com			unit.example-ruby-config
15600Sdefan@nginx.com
16600Sdefan@nginx.comifeq ($(OSVER), opensuse-leap)
17600Sdefan@nginx.comRACK_PACKAGE=	ruby2.1-rubygem-rack
18600Sdefan@nginx.comelse ifeq ($(OSVER), opensuse-tumbleweed)
19600Sdefan@nginx.comRACK_PACKAGE=	ruby2.5-rubygem-rack
20600Sdefan@nginx.comelse
21600Sdefan@nginx.comRACK_PACKAGE=	rubygem-rack
22600Sdefan@nginx.comendif
23600Sdefan@nginx.com
24600Sdefan@nginx.comBUILD_DEPENDS_ruby=	ruby-devel $(RACK_PACKAGE)
25600Sdefan@nginx.comBUILD_DEPENDS+=		$(BUILD_DEPENDS_ruby)
26600Sdefan@nginx.com
27600Sdefan@nginx.comdefine MODULE_DEFINITIONS_ruby
28600Sdefan@nginx.comBuildRequires: $(BUILD_DEPENDS_ruby)
29600Sdefan@nginx.comRequires: $(RACK_PACKAGE)
30600Sdefan@nginx.comendef
31600Sdefan@nginx.comexport MODULE_DEFINITIONS_ruby
32600Sdefan@nginx.com
33600Sdefan@nginx.comdefine MODULE_PREINSTALL_ruby
34600Sdefan@nginx.com%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-ruby/examples
35600Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE100} \
36600Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-ruby/examples/ruby-app.ru
37600Sdefan@nginx.com%{__install} -m 644 -p %{SOURCE101} \
38600Sdefan@nginx.com    %{buildroot}%{_datadir}/doc/unit-ruby/examples/unit.config
39600Sdefan@nginx.comendef
40600Sdefan@nginx.comexport MODULE_PREINSTALL_ruby
41600Sdefan@nginx.com
42600Sdefan@nginx.comdefine MODULE_FILES_ruby
43600Sdefan@nginx.com%{_libdir}/unit/modules/*
44600Sdefan@nginx.com%{_libdir}/unit/debug-modules/*
45600Sdefan@nginx.comendef
46600Sdefan@nginx.comexport MODULE_FILES_ruby
47600Sdefan@nginx.com
48600Sdefan@nginx.comdefine MODULE_POST_ruby
49600Sdefan@nginx.comcat <<BANNER
50600Sdefan@nginx.com----------------------------------------------------------------------
51600Sdefan@nginx.com
52600Sdefan@nginx.comThe $(MODULE_SUMMARY_ruby) has been installed.
53600Sdefan@nginx.com
54600Sdefan@nginx.comTo check the sample app, run these commands:
55600Sdefan@nginx.com
56600Sdefan@nginx.com sudo service unit start
57787Sdefan@nginx.com cd /usr/share/doc/%{name}/examples
58912Sdefan@nginx.com sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
59600Sdefan@nginx.com curl http://localhost:8700/
60600Sdefan@nginx.com
61600Sdefan@nginx.comOnline documentation is available at https://unit.nginx.org
62600Sdefan@nginx.com
63600Sdefan@nginx.com----------------------------------------------------------------------
64600Sdefan@nginx.comBANNER
65600Sdefan@nginx.comendef
66600Sdefan@nginx.comexport MODULE_POST_ruby
67