From 1251b41aa2df6e4290d4763bf0a5f94cb3edb475 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 21 Nov 2024 18:32:28 -0800 Subject: [PATCH] Packages: added Fedora 41 support. While at it, removed support for Fedora 39 as it's EOL. --- pkg/rpm/Makefile | 19 ++++- pkg/rpm/Makefile.jsc-common | 4 +- pkg/rpm/Makefile.jsc17 | 4 +- pkg/rpm/Makefile.jsc21 | 69 +++++++++++++++++++ pkg/rpm/Makefile.python313 | 53 ++++++++++++++ .../SOURCES/unit.example-jsc21-config | 15 ++++ .../SOURCES/unit.example-python313-config | 16 +++++ 7 files changed, 173 insertions(+), 7 deletions(-) create mode 100644 pkg/rpm/Makefile.jsc21 create mode 100644 pkg/rpm/Makefile.python313 create mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config create mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index f00b336a9..5bb3ef116 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 f77ca1e9f..ebea404f7 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 9a42c5a14..f22fbd246 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 000000000..6b28a0308 --- /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 <