Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages: added Fedora 41 support. #1496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions pkg/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpm/Makefile.jsc-common
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpm/Makefile.jsc17
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
69 changes: 69 additions & 0 deletions pkg/rpm/Makefile.jsc21
Original file line number Diff line number Diff line change
@@ -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
53 changes: 53 additions & 0 deletions pkg/rpm/Makefile.python313
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions pkg/rpm/rpmbuild/SOURCES/unit.example-jsc21-config
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
16 changes: 16 additions & 0 deletions pkg/rpm/rpmbuild/SOURCES/unit.example-python313-config
Original file line number Diff line number Diff line change
@@ -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"
}
}
}