xref: /unit/pkg/rpm/Makefile.jsc8 (revision 1225:0f35b3937026)
1MODULES+=		jsc8
2MODULE_SUFFIX_jsc8=	jsc8
3
4MODULE_SUMMARY_jsc8=	Java 8 module for NGINX Unit
5
6MODULE_VERSION_jsc8=	$(VERSION)
7MODULE_RELEASE_jsc8=	1
8
9JAVA_ARCH_jsc8=	$(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>&1 | grep -F -e os.arch | sed -e 's/^.*= //')
10
11MODULE_CONFARGS_jsc8=	java --module=java8 --home=/usr/lib/jvm/java-1.8.0 --lib-path=/usr/lib/jvm/jre-1.8.0/lib/$(JAVA_ARCH_jsc8)/server --jars=/usr/share/unit-jsc-common/
12MODULE_MAKEARGS_jsc8=	java8
13MODULE_INSTARGS_jsc8=	java8-install
14
15MODULE_SOURCES_jsc8=	unit.example-jsc-app \
16			unit.example-jsc8-config
17
18BUILD_DEPENDS_jsc8=	java-1.8.0-openjdk-devel
19BUILD_DEPENDS+=		$(BUILD_DEPENDS_jsc8)
20
21define MODULE_DEFINITIONS_jsc8
22Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx
23Requires: java-1.8.0-headless
24endef
25export MODULE_DEFINITIONS_jsc8
26
27define MODULE_PREINSTALL_jsc8
28%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc8/examples/jsc-app
29%{__install} -m 644 -p %{SOURCE100} \
30    %{buildroot}%{_datadir}/doc/unit-jsc8/examples/jsc-app/index.jsp
31%{__install} -m 644 -p %{SOURCE101} \
32    %{buildroot}%{_datadir}/doc/unit-jsc8/examples/unit.config
33%{__install} -m 644 -p %{bdir}/src/java/README.JSR-340 \
34    %{buildroot}%{_datadir}/doc/unit-jsc8/
35endef
36export MODULE_PREINSTALL_jsc8
37
38define MODULE_POSTINSTALL_jsc8
39DESTDIR=%{buildroot} make java-shared-uninstall
40endef
41export MODULE_POSTINSTALL_jsc8
42
43define MODULE_FILES_jsc8
44%{_libdir}/unit/modules/*
45%{_libdir}/unit/debug-modules/*
46%dir %{_datadir}/doc/unit-jsc8
47%{_datadir}/doc/unit-jsc8/*
48%{_datadir}/unit-jsc-common/*
49endef
50export MODULE_FILES_jsc8
51
52define MODULE_POST_jsc8
53cat <<BANNER
54----------------------------------------------------------------------
55
56The $(MODULE_SUMMARY_jsc8) has been installed.
57
58To check out the sample app, run these commands:
59
60 sudo service unit restart
61 cd /usr/share/doc/%{name}/examples
62 sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
63 curl http://localhost:8800/
64
65Online documentation is available at https://unit.nginx.org
66
67`cat /usr/share/doc/unit-jsc8/README.JSR-340`
68
69----------------------------------------------------------------------
70BANNER
71endef
72export MODULE_POST_jsc8
73