summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/Makefile48
-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
-rw-r--r--pkg/rpm/unit.spec.in20
8 files changed, 208 insertions, 21 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index f00b336a..fed2d290 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 \
@@ -109,7 +122,8 @@ CONFIGURE_ARGS_COMMON=\
CONFIGURE_ARGS=\
$(CONFIGURE_ARGS_COMMON) \
- --njs
+ --njs \
+ --otel
export CR=\\n
@@ -174,8 +188,9 @@ rpmbuild/SOURCES/unit-$(VERSION).tar.gz:
unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
@echo "===> Building $@ package" ; \
+ BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \
rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/unit.spec && \
- ln -s rpmbuild/BUILD/$@-$(VERSION)/build $@
+ ln -s $$BUILDROOT/$@-$(VERSION)/build $@
rpmlint:
find rpmbuild/ -name "*.rpm" -print -exec rpmlint {} \;
@@ -227,29 +242,34 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
unit-%: check-build-depends-% rpmbuild/SPECS/unit-%.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
@echo "===> Building $(subst _,-,$@) package" ; \
+ BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/$@.spec | grep ^bdir= | cut -d'=' -f 2` ; \
rpmbuild -D "_topdir `pwd`/rpmbuild" -ba --noclean rpmbuild/SPECS/$@.spec && \
- ln -s rpmbuild/BUILD/$(subst _,-,$@)-$(VERSION)/build $@
+ ln -s $$BUILDROOT/$(subst _,-,$@)-$(VERSION)/build $@
test: unit modules
@{ \
- for so in `find rpmbuild/BUILD/*/build-nodebug/ -type f \( -name "*.so" -o -name "*.jar" \)`; do \
+ BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \
+ NODEBUGS=`find rpmbuild/BUILD -type d -name "build-nodebug"` ; \
+ for so in `find $${NODEBUGS} -type f \( -name "*.so" -o -name "*.jar" \)`; do \
soname=`basename $${so}` ; \
test "$${soname}" = "java.unit.so" && continue ; \
- test -h rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} || \
- ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} ; \
+ test -h $$BUILDROOT/unit-$(VERSION)/build-nodebug/$${soname} || \
+ ln -fs `pwd`/$${so} $$BUILDROOT/unit-$(VERSION)/build-nodebug/$${soname} ; \
done ; \
- ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \
+ ( cd $$BUILDROOT/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \
}
test-debug: unit modules
@{ \
- for so in `find rpmbuild/BUILD/*/build-debug/ -type f \( -name "*.so" -o -name "*.jar" \)`; do \
+ BUILDROOT=`rpmbuild -bc --short-circuit -D "_topdir \`pwd\`/rpmbuild" -D "__spec_build_pre echo bdir=%{_builddir}; exit 0" rpmbuild/SPECS/unit.spec | grep ^bdir= | cut -d'=' -f 2` ; \
+ DEBUGS=`find rpmbuild/BUILD -type d -name "build-debug"` ; \
+ for so in `find $$DEBUGS -type f \( -name "*.so" -o -name "*.jar" \)`; do \
soname=`basename $${so}` ; \
test "$${soname}" = "java.unit.so" && continue ; \
- test -h rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} || \
- ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} ; \
+ test -h $$BUILDROOT/unit-$(VERSION)/build-debug/$${soname} || \
+ ln -fs `pwd`/$${so} $$BUILDROOT/unit-$(VERSION)/build-debug/$${soname} ; \
done ; \
- ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \
+ ( cd $$BUILDROOT/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \
}
clean:
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"
+ }
+ }
+}
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 9360ff7e..fc3feb14 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -76,6 +76,13 @@ Library and include files required for NGINX Unit modules development.
%build
%{__make} %{?_smp_mflags} -C pkg/contrib .njs
+# openssl-sys rust crate doesnt detect openssl11.pc in Amazon Linux 2, so needs
+# a bit of a helping hand.
+%if (0%{?amzn2})
+export OPENSSL_LIB_DIR=%_libdir
+export OPENSSL_INCLUDE_DIR=%_includedir
+%endif
+
PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
./configure \
%{CONFIGURE_ARGS} \
@@ -84,7 +91,7 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
--cc-opt="%{CC_OPT}" \
--ld-opt="%{LD_OPT}" \
--debug
-%{__make} %{?_smp_mflags}
+%{__make} %{?_smp_mflags} E=0
%{__make} %{?_smp_mflags} build/lib/libunit.a
%{__mv} build build-debug
@@ -95,7 +102,7 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
--libdir=%{_libdir} \
--cc-opt="%{CC_OPT}" \
--ld-opt="%{LD_OPT}"
-%{__make} %{?_smp_mflags}
+%{__make} %{?_smp_mflags} E=0
%{__mv} build build-nodebug
%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2})
@@ -103,8 +110,15 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
%endif
%install
+# openssl-sys rust crate doesnt detect openssl11.pc in Amazon Linux 2, so needs
+# a bit of a helping hand.
+%if (0%{?amzn2})
+export OPENSSL_LIB_DIR=%_libdir
+export OPENSSL_INCLUDE_DIR=%_includedir
+%endif
+
%{__ln_s} build-nodebug build
-DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
+DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install E=0
%{__mkdir} -p %{buildroot}%{_bindir}
%{__install} -m755 %{bdir}/tools/unitc \
%{buildroot}%{_bindir}/unitc