diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:54:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:54:18 +0000 |
commit | 8e67fbf68ffeb9eb5f026dd482d73b021660bf9b (patch) | |
tree | bb573facd5d02096f9956b2617a722b88acaa8af /debian/signing-template.generate | |
parent | Adding upstream version 2.06. (diff) | |
download | grub2-8e67fbf68ffeb9eb5f026dd482d73b021660bf9b.tar.xz grub2-8e67fbf68ffeb9eb5f026dd482d73b021660bf9b.zip |
Adding debian version 2.06-3~deb11u6.debian/2.06-3_deb11u6debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/signing-template.generate')
-rwxr-xr-x | debian/signing-template.generate | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/debian/signing-template.generate b/debian/signing-template.generate new file mode 100755 index 0000000..4718eab --- /dev/null +++ b/debian/signing-template.generate @@ -0,0 +1,49 @@ +#!/bin/sh +set -e -u + +pkg_base="${1?:missing binary package name}" +pkg_unsigned="${pkg_base}-bin" +pkg_signed="${pkg_base}-signed" +pkg_tmpl="${pkg_signed}-template" + +distribution="$(dpkg-parsechangelog -S Distribution)" +urgency="$(dpkg-parsechangelog -S Urgency)" +date="$(dpkg-parsechangelog -S Date)" +version_binary="$(dpkg-parsechangelog -S Version)" +version_mangled="$(dpkg-parsechangelog -S Version | tr '-' '+')" + +subst () { + sed \ + -e "s/@pkg_unsigned@/${pkg_unsigned}/g" \ + -e "s/@pkg_signed@/${pkg_signed}/g" \ + -e "s/@pkg_tmpl@/${pkg_tmpl}/g" \ + -e "s/@efi@/${SB_EFI_NAME}/g" \ + -e "s/@efi_platform@/${SB_PLATFORM}/g" \ + -e "s/@arch@/${DEB_HOST_ARCH}/g" \ + -e "s/@version_binary@/${version_binary}/g" \ + -e "s/@version_mangled@/${version_mangled}/g" \ + -e "s/@distribution@/${distribution}/g" \ + -e "s/@urgency@/${urgency}/g" \ + -e "s/@date@/${date}/g" \ + "$@" +} + +template='./debian/signing-template' +pkg_dir="debian/${pkg_tmpl}/usr/share/code-signing/${pkg_tmpl}" +pkg_deb="${pkg_dir}/source-template/debian" + +install -m 0755 -d "${pkg_dir}" +subst < ./debian/signing-template.json.in > "${pkg_dir}/files.json" + +find "${template}" -type f -printf '%P\n' | +while read path +do + src="${template}/${path}" + dst="${pkg_deb}/${path}" + + install -m 0755 -d "${dst%/*}" + subst < "${src}" > "${dst%.in}" + chmod --reference="${src}" "${dst%.in}" +done + +exit 0 |