summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-11-21 18:32:28 -0800
committerKonstantin Pavlov <pavlov.konstantin@gmail.com>2024-12-12 19:13:30 -0800
commit19f403f5d015058399511af0fe3533899bbe506c (patch)
treebbdea448486aaec47e78bb06c1bd11509dab3dff
parent655ca61b2b944396ff4b7ca174aa79a7b55db8bc (diff)
downloadunit-19f403f5d015058399511af0fe3533899bbe506c.tar.gz
unit-19f403f5d015058399511af0fe3533899bbe506c.tar.bz2
Packages: add Fedora 41 support
While at it, removed support for Fedora 39 as it's EOL.
-rw-r--r--pkg/rpm/Makefile19
-rw-r--r--pkg/rpm/Makefile.jsc-common4
-rw-r--r--pkg/rpm/Makefile.jsc174
-rw-r--r--pkg/rpm/Makefile.jsc2169
-rw-r--r--pkg/rpm/Makefile.python31353
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config15
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config16
7 files changed, 173 insertions, 7 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index 8e353459..63213dc8 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -18,8 +18,10 @@ else ifeq ($(shell rpm --eval "%{?amzn}"), 2)
OSVER = amazonlinux2
else ifeq ($(shell rpm --eval "%{?amzn}"), 2023)
OSVER = amazonlinux2023
-else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 39'`; echo $$?),0)
-OSVER = fedora39
+else ifeq ($(shell test `rpm --eval '0%{?fedora} -eq 40'`; echo $$?),0)
+OSVER = fedora40
+else ifeq ($(shell test `rpm --eval '0%{?fedora} -eq 41'`; echo $$?),0)
+OSVER = fedora41
endif
BUILD_DEPENDS_unit = gcc rpm-build rpmlint clang llvm
@@ -81,7 +83,7 @@ include Makefile.jsc17
include Makefile.wasm
endif
-ifeq ($(OSVER), fedora39)
+ifeq ($(OSVER), fedora40)
include Makefile.php
include Makefile.python312
include Makefile.go
@@ -92,6 +94,17 @@ include Makefile.jsc17
include Makefile.wasm
endif
+ifeq ($(OSVER), fedora41)
+include Makefile.php
+include Makefile.python313
+include Makefile.go
+include Makefile.perl
+include Makefile.ruby
+include Makefile.jsc-common
+include Makefile.jsc17
+include Makefile.jsc21
+include Makefile.wasm
+endif
CONFIGURE_ARGS_COMMON=\
--prefix=/usr \
diff --git a/pkg/rpm/Makefile.jsc-common b/pkg/rpm/Makefile.jsc-common
index f77ca1e9..ebea404f 100644
--- a/pkg/rpm/Makefile.jsc-common
+++ b/pkg/rpm/Makefile.jsc-common
@@ -10,7 +10,7 @@ JAVA_ARCH_jsc_common= $(shell /usr/lib/jvm/java-1.8.0/bin/java -XshowSettings 2>
ifeq ($(OSVER),amazonlinux2023)
MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-17-amazon-corretto --lib-path=/usr/lib/jvm/java-17-amazon-corretto/lib --jars=/usr/share/unit-jsc-common/
-else ifeq ($(OSVER),fedora39)
+else ifneq (,$(findstring $(OSVER),fedora40 fedora41))
MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-17-openjdk --lib-path=/usr/lib/jvm/java-17-openjdk/lib --jars=/usr/share/unit-jsc-common/
else
MODULE_CONFARGS_jsc_common= java --home=/usr/lib/jvm/java-1.8.0 --lib-path=/usr/lib/jvm/jre-1.8.0/lib/$(JAVA_ARCH_jsc_common) --jars=/usr/share/unit-jsc-common/
@@ -21,7 +21,7 @@ MODULE_SOURCES_jsc_common= COPYRIGHT.unit-jsc-common
ifeq ($(OSVER),amazonlinux2023)
BUILD_DEPENDS_jsc_common= java-17-amazon-corretto-devel curl
-else ifeq ($(OSVER),fedora39)
+else ifneq (,$(findstring $(OSVER),fedora40 fedora41))
BUILD_DEPENDS_jsc_common= java-17-openjdk-devel curl
else
BUILD_DEPENDS_jsc_common= java-1.8.0-openjdk-devel curl
diff --git a/pkg/rpm/Makefile.jsc17 b/pkg/rpm/Makefile.jsc17
index 9a42c5a1..f22fbd24 100644
--- a/pkg/rpm/Makefile.jsc17
+++ b/pkg/rpm/Makefile.jsc17
@@ -8,7 +8,7 @@ MODULE_RELEASE_jsc17= 1
ifeq ($(OSVER),amazonlinux2023)
MODULE_CONFARGS_jsc17= java --module=java17 --home=/usr/lib/jvm/java-17-amazon-corretto --lib-path=/usr/lib/jvm/java-17-amazon-corretto/lib --jars=/usr/share/unit-jsc-common/
-else ifeq ($(OSVER),fedora39)
+else ifneq (,$(findstring $(OSVER),fedora40 fedora41))
MODULE_CONFARGS_jsc17= java --module=java17 --home=/usr/lib/jvm/java-17-openjdk --lib-path=/usr/lib/jvm/java-17-openjdk/lib --jars=/usr/share/unit-jsc-common/
endif
MODULE_MAKEARGS_jsc17= java17
@@ -19,7 +19,7 @@ MODULE_SOURCES_jsc17= unit.example-jsc-app \
ifeq ($(OSVER),amazonlinux2023)
BUILD_DEPENDS_jsc17= java-17-amazon-corretto-devel
-else ifeq ($(OSVER),fedora39)
+else ifneq (,$(findstring $(OSVER),fedora40 fedora41))
BUILD_DEPENDS_jsc17= java-17-openjdk-devel
BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc17)
endif
diff --git a/pkg/rpm/Makefile.jsc21 b/pkg/rpm/Makefile.jsc21
new file mode 100644
index 00000000..6b28a030
--- /dev/null
+++ b/pkg/rpm/Makefile.jsc21
@@ -0,0 +1,69 @@
+MODULES+= jsc21
+MODULE_SUFFIX_jsc21= jsc21
+
+MODULE_SUMMARY_jsc21= Java 21 module for NGINX Unit
+
+MODULE_VERSION_jsc21= $(VERSION)
+MODULE_RELEASE_jsc21= 1
+
+MODULE_CONFARGS_jsc21= java --module=java21 --home=/usr/lib/jvm/java-21-openjdk --lib-path=/usr/lib/jvm/java-21-openjdk/lib --jars=/usr/share/unit-jsc-common/
+MODULE_MAKEARGS_jsc21= java21
+MODULE_INSTARGS_jsc21= java21-install
+
+MODULE_SOURCES_jsc21= unit.example-jsc-app \
+ unit.example-jsc21-config
+
+BUILD_DEPENDS_jsc21= java-21-openjdk-devel
+
+define MODULE_DEFINITIONS_jsc21
+Requires: unit-jsc-common == $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)%{?dist}.ngx
+Requires: java-21-openjdk-headless
+endef
+export MODULE_DEFINITIONS_jsc21
+
+define MODULE_PREINSTALL_jsc21
+%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-jsc21/examples/jsc-app
+%{__install} -m 644 -p %{SOURCE100} \
+ %{buildroot}%{_datadir}/doc/unit-jsc21/examples/jsc-app/index.jsp
+%{__install} -m 644 -p %{SOURCE101} \
+ %{buildroot}%{_datadir}/doc/unit-jsc21/examples/unit.config
+%{__install} -m 644 -p %{bdir}/src/java/README.JSR-340 \
+ %{buildroot}%{_datadir}/doc/unit-jsc21/
+endef
+export MODULE_PREINSTALL_jsc21
+
+define MODULE_POSTINSTALL_jsc21
+DESTDIR=%{buildroot} make java-shared-uninstall
+endef
+export MODULE_POSTINSTALL_jsc21
+
+define MODULE_FILES_jsc21
+%{_libdir}/unit/modules/*
+%{_libdir}/unit/debug-modules/*
+%dir %{_datadir}/doc/unit-jsc21
+%{_datadir}/doc/unit-jsc21/*
+%{_datadir}/unit-jsc-common/*
+endef
+export MODULE_FILES_jsc21
+
+define MODULE_POST_jsc21
+cat <<BANNER
+----------------------------------------------------------------------
+
+The $(MODULE_SUMMARY_jsc21) has been installed.
+
+To check out the sample app, run these commands:
+
+ sudo service unit restart
+ cd /usr/share/doc/%{name}/examples
+ sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
+ curl http://localhost:8800/
+
+Online documentation is available at https://unit.nginx.org
+
+`cat /usr/share/doc/unit-jsc21/README.JSR-340`
+
+----------------------------------------------------------------------
+BANNER
+endef
+export MODULE_POST_jsc21
diff --git a/pkg/rpm/Makefile.python313 b/pkg/rpm/Makefile.python313
new file mode 100644
index 00000000..84d7c4e6
--- /dev/null
+++ b/pkg/rpm/Makefile.python313
@@ -0,0 +1,53 @@
+MODULES+= python313
+MODULE_SUFFIX_python313= python3.13
+
+MODULE_SUMMARY_python313= Python 3.13 module for NGINX Unit
+
+MODULE_VERSION_python313= $(VERSION)
+MODULE_RELEASE_python313= 1
+
+MODULE_CONFARGS_python313= python --config=python3.13-config
+MODULE_MAKEARGS_python313= python3.13
+MODULE_INSTARGS_python313= python3.13-install
+
+MODULE_SOURCES_python313= unit.example-python-app \
+ unit.example-python313-config
+
+BUILD_DEPENDS_python313= python3-devel
+
+BUILD_DEPENDS+= $(BUILD_DEPENDS_python313)
+
+define MODULE_PREINSTALL_python313
+%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python313/examples/python-app
+%{__install} -m 644 -p %{SOURCE100} \
+ %{buildroot}%{_datadir}/doc/unit-python313/examples/python-app/wsgi.py
+%{__install} -m 644 -p %{SOURCE101} \
+ %{buildroot}%{_datadir}/doc/unit-python313/examples/unit.config
+endef
+export MODULE_PREINSTALL_python313
+
+define MODULE_FILES_python313
+%{_libdir}/unit/modules/*
+%{_libdir}/unit/debug-modules/*
+endef
+export MODULE_FILES_python313
+
+define MODULE_POST_python313
+cat <<BANNER
+----------------------------------------------------------------------
+
+The $(MODULE_SUMMARY_python313) has been installed.
+
+To check the sample app, run these commands:
+
+ sudo service unit start
+ cd /usr/share/doc/%{name}/examples
+ sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
+ curl http://localhost:8400/
+
+Online documentation is available at https://unit.nginx.org
+
+----------------------------------------------------------------------
+BANNER
+endef
+export MODULE_POST_python313
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config
new file mode 100644
index 00000000..a20cff8f
--- /dev/null
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config
@@ -0,0 +1,15 @@
+{
+ "applications": {
+ "example_java21": {
+ "processes": 1,
+ "type": "java 21",
+ "webapp": "/usr/share/doc/unit-jsc21/examples/jsc-app"
+ }
+ },
+
+ "listeners": {
+ "*:8800": {
+ "pass": "applications/example_java21"
+ }
+ }
+}
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config
new file mode 100644
index 00000000..c9d545cc
--- /dev/null
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config
@@ -0,0 +1,16 @@
+{
+ "applications": {
+ "example_python": {
+ "type": "python 3.13",
+ "processes": 2,
+ "path": "/usr/share/doc/unit-python313/examples/python-app",
+ "module": "wsgi"
+ }
+ },
+
+ "listeners": {
+ "*:8400": {
+ "pass": "applications/example_python"
+ }
+ }
+}