debian: make sure KVER and KDIR are visible to dpkg build

The debuild clears up the environment, thus the essential SCST variables
KVER and KDIR are cleared out. This patch fixes it.

Note: technically, `debild` supports `--preserve-env` option. But in
reality making use of it makes no difference, variables still do not
appear. Work around it by using DEB_foo_SET from `man dpkg-buildflags`


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9423 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2021-05-20 04:01:24 +00:00
parent ffad8bd07a
commit 143ea7b546
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ dpkg: ../scst_$(VERSION).orig.tar.gz
else \
buildopts+=(-j4); \
fi && \
debuild "$${buildopts[@]}" --lintian-opts --profile debian && \
DEB_KVER_SET=$(KVER) DEB_KDIR_SET=$(KDIR) debuild "$${buildopts[@]}" --lintian-opts --profile debian && \
mkdir -p dpkg && \
for f in "$${output_files[@]}" ../scst_$(VERSION).orig.tar.[gx]z; do\
mv $$f dpkg || true; \
+5
View File
@@ -17,6 +17,11 @@ SUBDIRS=scst fcst iscsi-scst qla2x00t/qla2x00-target scst_local scstadmin srpt
DESTDIR=$(CURDIR)/debian/tmp
VERSION:=$(shell head -n1 debian/changelog | sed 's/.*(\([0-9.]*\).*).*/\1/')
# rules won't see variables unless they're using DEB_foo_SET syntax. So use that as
# an intermediary. Also, export variables for sub-makes to be able to see them.
export KVER=$(DEB_KVER_SET)
export KDIR=$(DEB_KDIR_SET)
%:
echo "*** dh $@ ***"
dh $@