From 28c68421a89a402329f485873a8d63073e328213 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 20 May 2024 18:55:51 +0000 Subject: [PATCH 1/6] Packages: clean up EOL debian-based distributions --- pkg/deb/Makefile | 78 ------------------- pkg/deb/Makefile.jsc10 | 71 ----------------- pkg/deb/Makefile.jsc16 | 71 ----------------- pkg/deb/Makefile.jsc8 | 71 ----------------- pkg/deb/Makefile.python36 | 46 ----------- pkg/deb/Makefile.python37 | 46 ----------- pkg/deb/debian.module/copyright.unit-jsc8 | 42 ---------- .../debian.module/unit.example-jsc16-config | 15 ---- .../debian.module/unit.example-jsc8-config | 15 ---- .../unit.example-python3.6-config | 16 ---- .../unit.example-python3.7-config | 16 ---- 11 files changed, 487 deletions(-) delete mode 100644 pkg/deb/Makefile.jsc10 delete mode 100644 pkg/deb/Makefile.jsc16 delete mode 100644 pkg/deb/Makefile.jsc8 delete mode 100644 pkg/deb/Makefile.python36 delete mode 100644 pkg/deb/Makefile.python37 delete mode 100644 pkg/deb/debian.module/copyright.unit-jsc8 delete mode 100644 pkg/deb/debian.module/unit.example-jsc16-config delete mode 100644 pkg/deb/debian.module/unit.example-jsc8-config delete mode 100644 pkg/deb/debian.module/unit.example-python3.6-config delete mode 100644 pkg/deb/debian.module/unit.example-python3.7-config diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index a0c226e23..4e6ee8d96 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -36,38 +36,6 @@ include Makefile.jsc21 include Makefile.wasm endif -# Ubuntu 23.04 -ifeq ($(CODENAME),lunar) -include Makefile.php -include Makefile.python311 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc11 -include Makefile.jsc17 -include Makefile.jsc18 -include Makefile.jsc19 -include Makefile.jsc20 -include Makefile.wasm -endif - -# Ubuntu 22.10 -ifeq ($(CODENAME),kinetic) -include Makefile.php -include Makefile.python27 -include Makefile.python310 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc11 -include Makefile.jsc17 -include Makefile.jsc18 -include Makefile.jsc19 -include Makefile.wasm -endif - # Ubuntu 22.04 ifeq ($(CODENAME),jammy) include Makefile.php @@ -83,23 +51,6 @@ include Makefile.jsc18 include Makefile.wasm endif -# Ubuntu 21.10 -ifeq ($(CODENAME),impish) -include Makefile.php -include Makefile.python27 -include Makefile.python39 -include Makefile.python310 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc11 -include Makefile.jsc16 -include Makefile.jsc17 -include Makefile.jsc18 -include Makefile.wasm -endif - # Ubuntu 20.04 ifeq ($(CODENAME),focal) include Makefile.php @@ -113,22 +64,6 @@ include Makefile.jsc11 include Makefile.wasm endif -# Ubuntu 18.04 -ifeq ($(CODENAME),bionic) -include Makefile.php -include Makefile.python27 -include Makefile.python36 -include Makefile.python37 -include Makefile.python38 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc8 -include Makefile.jsc11 -include Makefile.wasm -endif - # Debian 12 ifeq ($(CODENAME),bookworm) include Makefile.php @@ -154,19 +89,6 @@ include Makefile.jsc11 include Makefile.wasm endif -# Debian 10 -ifeq ($(CODENAME),buster) -include Makefile.php -include Makefile.python27 -include Makefile.python37 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc11 -include Makefile.wasm -endif - CONFIGURE_ARGS_COMMON=\ --prefix=/usr \ --statedir=/var/lib/unit \ diff --git a/pkg/deb/Makefile.jsc10 b/pkg/deb/Makefile.jsc10 deleted file mode 100644 index 43ded86be..000000000 --- a/pkg/deb/Makefile.jsc10 +++ /dev/null @@ -1,71 +0,0 @@ -MODULES+= jsc10 -MODULE_SUFFIX_jsc10= jsc10 - -MODULE_SUMMARY_jsc10= Java 10 module for NGINX Unit - -MODULE_VERSION_jsc10= $(VERSION) -MODULE_RELEASE_jsc10= 1 - -MODULE_CONFARGS_jsc10= java --module=java10 --home=/usr/lib/jvm/java-11-openjdk-$$\(DEB_HOST_ARCH\) --jars=/usr/share/unit-jsc-common/ -MODULE_MAKEARGS_jsc10= java10 -MODULE_INSTARGS_jsc10= java10-install - -MODULE_SOURCES_jsc10= unit.example-jsc-app \ - unit.example-jsc10-config - -BUILD_DEPENDS_jsc10= openjdk-11-jdk-headless openjdk-11-jre-headless -BUILD_DEPENDS+= $(BUILD_DEPENDS_jsc10) - -MODULE_BUILD_DEPENDS_jsc10=,openjdk-11-jdk-headless -MODULE_DEPENDS_jsc10=,openjdk-11-jre-headless,unit-jsc-common (= $(MODULE_VERSION_jsc_common)-$(MODULE_RELEASE_jsc_common)~$(CODENAME)) - -define MODULE_PREINSTALL_jsc10 - mkdir -p debian/unit-jsc10/usr/share/doc/unit-jsc10/examples/jsc-app - install -m 644 -p debian/unit.example-jsc-app debian/unit-jsc10/usr/share/doc/unit-jsc10/examples/jsc-app/index.jsp - install -m 644 -p debian/unit.example-jsc10-config debian/unit-jsc10/usr/share/doc/unit-jsc10/examples/unit.config - install -m 644 -p src/java/README.JSR-340 debian/unit-jsc10/usr/share/doc/unit-jsc10/ -endef -export MODULE_PREINSTALL_jsc10 - -define MODULE_POSTINSTALL_jsc10 - cd $$\(BUILDDIR_unit\) \&\& \ - DESTDIR=$$\(INSTALLDIR\) make java-shared-uninstall -endef -export MODULE_POSTINSTALL_jsc10 - -define MODULE_POST_jsc10 -cat < Date: Mon, 20 May 2024 18:56:34 +0000 Subject: [PATCH 2/6] Packages: added Ubuntu 24.04 "noble" support --- pkg/deb/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index 4e6ee8d96..a930b9fd0 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -19,6 +19,20 @@ BUILD_DEPENDS = $(BUILD_DEPENDS_unit) MODULES= +# Ubuntu 24.04 +ifeq ($(CODENAME),noble) +include Makefile.php +include Makefile.python312 +include Makefile.go +include Makefile.perl +include Makefile.ruby +include Makefile.jsc-common +include Makefile.jsc11 +include Makefile.jsc17 +include Makefile.jsc21 +include Makefile.wasm +endif + # Ubuntu 23.10 ifeq ($(CODENAME),mantic) include Makefile.php From 50914dac30e9ea3d4511da3f413ae15224b89c6f Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 20 May 2024 19:03:33 +0000 Subject: [PATCH 3/6] Packages: don't redefine FORTIFY_SOURCE on Ubuntu The default on Ubuntu 24.04 and newer is now -D_FORTIFY_SOURCE=3 which clashes with our definition. We shouldnt be setting it for Ubuntus anyway since _FORTIFY_SOURCE=2 for older distros is already handled by the defaults in their gcc builds. --- pkg/deb/debian.module/rules-noarch.in | 7 ++++++- pkg/deb/debian.module/rules.in | 7 ++++++- pkg/deb/debian/rules.in | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pkg/deb/debian.module/rules-noarch.in b/pkg/deb/debian.module/rules-noarch.in index e56e06bc8..f311438df 100644 --- a/pkg/deb/debian.module/rules-noarch.in +++ b/pkg/deb/debian.module/rules-noarch.in @@ -3,8 +3,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie +include /usr/share/dpkg/vendor.mk +ifeq ($(shell $(call dpkg_vendor_derives_from,ubuntu)),yes) +export DEB_CFLAGS_MAINT_APPEND=-fPIC +else export DEB_CFLAGS_MAINT_APPEND=-Wp,-D_FORTIFY_SOURCE=2 -fPIC +endif +export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk diff --git a/pkg/deb/debian.module/rules.in b/pkg/deb/debian.module/rules.in index 7814fbfd3..8877ff235 100755 --- a/pkg/deb/debian.module/rules.in +++ b/pkg/deb/debian.module/rules.in @@ -3,8 +3,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie +include /usr/share/dpkg/vendor.mk +ifeq ($(shell $(call dpkg_vendor_derives_from,ubuntu)),yes) +export DEB_CFLAGS_MAINT_APPEND=-fPIC +else export DEB_CFLAGS_MAINT_APPEND=-Wp,-D_FORTIFY_SOURCE=2 -fPIC +endif +export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk diff --git a/pkg/deb/debian/rules.in b/pkg/deb/debian/rules.in index 55a4ebecb..dd75b562d 100644 --- a/pkg/deb/debian/rules.in +++ b/pkg/deb/debian/rules.in @@ -3,8 +3,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie +include /usr/share/dpkg/vendor.mk +ifeq ($(shell $(call dpkg_vendor_derives_from,ubuntu)),yes) +export DEB_CFLAGS_MAINT_APPEND=-fPIC +else export DEB_CFLAGS_MAINT_APPEND=-Wp,-D_FORTIFY_SOURCE=2 -fPIC +endif +export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed -pie DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk From 05a2e0248b23561f7a874d5b9812a797057ce576 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 20 May 2024 12:52:02 -0700 Subject: [PATCH 4/6] Packages: remove support for EOL Fedora versions (35-38) --- pkg/rpm/Makefile | 28 --------- pkg/rpm/Makefile.python27 | 2 +- pkg/rpm/Makefile.python310 | 57 ------------------- pkg/rpm/Makefile.python311 | 4 -- pkg/rpm/Makefile.python36 | 2 +- pkg/rpm/Makefile.python37 | 2 +- pkg/rpm/Makefile.python39 | 2 +- .../SOURCES/unit.example-python310-config | 16 ------ 8 files changed, 4 insertions(+), 109 deletions(-) delete mode 100644 pkg/rpm/Makefile.python310 delete mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.example-python310-config diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 5d28fb2c5..dad76e833 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -20,10 +20,6 @@ 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 35 -a 0%{?fedora} -le 36'`; echo $$?),0) -OSVER = fedora -else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 37 -a 0%{?fedora} -le 38'`; echo $$?),0) -OSVER = fedora37 else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 39'`; echo $$?),0) OSVER = fedora39 endif @@ -102,30 +98,6 @@ include Makefile.jsc17 include Makefile.wasm endif -ifeq ($(OSVER), fedora) -include Makefile.php -include Makefile.python310 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc8 -include Makefile.jsc11 -include Makefile.wasm -endif - -ifeq ($(OSVER), fedora37) -include Makefile.php -include Makefile.python311 -include Makefile.go -include Makefile.perl -include Makefile.ruby -include Makefile.jsc-common -include Makefile.jsc8 -include Makefile.jsc11 -include Makefile.wasm -endif - ifeq ($(OSVER), fedora39) include Makefile.php include Makefile.python312 diff --git a/pkg/rpm/Makefile.python27 b/pkg/rpm/Makefile.python27 index 3de5f6343..1d59b81df 100644 --- a/pkg/rpm/Makefile.python27 +++ b/pkg/rpm/Makefile.python27 @@ -13,7 +13,7 @@ MODULE_INSTARGS_python27= python2.7-install MODULE_SOURCES_python27= unit.example-python-app \ unit.example-python27-config -ifneq (,$(findstring $(OSVER),fedora centos8)) +ifneq (,$(findstring $(OSVER),centos8)) BUILD_DEPENDS_python27= python2-devel else ifneq (,$(findstring $(OSVER),centos7 amazonlinux2)) BUILD_DEPENDS_python27= python-devel diff --git a/pkg/rpm/Makefile.python310 b/pkg/rpm/Makefile.python310 deleted file mode 100644 index 507314756..000000000 --- a/pkg/rpm/Makefile.python310 +++ /dev/null @@ -1,57 +0,0 @@ -MODULES+= python310 -MODULE_SUFFIX_python310= python3.10 - -MODULE_SUMMARY_python310= Python 3.10 module for NGINX Unit - -MODULE_VERSION_python310= $(VERSION) -MODULE_RELEASE_python310= 1 - -MODULE_CONFARGS_python310= python --config=python3.10-config -MODULE_MAKEARGS_python310= python3.10 -MODULE_INSTARGS_python310= python3.10-install - -MODULE_SOURCES_python310= unit.example-python-app \ - unit.example-python310-config - -ifneq (,$(findstring $(OSVER),fedora amazonlinux2)) -BUILD_DEPENDS_python310= python3-devel -else -BUILD_DEPENDS_python310= python310-devel -endif - -BUILD_DEPENDS+= $(BUILD_DEPENDS_python310) - -define MODULE_PREINSTALL_python310 -%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python310/examples/python-app -%{__install} -m 644 -p %{SOURCE100} \ - %{buildroot}%{_datadir}/doc/unit-python310/examples/python-app/wsgi.py -%{__install} -m 644 -p %{SOURCE101} \ - %{buildroot}%{_datadir}/doc/unit-python310/examples/unit.config -endef -export MODULE_PREINSTALL_python310 - -define MODULE_FILES_python310 -%{_libdir}/unit/modules/* -%{_libdir}/unit/debug-modules/* -endef -export MODULE_FILES_python310 - -define MODULE_POST_python310 -cat < Date: Tue, 18 Jun 2024 09:41:15 -0700 Subject: [PATCH 5/6] Packages: removed CentOS 6 leftover --- pkg/rpm/Makefile.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/rpm/Makefile.go b/pkg/rpm/Makefile.go index aacbe2b99..335b207a3 100644 --- a/pkg/rpm/Makefile.go +++ b/pkg/rpm/Makefile.go @@ -13,11 +13,7 @@ MODULE_INSTARGS_go= go-install-src MODULE_SOURCES_go= unit.example-go-app \ unit.example-go-config -ifeq ($(OSVER), centos6) -BUILD_DEPENDS_go= epel-release golang -else BUILD_DEPENDS_go= golang -endif BUILD_DEPENDS+= $(BUILD_DEPENDS_go) From 8b5e2e17b9431912d7f12df44c5256e585bf6971 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 18 Jun 2024 09:50:47 -0700 Subject: [PATCH 6/6] Packages: removed CentOS 7 due to EOL --- pkg/rpm/Makefile | 19 +------------------ pkg/rpm/Makefile.python27 | 4 ++-- pkg/rpm/Makefile.python36 | 4 ---- pkg/rpm/unit.module.spec.in | 4 ---- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index dad76e833..f00b336a9 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -10,9 +10,7 @@ RELEASE ?= $(DEFAULT_RELEASE) PACKAGE_VENDOR = NGINX Packaging -ifeq ($(shell test `rpm --eval '0%{?rhel} -eq 7 -a 0%{?amzn} -eq 0'`; echo $$?), 0) -OSVER = centos7 -else ifeq ($(shell rpm --eval "%{?rhel}"), 8) +ifeq ($(shell rpm --eval "%{?rhel}"), 8) OSVER = centos8 else ifeq ($(shell rpm --eval "%{?rhel}"), 9) OSVER = centos9 @@ -26,10 +24,6 @@ endif BUILD_DEPENDS_unit = gcc rpm-build rpmlint clang llvm -ifeq ($(OSVER), centos7) -BUILD_DEPENDS_unit += which -endif - ifneq (,$(findstring $(OSVER),amazonlinux2)) BUILD_DEPENDS_unit += libxml2 libxslt openssl11-devel else @@ -40,17 +34,6 @@ BUILD_DEPENDS = $(BUILD_DEPENDS_unit) MODULES= -ifeq ($(OSVER), centos7) -include Makefile.php -include Makefile.python27 -include Makefile.python36 -include Makefile.go -include Makefile.perl -include Makefile.jsc-common -include Makefile.jsc8 -include Makefile.jsc11 -endif - ifeq ($(OSVER), centos8) include Makefile.php include Makefile.python27 diff --git a/pkg/rpm/Makefile.python27 b/pkg/rpm/Makefile.python27 index 1d59b81df..aeb1248f4 100644 --- a/pkg/rpm/Makefile.python27 +++ b/pkg/rpm/Makefile.python27 @@ -15,7 +15,7 @@ MODULE_SOURCES_python27= unit.example-python-app \ ifneq (,$(findstring $(OSVER),centos8)) BUILD_DEPENDS_python27= python2-devel -else ifneq (,$(findstring $(OSVER),centos7 amazonlinux2)) +else ifneq (,$(findstring $(OSVER),amazonlinux2)) BUILD_DEPENDS_python27= python-devel else BUILD_DEPENDS_python27= python27-devel @@ -24,7 +24,7 @@ endif BUILD_DEPENDS+= $(BUILD_DEPENDS_python27) define MODULE_DEFINITIONS_python27 -%if (0%{?rhel} == 7) || (0%{?amzn} == 2) +%if 0%{?amzn} == 2 Obsoletes: unit-python %endif endef diff --git a/pkg/rpm/Makefile.python36 b/pkg/rpm/Makefile.python36 index a9a97c9fe..7019b8195 100644 --- a/pkg/rpm/Makefile.python36 +++ b/pkg/rpm/Makefile.python36 @@ -13,11 +13,7 @@ MODULE_INSTARGS_python36= python3.6-install MODULE_SOURCES_python36= unit.example-python-app \ unit.example-python36-config -ifneq (,$(findstring $(OSVER),centos7)) -BUILD_DEPENDS_python36= python3-devel -else BUILD_DEPENDS_python36= python36-devel -endif BUILD_DEPENDS+= $(BUILD_DEPENDS_python36) diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in index a1deaeb2c..7d1d1b0ea 100644 --- a/pkg/rpm/unit.module.spec.in +++ b/pkg/rpm/unit.module.spec.in @@ -1,10 +1,6 @@ # distribution specific definitions %define bdir %{_builddir}/%{name}-%{version} -%if (0%{?rhel} == 7 && 0%{?amzn} == 0) -%define dist .el7 -%endif - %%MODULE_DEFINITIONS%% %if 0%{?rhel}%{?fedora}