xref: /unit/pkg/rpm/Makefile.jsc11 (revision 1496:9e14c63773be)
1MODULES+=		jsc11
2MODULE_SUFFIX_jsc11=	jsc11
3
4MODULE_SUMMARY_jsc11=	Java 11 module for NGINX Unit
5
6MODULE_VERSION_jsc11=	$(VERSION)
7MODULE_RELEASE_jsc11=	1
8
9MODULE_CONFARGS_jsc11=	java --module=java11 --home=/usr/lib/jvm/java-11 --lib-path=/usr/lib/jvm/jre-11/lib --jars=/usr/share/unit-jsc-common/
10MODULE_MAKEARGS_jsc11=	java11
11MODULE_INSTARGS_jsc11=	java11-install
12
13MODULE_SOURCES_jsc11=	unit.example-jsc-app \
14			unit.example-jsc11-config
15
16BUILD_DEPENDS_jsc11=	java-11-openjdk-devel
17BUILD_DEPENDS+=		$(BUILD_DEPENDS_jsc11)
18
19define MODULE_DEFINITIONS_jsc11
20Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx
21Requires: java-11-headless
22endef
23export MODULE_DEFINITIONS_jsc11
24
25define MODULE_PREINSTALL_jsc11
26%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc11/examples/jsc-app
27%{__install} -m 644 -p %{SOURCE100} \
28    %{buildroot}%{_datadir}/doc/unit-jsc11/examples/jsc-app/index.jsp
29%{__install} -m 644 -p %{SOURCE101} \
30    %{buildroot}%{_datadir}/doc/unit-jsc11/examples/unit.config
31%{__install} -m 644 -p %{bdir}/src/java/README.JSR-340 \
32    %{buildroot}%{_datadir}/doc/unit-jsc11/
33endef
34export MODULE_PREINSTALL_jsc11
35
36define MODULE_POSTINSTALL_jsc11
37DESTDIR=%{buildroot} make java-shared-uninstall
38endef
39export MODULE_POSTINSTALL_jsc11
40
41define MODULE_FILES_jsc11
42%{_libdir}/unit/modules/*
43%{_libdir}/unit/debug-modules/*
44%dir %{_datadir}/doc/unit-jsc11
45%{_datadir}/doc/unit-jsc11/*
46%{_datadir}/unit-jsc-common/*
47endef
48export MODULE_FILES_jsc11
49
50define MODULE_POST_jsc11
51cat <<BANNER
52----------------------------------------------------------------------
53
54The $(MODULE_SUMMARY_jsc11) has been installed.
55
56To check out the sample app, run these commands:
57
58 sudo service unit restart
59 cd /usr/share/doc/%{name}/examples
60 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
61 curl http://localhost:8800/
62
63Online documentation is available at https://unit.nginx.org
64
65`cat /usr/share/doc/unit-jsc11/README.JSR-340`
66
67----------------------------------------------------------------------
68BANNER
69endef
70export MODULE_POST_jsc11
71