summaryrefslogtreecommitdiff
path: root/scripts/package/builddeb
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-12-26 22:52:43 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-01-05 19:35:38 +0900
commit5e73758b43c3defba2578df6d3a53e942fa6b41e (patch)
tree7a7be30ab6c18feca2b4e3350b41a27421ead28b /scripts/package/builddeb
parent68e262f8017d7fa5a9ea1ef21cbaa0fd5334ecd5 (diff)
kbuild: deb-pkg: use more debhelper commands in builddeb
Commit 36862e14e316 ("kbuild: deb-pkg: use dh_listpackages to know enabled packages") started to require the debhelper tool suite. Use more dh_* commands in create_package(): - dh_installdocs to install copyright - dh_installchangelogs to install changelog - dh_compress to compress changelog - dh_fixperms to replace the raw chmod command - dh_gencontrol to replace the raw dpkg-gencontrol command - dh_md5sums to record the md5sum of included files - dh_builddeb to replace the raw dpkg-deb command Set DEB_RULES_REQUIRES_ROOT to 'no' in case debian/rules is executed directly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
Diffstat (limited to 'scripts/package/builddeb')
-rwxr-xr-xscripts/package/builddeb27
1 files changed, 10 insertions, 17 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 2eb4910f0ef3..436d55a83ab0 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -26,23 +26,16 @@ if_enabled_echo() {
create_package() {
local pname="$1" pdir="$2"
- local dpkg_deb_opts
-
- mkdir -m 755 -p "$pdir/DEBIAN"
- mkdir -p "$pdir/usr/share/doc/$pname"
- cp debian/copyright "$pdir/usr/share/doc/$pname/"
- cp debian/changelog "$pdir/usr/share/doc/$pname/changelog.Debian"
- gzip -n -9 "$pdir/usr/share/doc/$pname/changelog.Debian"
- sh -c "cd '$pdir'; find . -type f ! -path './DEBIAN/*' -printf '%P\0' \
- | xargs -r0 md5sum > DEBIAN/md5sums"
-
- # a+rX in case we are in a restrictive umask environment like 0077
- # ug-s in case we build in a setuid/setgid directory
- chmod -R go-w,a+rX,ug-s "$pdir"
-
- # Create the package
- dpkg-gencontrol -p$pname -P"$pdir"
- dpkg-deb --root-owner-group ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
+
+ export DH_OPTIONS="-p${pname} -P${pdir}"
+
+ dh_installdocs
+ dh_installchangelogs
+ dh_compress
+ dh_fixperms
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb -- ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS}
}
install_linux_image () {