From b1964b088ff7742a679f4c33116527f40389ef53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Mar 2023 12:02:01 +0200 Subject: Add --debian-maint-option --- bpkg/pkg-bindist.cli | 9 +++++++++ bpkg/system-package-manager-debian.cxx | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/bpkg/pkg-bindist.cli b/bpkg/pkg-bindist.cli index c269355..dbbf9c3 100644 --- a/bpkg/pkg-bindist.cli +++ b/bpkg/pkg-bindist.cli @@ -104,6 +104,15 @@ namespace bpkg options, if any, are used as configured." } + strings --debian-maint-option + { + "", + "Alternative options to specify in the \cb{DEB_BUILD_MAINT_OPTIONS} + variable of the \cb{rules} file. To specify multiple maintainer options + repeat this option and/or specify them as a single value separated + with spaces." + } + strings --debian-build-option { "", diff --git a/bpkg/system-package-manager-debian.cxx b/bpkg/system-package-manager-debian.cxx index 9350a13..3037730 100644 --- a/bpkg/system-package-manager-debian.cxx +++ b/bpkg/system-package-manager-debian.cxx @@ -2708,9 +2708,24 @@ namespace bpkg // example, they also cover Assembler, Fortran, and potentially others // in the future). // + string mo; // Include leading space if not empty. + if (ops_->debian_maint_option_specified ()) + { + for (const string& o: ops_->debian_maint_option ()) + { + if (!o.empty ()) + { + mo += ' '; + mo += o; + } + } + } + else + mo = " hardening=+all"; + os << "# *FLAGS (CFLAGS, CXXFLAGS, etc)" << '\n' << "#" << '\n' - << "export DEB_BUILD_MAINT_OPTIONS := hardening=+all" << '\n' + << "export DEB_BUILD_MAINT_OPTIONS :=" << mo << '\n' << "include /usr/share/dpkg/buildflags.mk" << '\n' << '\n'; -- cgit v1.1