diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-09 12:02:01 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-09 12:02:01 +0200 |
commit | b1964b088ff7742a679f4c33116527f40389ef53 (patch) | |
tree | d0db83745c1e20984e6a363efef27676d1205eb7 | |
parent | 45dbab0463473e4650d9cd792673844a3e506551 (diff) |
Add --debian-maint-optionbindist
-rw-r--r-- | bpkg/pkg-bindist.cli | 9 | ||||
-rw-r--r-- | bpkg/system-package-manager-debian.cxx | 17 |
2 files changed, 25 insertions, 1 deletions
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 + { + "<o>", + "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 { "<o>", 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'; |