From 8fc16a77d511a4f0c00d0b0d24e575fe7673e4c8 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 17 May 2024 15:07:20 -0700 Subject: Packaging: added missing build dependencies to Makefiles Forgotten in bf3d5759e and 260494626. --- pkg/deb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index 8bfe6c19..beae5120 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -14,7 +14,7 @@ SRCDIR= unit-$(VERSION) CODENAME = $(shell lsb_release -cs) -BUILD_DEPENDS_unit = build-essential debhelper devscripts fakeroot libxml2-utils lintian lsb-release xsltproc libssl-dev +BUILD_DEPENDS_unit = build-essential debhelper devscripts fakeroot libxml2-utils lintian lsb-release xsltproc libssl-dev clang llvm BUILD_DEPENDS = $(BUILD_DEPENDS_unit) MODULES= -- cgit From f281207f9ea5e457111109729dcc9e6ab65aa573 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Fri, 17 May 2024 16:49:39 -0700 Subject: Packaging: fix build-depends detection on debian-based systems dpkg-query -W will show information about the package if any other package references it, even when the queried package is not installed. The fix is to query for an actual status of a needed build dependency. --- pkg/deb/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index beae5120..a0c226e2 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -203,8 +203,8 @@ check-build-depends-%: esac ; \ not_installed= ; \ for pkg in $${pkgs}; do \ - dpkg-query -W $${pkg} >/dev/null 2>&1 ; \ - if [ $$? -ne 0 ]; then \ + i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg} 2>/dev/null) ; \ + if [ $$? -ne 0 -o "$${i}" != "installed" ]; then \ not_installed="$${not_installed} $${pkg}" ; \ fi ; \ done ; \ -- cgit From 0bd18ecd715b3461b848ce31289349de8e765d9c Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 20 May 2024 18:55:51 +0000 Subject: 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 ------------ pkg/deb/debian.module/unit.example-jsc16-config | 15 ----- pkg/deb/debian.module/unit.example-jsc8-config | 15 ----- .../debian.module/unit.example-python3.6-config | 16 ----- .../debian.module/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 (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index a0c226e2..4e6ee8d9 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 43ded86b..00000000 --- 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: Packages: added Ubuntu 24.04 "noble" support --- pkg/deb/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index 4e6ee8d9..a930b9fd 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 -- cgit From 6c04c7dc98a5179d24dec1f933b93fc6fd5b59df Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 20 May 2024 19:03:33 +0000 Subject: 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(-) (limited to 'pkg/deb') diff --git a/pkg/deb/debian.module/rules-noarch.in b/pkg/deb/debian.module/rules-noarch.in index e56e06bc..f311438d 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 7814fbfd..8877ff23 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 55a4ebec..dd75b562 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 -- cgit From 5d32e500b7dc70ec831540ee00b1316336379060 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 17 Jun 2024 20:08:49 +0000 Subject: Packaging: fix build-depends on multiarch debian systems It's possible to have two versions of the same package installed on debian-based multiarch systems - e.g. i386 alongside amd64. This means that when getting the package status through dpkg-query we'd get a duplicated string: % dpkg-query -f '$${db:Status-Status}' -W libssl-dev $installed$installed % dpkg -l | grep libssl-dev ii libssl-dev:amd64 3.0.11-1~deb12u2 amd64 Secure Sockets Layer toolkit - development files ii libssl-dev:i386 3.0.11-1~deb12u2 i386 Secure Sockets Layer toolkit - development files The fix is to explicitely check for the main architecture and, in case for noarch (or rather all-arch in debian terms) packages, check for special :all architecture as well. --- pkg/deb/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile b/pkg/deb/Makefile index a930b9fd..fadc96a8 100644 --- a/pkg/deb/Makefile +++ b/pkg/deb/Makefile @@ -139,9 +139,12 @@ check-build-depends-%: esac ; \ not_installed= ; \ for pkg in $${pkgs}; do \ - i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg} 2>/dev/null) ; \ + i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg}:$$(dpkg --print-architecture) 2>/dev/null) ; \ if [ $$? -ne 0 -o "$${i}" != "installed" ]; then \ - not_installed="$${not_installed} $${pkg}" ; \ + i=$$(dpkg-query -f '$${db:Status-Status}' -W $${pkg}:all 2>/dev/null) ; \ + if [ $$? -ne 0 -o "$${i}" != "installed" ]; then \ + not_installed="$${not_installed} $${pkg}" ; \ + fi; \ fi ; \ done ; \ if test -n "$${not_installed}" ; then \ -- cgit From 9998918dbbc52c279b9c74cc34f6c67f6cdba1df Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Thu, 5 Sep 2024 20:22:14 +0000 Subject: Packages: bump wasmtime to 24.0.0 and wasi-sysroot to 24.0. Wasm module is now not built for Amazon Linux 2, Debian 11 and Ubuntu 2.0.04, since it requires cmake version newer than what's available on those OSes. wasm-wasi-component is not affected. --- pkg/deb/Makefile.wasm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'pkg/deb') diff --git a/pkg/deb/Makefile.wasm b/pkg/deb/Makefile.wasm index 8f3fdc67..de89841e 100644 --- a/pkg/deb/Makefile.wasm +++ b/pkg/deb/Makefile.wasm @@ -6,14 +6,19 @@ MODULE_SUMMARY_wasm= WASM module for NGINX Unit MODULE_VERSION_wasm= $(VERSION) MODULE_RELEASE_wasm= 1 -MODULE_CONFARGS_wasm= wasm --include-path=\$$(CURDIR)/pkg/contrib/wasmtime/crates/c-api/include --lib-path=\$$(CURDIR)/pkg/contrib/wasmtime/target/release \&\& ./configure wasm-wasi-component -MODULE_MAKEARGS_wasm= wasm wasm-wasi-component CFLAGS=\"\$$(shell grep ^CFLAGS \$$(BUILDDIR_\$$*)/build/Makefile | cut -d' ' -f 3-) -Wno-missing-prototypes\" -MODULE_INSTARGS_wasm= wasm-install wasm-wasi-component-install +MODULE_CONFARGS_wasm= wasm-wasi-component +MODULE_MAKEARGS_wasm= wasm-wasi-component CFLAGS=\"\$$(shell grep ^CFLAGS \$$(BUILDDIR_\$$*)/build/Makefile | cut -d' ' -f 3-) -Wno-missing-prototypes\" +MODULE_INSTARGS_wasm= wasm-wasi-component-install + +ifeq (,$(findstring $(CODENAME),bullseye focal)) +MODULE_CONFARGS_wasm+= \&\& ./configure wasm --include-path=\$$(CURDIR)/pkg/contrib/wasmtime/artifacts/include --lib-path=\$$(CURDIR)/pkg/contrib/wasmtime/artifacts/lib +MODULE_MAKEARGS_wasm+= wasm +MODULE_INSTARGS_wasm+= wasm-install MODULE_SOURCES_wasm= -BUILD_DEPENDS_wasm= -MODULE_BUILD_DEPENDS_wasm= +BUILD_DEPENDS_wasm= cmake +MODULE_BUILD_DEPENDS_wasm=,cmake MODULE_DEPENDS_wasm= BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm) @@ -29,9 +34,10 @@ export MODULE_PREINSTALL_wasm define MODULE_POSTINSTALL_wasm mkdir -p debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ - install -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ + install -m 755 -p pkg/contrib/wasmtime/artifacts/lib/libwasmtime.so debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ endef export MODULE_POSTINSTALL_wasm +endif define MODULE_POST_wasm cat <