Skip to content

Commit

Permalink
Merge !1620: distro/pkg/deb: deep clean Debian packaging with pedanti…
Browse files Browse the repository at this point in the history
…c lintian
  • Loading branch information
vcunat committed Oct 16, 2024
2 parents d7c34e1 + 3132a92 commit 00f1d06
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 24 deletions.
7 changes: 6 additions & 1 deletion distro/pkg/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@ Depends:
${misc:Depends},
Section: libdevel
Description: Knot Resolver development files
Knot Resolver is a caching full resolver implementation
written in C and LuaJIT, including both a resolver library and a
daemon. Modular architecture of the library keeps the core tiny and
efficient, and provides a state-machine like API for
extensions.
.
This package provides the development headers for Knot Resolver.

Package: knot-resolver6-module-dnstap
Architecture: any
Multi-Arch: same
Depends:
knot-resolver6 (= ${binary:Version}),
libfstrm0,
Expand Down
2 changes: 1 addition & 1 deletion distro/pkg/deb/knot-resolver6-dev.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
usr/include/libkres/*.h
usr/lib/*.so
usr/lib/pkgconfig/libkres.pc
usr/lib/pkgconfig/libkres.pc usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig
4 changes: 4 additions & 0 deletions distro/pkg/deb/knot-resolver6-module-http.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# UPSTREAM: intended
knot-resolver6-module-http: font-in-non-font-package
# UPSTREAM: intended
knot-resolver6-module-http: font-outside-font-dir
1 change: 0 additions & 1 deletion distro/pkg/deb/knot-resolver6.docs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
README.md
usr/share/doc/knot-resolver/AUTHORS
usr/share/doc/knot-resolver/COPYING
usr/share/doc/knot-resolver/NEWS
usr/share/doc/knot-resolver/examples
2 changes: 1 addition & 1 deletion distro/pkg/deb/knot-resolver6.links
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib/systemd/system/knot-resolver.service lib/systemd/system/multi-user.target.wants/knot-resolver.service
usr/lib/systemd/system/knot-resolver.service usr/lib/systemd/system/multi-user.target.wants/knot-resolver.service
10 changes: 10 additions & 0 deletions distro/pkg/deb/knot-resolver6.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# this library is only shared within kresd
knot-resolver6: package-name-doesnt-match-sonames libkres9
# this library is only shared within kresd, no need for symbols
knot-resolver6: no-symbols-control-file usr/lib/libkres.so.9
# it's a module
knot-resolver6: shared-library-lacks-prerequisites [usr/lib/knot-resolver/kres_modules/refuse_nord.so]
# no init.d support
knot-resolver6: package-supports-alternative-init-but-no-init.d-script
# UPSTREAM: no docs build yet due to missing deps
knot-resolver6: no-manual-page
4 changes: 2 additions & 2 deletions distro/pkg/deb/knot-resolver6.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ fi

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
systemctl daemon-reload || true
systemd-tmpfiles --create /usr/lib/tmpfiles.d/knot-resolver.conf
systemctl try-restart knot-resolver.service || true
systemd-tmpfiles --create /usr/lib/tmpfiles.d/knot-resolver.conf || true
deb-systemd-invoke try-restart knot-resolver.service || true
fi

#DEBHELPER#
3 changes: 2 additions & 1 deletion distro/pkg/deb/not-installed
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
usr/lib/knot-resolver/kres_modules/http/LICENSE
usr/lib/knot-resolver/kres_modules/etcd.lua
usr/lib/knot-resolver/kres_modules/http/LICENSE
usr/lib/sysusers.d/knot-resolver.conf
usr/share/doc/knot-resolver/COPYING
25 changes: 12 additions & 13 deletions distro/pkg/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ include /usr/share/dpkg/default.mk


%:
dh $@ --with python3 --buildsystem pybuild
dh $@ --with python3 --buildsystem=meson

override_dh_auto_build:
meson build_deb \
override_dh_auto_configure:
dh_auto_configure -- \
--buildtype=plain \
--prefix=/usr \
--libdir=lib \
Expand All @@ -31,16 +31,15 @@ override_dh_auto_build:
-Dkeyfile_default=/usr/share/dns/root.key \
-Droot_hints=/usr/share/dns/root.hints \
-Dunit_tests=enabled \
-Dmalloc=jemalloc \
-Dc_args="$${CFLAGS}" \
-Dc_link_args="$${LDFLAGS}"
ninja -v -C build_deb
PYBUILD_NAME=knot_resolver PYBUILD_DESTDIR="$${PYKRES_DESTDIR}" dh_auto_build
-Dmalloc=jemalloc

override_dh_auto_build:
dh_auto_build
PYBUILD_NAME=knot_resolver PYBUILD_DESTDIR="$${PYKRES_DESTDIR}" \
dh_auto_build --buildsystem=pybuild

override_dh_auto_install:
DESTDIR="$(shell pwd)/debian/tmp" ninja -v -C build_deb install
PYBUILD_NAME=knot_resolver PYBUILD_DESTDIR="$${PYKRES_DESTDIR}" dh_auto_install
dh_auto_install
PYBUILD_NAME=knot_resolver PYBUILD_DESTDIR="$${PYKRES_DESTDIR}" \
dh_auto_install --buildsystem=pybuild
install -m 644 -D etc/config/config.yaml debian/tmp/etc/knot-resolver/config.yaml

override_dh_auto_test:
meson test -C build_deb
16 changes: 12 additions & 4 deletions distro/pkg/deb/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# upstream package doesn't include missing-sources for HTTP module static files,
# UPSTREAM: package doesn't include missing-sources for HTTP module static files,
# they can be found in individual upstream repos or in Debian package debian/missing-sources
source: source-is-missing [modules/http/static/bootstrap.min.js]
source: source-is-missing [modules/http/static/d3.js]
Expand All @@ -8,9 +8,17 @@ source: source-is-missing [modules/http/static/epoch.js]
source: source-is-missing [modules/http/static/jquery.js]
source: source-is-missing [modules/http/static/selectize.min.js]
source: source-is-missing [modules/http/static/topojson.js]
# that's how HTTP module is built upstream
# UPSTREAM: that's how HTTP module is built upstream
source: source-contains-prebuilt-javascript-object
# not relevant in upstream package
# UPSTREAM: not relevant in upstream package
source: no-nmu-in-changelog
# upstream package uses apkg, watch file is redundant
# UPSTREAM: package uses apkg, watch file is redundant
source: debian-watch-file-is-missing
# UPSTREAM: we build cross-distro, Standards-Version rarely matches
source: newer-standards-version
# UPSTREAM: old distro compat
source: package-uses-old-debhelper-compat-version
# UPSTREAM: old distro compat
source: uses-debhelper-compat-file
# UPSTREAM: we use setuptools for now for old distro compat
source: missing-prerequisite-for-pyproject-backend

0 comments on commit 00f1d06

Please sign in to comment.