summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-03-13 19:06:37 +0000
committerSteve McIntyre <steve@einval.com>2021-03-23 23:32:45 +0000
commit2e0a83e1f2e1d1cf76a4082eb14dd7f9b11eda2d (patch)
tree59806e25b976a7318f8615e7852f5659177992f6 /debian/rules
parent58195ca37eab3e633c7d77c1581ed2d6ff20499c (diff)
downloadefi-boot-shim-2e0a83e1f2e1d1cf76a4082eb14dd7f9b11eda2d.tar.gz
efi-boot-shim-2e0a83e1f2e1d1cf76a4082eb14dd7f9b11eda2d.zip
Add Debian SBAT data to the shim build
Add a Debian SBAT template, and rules to use it Adds a build-dep on dos2unix
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules17
1 files changed, 15 insertions, 2 deletions
diff --git a/debian/rules b/debian/rules
index 00c5547e..0306a937 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,8 +15,12 @@ else
distributor=debian
endif
+deb_version := $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
+
DBX_LIST = dbx.esl
DBX_HASHES = debian/$(distributor)-dbx.hashes
+SBAT_IN = debian/sbat.$(distributor).csv.in
+SBAT_DATA = data/sbat.$(distributor).csv
include /usr/share/dpkg/architecture.mk
@@ -53,14 +57,23 @@ $(DBX_LIST): $(DBX_HASHES)
# Support an empty $(DBX_HASHES)
touch $@
+$(SBAT_DATA): $(SBAT_IN)
+ rm -f $@
+ set -e; \
+ sed -e "s/@DEB_VERSION@/$(deb_version)/g" \
+ -e "s/@UPSTREAM_VERSION@/$(plain_upstream_version)/g" \
+ < $(SBAT_IN) > $(SBAT_DATA)
+ # If we have an empty $(SBAT_DATA), delete
+ if [ ! -s $(SBAT_DATA) ]; then rm -f $(SBAT_DATA); fi
+
%:
dh $@
override_dh_auto_clean:
dh_auto_clean -- MAKELEVEL=0
- rm -f $(DBX_LIST)
+ rm -f $(DBX_LIST) $(SBAT_DATA) sbat.*.csv
-override_dh_auto_build: $(DBX_LIST)
+override_dh_auto_build: $(DBX_LIST) $(SBAT_DATA)
dh_auto_build -- $(COMMON_OPTIONS)
override_dh_auto_install: