Merge pull request #37 from Hi-Angel/dpkg-fixes

Debian package creation fixes
This commit is contained in:
Bart Van Assche
2021-05-19 20:59:34 -07:00
committed by GitHub
4 changed files with 15 additions and 8 deletions

View File

@@ -367,6 +367,10 @@ dpkg: ../scst_$(VERSION).orig.tar.gz
[ -z "$$DEBFULLNAME" ] || export DEBFULLNAME="Bart Van Assche" &&\
sed 's/%{scst_version}/$(VERSION)/' \
<debian/scst.dkms.in >debian/scst.dkms && \
sed 's/%{KVER}/$(KVER)/' \
<debian/scst.preinst.in >debian/scst.preinst && \
sed 's/%{KVER}/$(KVER)/' \
<debian/scst.postinst.in >debian/scst.postinst && \
output_files=( \
../*_$(VERSION)-$(DEBIAN_REVISION)_*.deb \
../*_$(VERSION)-$(DEBIAN_REVISION)_*.ddeb \
@@ -387,11 +391,7 @@ dpkg: ../scst_$(VERSION).orig.tar.gz
else \
buildopts+=(-j4); \
fi && \
if false; then \
dpkg-buildpackage "$${buildopts[@]}"; \
else \
debuild "$${buildopts[@]}" --lintian-opts --profile debian; \
fi && \
DEB_CC_SET="$(CC)" 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; \

9
debian/rules vendored
View File

@@ -17,6 +17,12 @@ 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)
export CC=$(DEB_CC_SET)
%:
echo "*** dh $@ ***"
dh $@
@@ -24,7 +30,8 @@ VERSION:=$(shell head -n1 debian/changelog | sed 's/.*(\([0-9.]*\).*).*/\1/')
clean:
dh_testdir && \
dh_prep -Xqla_isp/TAGS -Xdebian/changelog && \
scripts/clean-source-tree -x debian/changelog -x debian/compat
scripts/clean-source-tree -x debian/changelog -x debian/compat -x debian/scst.preinst \
-x debian/scst.postinst
build:
make 2release && \

View File

@@ -23,7 +23,7 @@ case "$1" in
mkdir -p /var/lib/scst/dif_tags
mkdir -p /var/lib/scst/pr
mkdir -p /var/lib/scst/vdev_mode_pages
depmod;;
depmod "%{KVER}";;
abort-upgrade|abort-remove|abort-deconfigure)
;;

View File

@@ -17,7 +17,7 @@ set -e
case "$1" in
install)
# Remove any existing ib_srpt.ko kernel modules
find "/lib/modules/$(uname -r)" -name ib_srpt.ko -exec rm {} \;
find "/lib/modules/%{KVER}" -name ib_srpt.ko -exec rm {} \;
# Remove files installed by "make install"
rm -f /usr/local/man/man5/iscsi-scstd.conf.5
rm -f /usr/local/man/man8/iscsi-scst-adm.8