xref: /unit/pkg/rpm/Makefile.ruby (revision 1225:0f35b3937026)
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
16ifeq ($(OSVER), opensuse-leap)
17RACK_PACKAGE=	ruby2.1-rubygem-rack
18else ifeq ($(OSVER), opensuse-tumbleweed)
19RACK_PACKAGE=	ruby2.5-rubygem-rack
20else
21RACK_PACKAGE=	rubygem-rack
22endif
23
24BUILD_DEPENDS_ruby=	ruby-devel $(RACK_PACKAGE)
25BUILD_DEPENDS+=		$(BUILD_DEPENDS_ruby)
26
27define MODULE_DEFINITIONS_ruby
28BuildRequires: $(BUILD_DEPENDS_ruby)
29Requires: $(RACK_PACKAGE)
30endef
31export MODULE_DEFINITIONS_ruby
32
33define MODULE_PREINSTALL_ruby
34%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-ruby/examples
35%{__install} -m 644 -p %{SOURCE100} \
36    %{buildroot}%{_datadir}/doc/unit-ruby/examples/ruby-app.ru
37%{__install} -m 644 -p %{SOURCE101} \
38    %{buildroot}%{_datadir}/doc/unit-ruby/examples/unit.config
39endef
40export MODULE_PREINSTALL_ruby
41
42define MODULE_FILES_ruby
43%{_libdir}/unit/modules/*
44%{_libdir}/unit/debug-modules/*
45endef
46export MODULE_FILES_ruby
47
48define MODULE_POST_ruby
49cat <<BANNER
50----------------------------------------------------------------------
51
52The $(MODULE_SUMMARY_ruby) has been installed.
53
54To check the sample app, run these commands:
55
56 sudo service unit start
57 cd /usr/share/doc/%{name}/examples
58 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
59 curl http://localhost:8700/
60
61Online documentation is available at https://unit.nginx.org
62
63----------------------------------------------------------------------
64BANNER
65endef
66export MODULE_POST_ruby
67