[v2] debian: Mitigate bulk of Lintian issues

Message ID 20210415123559.21664-1-valter.jansons@gmail.com
State Superseded
Headers
Series [v2] debian: Mitigate bulk of Lintian issues |

Commit Message

Valters Jansons April 15, 2021, 12:35 p.m. UTC
  - d/.gitignore: Ignore all temporary files and subdirectories such as
  debian/location-importer/ and debian/location-importer.debhelper.log
  with the exception of debian/source/ and potential debian/patches/
  which may be used for Quilt, considering the source format is set
  to '3.0 (quilt)'.

- d/clean: Remove m4/intltool.m4 and po/Makefile.in.in autogenerated
  files prior to building/in-between builds. Without removal of these
  autogenerated files, build tooling complains about unexpected changes
  to the source tree.

- d/control: Move libloc1 to 'libs' section
  (lintian: wrong-section-according-to-package-name).
- d/control: Set 'Multi-Arch: foreign' hint for location-importer and
  location-python, due to py3compile via dh-python
  (lintian: multi-arch-same-package-calls-pycompile).

- d/copyright: Update format link to use HTTPS instead of HTTP
  (lintian: insecure-copyright-format-uri).

- d/libloc1.symbols: Added symbols export file
  (lintian: no-symbols-control-file). For generation:
  $ debuild -uc -us # to easily build everything to debian/tmp/
  $ dpkg-gensymbols -plibloc1 -Odebian/libloc1.symbols
  $ sed -i -E -e 's/( [0-9\.]+)-.+$/\1/' debian/*.symbols

- d/location-python.examples: Add the examples/python/ to documentation
  (lintian: package-does-not-install-examples).

- d/rules: Remove _location.la from location-python package
  (lintian: unknown-file-in-python-module-directory,
  incorrect-libdir-in-la-file, non-empty-dependency_libs-in-la-file).
  Considering the dependency library is not being installed, the la
  file does not appear too useful. Additionally, dh-python moves the
  site-packages files dist-packages resulting in a broken libdir,
  and unexpected .la files being added to Python root.
- d/rules: Remove location/{database,importer}.py from location-python
  package. These files get installed to location-importer package
  (lintian: binaries-have-file-conflict).

- d/watch: Add uscan configuration, as expected for '3.0 (quilt)' format
  (lintian: debian-watch-file-is-missing).

- src/systemd/location-update.service.in: Add a generic Documentation=
  linking to the manual page of location, for `systemctl help <name>`
  (lintian: systemd-service-file-missing-documentation-key).

Following this, the only complaints from Lintian are about:
- `location-importer` not having a manpage.
- Short package Descriptions, not explaining what they do in detail.
- An out-dated Standards-Version.
- An old debhelper compatibility level.
- Lack of an autopkgtest testsuite.

Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
---
 debian/.gitignore                      |   8 +-
 debian/clean                           |   2 +
 debian/control                         |   5 +-
 debian/copyright                       |   2 +-
 debian/libloc1.symbols                 | 134 +++++++++++++++++++++++++
 debian/location-python.examples        |   1 +
 debian/rules                           |   8 ++
 debian/watch                           |   3 +
 src/systemd/location-update.service.in |   1 +
 9 files changed, 157 insertions(+), 7 deletions(-)
 create mode 100644 debian/clean
 create mode 100644 debian/libloc1.symbols
 create mode 100644 debian/location-python.examples
 create mode 100644 debian/watch
  

Patch

diff --git a/debian/.gitignore b/debian/.gitignore
index 0faf920..4a7eb9a 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -2,9 +2,9 @@ 
 /autoreconf.*
 /debhelper-build-stamp
 /files
-/libloc/
-/libloc-dev/
-/libloc-perl/
-/tmp
+/*/
 *.debhelper
+*.log
 *.substvars
+!/patches/
+!/source/
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..54a6877
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@ 
+m4/intltool.m4
+po/Makefile.in.in
diff --git a/debian/control b/debian/control
index dc40927..ec27f92 100644
--- a/debian/control
+++ b/debian/control
@@ -23,6 +23,7 @@  Vcs-Browser: https://git.ipfire.org/pub/git/location/libloc.git
 
 Package: libloc1
 Architecture: any
+Section: libs
 Pre-Depends:
  ${misc:Pre-Depends}
 Depends:
@@ -67,7 +68,7 @@  Depends:
  location-python (= ${binary:Version}),
  ${misc:Depends},
  ${python3:Depends}
-Multi-Arch: same
+Multi-Arch: foreign
 Description: Tools to author location databases
  This package contains tools that are required to build location databases
 
@@ -80,6 +81,6 @@  Depends:
  ${misc:Depends},
  ${python3:Depends},
  ${shlibs:Depends}
-Multi-Arch: same
+Multi-Arch: foreign
 Description: Python modules for libloc
  This package contains Python bindings for libloc
diff --git a/debian/copyright b/debian/copyright
index 636af48..3bd7654 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,4 @@ 
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: libloc
 Upstream-Contact: Michael Tremer <michael.tremer@ipfire.org>
 Source: https://location.ipfire.org/download
diff --git a/debian/libloc1.symbols b/debian/libloc1.symbols
new file mode 100644
index 0000000..74b70b5
--- /dev/null
+++ b/debian/libloc1.symbols
@@ -0,0 +1,134 @@ 
+libloc.so.1 libloc1 #MINVER#
+* Build-Depends-Package: libloc-dev
+ LIBLOC_1@LIBLOC_1 0.9.4
+ LIBLOC_PRIVATE@LIBLOC_PRIVATE 0.9.4
+ loc_as_cmp@LIBLOC_1 0.9.4
+ loc_as_get_name@LIBLOC_1 0.9.4
+ loc_as_get_number@LIBLOC_1 0.9.4
+ loc_as_list_append@LIBLOC_1 0.9.5
+ loc_as_list_clear@LIBLOC_1 0.9.5
+ loc_as_list_contains@LIBLOC_1 0.9.5
+ loc_as_list_contains_number@LIBLOC_1 0.9.5
+ loc_as_list_empty@LIBLOC_1 0.9.5
+ loc_as_list_get@LIBLOC_1 0.9.5
+ loc_as_list_new@LIBLOC_1 0.9.5
+ loc_as_list_ref@LIBLOC_1 0.9.5
+ loc_as_list_size@LIBLOC_1 0.9.5
+ loc_as_list_unref@LIBLOC_1 0.9.5
+ loc_as_new@LIBLOC_1 0.9.4
+ loc_as_ref@LIBLOC_1 0.9.4
+ loc_as_set_name@LIBLOC_1 0.9.4
+ loc_as_unref@LIBLOC_1 0.9.4
+ loc_country_cmp@LIBLOC_1 0.9.4
+ loc_country_code_is_valid@LIBLOC_1 0.9.4
+ loc_country_get_code@LIBLOC_1 0.9.4
+ loc_country_get_continent_code@LIBLOC_1 0.9.4
+ loc_country_get_name@LIBLOC_1 0.9.4
+ loc_country_list_append@LIBLOC_1 0.9.5
+ loc_country_list_clear@LIBLOC_1 0.9.5
+ loc_country_list_contains@LIBLOC_1 0.9.5
+ loc_country_list_contains_code@LIBLOC_1 0.9.5
+ loc_country_list_empty@LIBLOC_1 0.9.5
+ loc_country_list_get@LIBLOC_1 0.9.5
+ loc_country_list_new@LIBLOC_1 0.9.5
+ loc_country_list_ref@LIBLOC_1 0.9.5
+ loc_country_list_size@LIBLOC_1 0.9.5
+ loc_country_list_unref@LIBLOC_1 0.9.5
+ loc_country_new@LIBLOC_1 0.9.4
+ loc_country_ref@LIBLOC_1 0.9.4
+ loc_country_set_continent_code@LIBLOC_1 0.9.4
+ loc_country_set_name@LIBLOC_1 0.9.4
+ loc_country_unref@LIBLOC_1 0.9.4
+ loc_database_count_as@LIBLOC_1 0.9.4
+ loc_database_created_at@LIBLOC_1 0.9.4
+ loc_database_enumerator_get_asns@LIBLOC_1 0.9.5
+ loc_database_enumerator_get_countries@LIBLOC_1 0.9.5
+ loc_database_enumerator_new@LIBLOC_1 0.9.4
+ loc_database_enumerator_next_as@LIBLOC_1 0.9.4
+ loc_database_enumerator_next_country@LIBLOC_1 0.9.4
+ loc_database_enumerator_next_network@LIBLOC_1 0.9.4
+ loc_database_enumerator_ref@LIBLOC_1 0.9.4
+ loc_database_enumerator_set_asns@LIBLOC_1 0.9.5
+ loc_database_enumerator_set_countries@LIBLOC_1 0.9.5
+ loc_database_enumerator_set_family@LIBLOC_1 0.9.4
+ loc_database_enumerator_set_flag@LIBLOC_1 0.9.4
+ loc_database_enumerator_set_string@LIBLOC_1 0.9.4
+ loc_database_enumerator_unref@LIBLOC_1 0.9.4
+ loc_database_get_as@LIBLOC_1 0.9.4
+ loc_database_get_country@LIBLOC_1 0.9.4
+ loc_database_get_description@LIBLOC_1 0.9.4
+ loc_database_get_license@LIBLOC_1 0.9.4
+ loc_database_get_vendor@LIBLOC_1 0.9.4
+ loc_database_lookup@LIBLOC_1 0.9.4
+ loc_database_lookup_from_string@LIBLOC_1 0.9.4
+ loc_database_new@LIBLOC_1 0.9.4
+ loc_database_ref@LIBLOC_1 0.9.4
+ loc_database_unref@LIBLOC_1 0.9.4
+ loc_database_verify@LIBLOC_1 0.9.4
+ loc_discover_latest_version@LIBLOC_1 0.9.4
+ loc_get_log_priority@LIBLOC_1 0.9.4
+ loc_network_address_family@LIBLOC_1 0.9.4
+ loc_network_cmp@LIBLOC_1 0.9.5
+ loc_network_exclude@LIBLOC_1 0.9.5
+ loc_network_exclude_list@LIBLOC_1 0.9.5
+ loc_network_format_first_address@LIBLOC_1 0.9.4
+ loc_network_format_last_address@LIBLOC_1 0.9.4
+ loc_network_get_asn@LIBLOC_1 0.9.4
+ loc_network_get_country_code@LIBLOC_1 0.9.4
+ loc_network_get_first_address@LIBLOC_1 0.9.5
+ loc_network_get_last_address@LIBLOC_1 0.9.5
+ loc_network_has_flag@LIBLOC_1 0.9.4
+ loc_network_is_subnet@LIBLOC_1 0.9.5
+ loc_network_list_clear@LIBLOC_1 0.9.5
+ loc_network_list_contains@LIBLOC_1 0.9.5
+ loc_network_list_dump@LIBLOC_1 0.9.5
+ loc_network_list_empty@LIBLOC_1 0.9.5
+ loc_network_list_get@LIBLOC_1 0.9.5
+ loc_network_list_merge@LIBLOC_1 0.9.5
+ loc_network_list_new@LIBLOC_1 0.9.5
+ loc_network_list_pop@LIBLOC_1 0.9.5
+ loc_network_list_pop_first@LIBLOC_1 0.9.5
+ loc_network_list_push@LIBLOC_1 0.9.5
+ loc_network_list_ref@LIBLOC_1 0.9.5
+ loc_network_list_size@LIBLOC_1 0.9.5
+ loc_network_list_unref@LIBLOC_1 0.9.5
+ loc_network_match_address@LIBLOC_1 0.9.5
+ loc_network_match_asn@LIBLOC_1 0.9.4
+ loc_network_match_country_code@LIBLOC_1 0.9.4
+ loc_network_match_flag@LIBLOC_1 0.9.4
+ loc_network_new@LIBLOC_1 0.9.4
+ loc_network_new_from_string@LIBLOC_1 0.9.4
+ loc_network_overlaps@LIBLOC_1 0.9.5
+ loc_network_prefix@LIBLOC_1 0.9.5
+ loc_network_ref@LIBLOC_1 0.9.4
+ loc_network_set_asn@LIBLOC_1 0.9.4
+ loc_network_set_country_code@LIBLOC_1 0.9.4
+ loc_network_set_flag@LIBLOC_1 0.9.4
+ loc_network_str@LIBLOC_1 0.9.4
+ loc_network_subnets@LIBLOC_1 0.9.5
+ loc_network_unref@LIBLOC_1 0.9.4
+ loc_new@LIBLOC_1 0.9.4
+ loc_ref@LIBLOC_1 0.9.4
+ loc_set_log_fn@LIBLOC_1 0.9.4
+ loc_set_log_priority@LIBLOC_1 0.9.4
+ loc_stringpool_add@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_dump@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_get@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_get_size@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_new@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_ref@LIBLOC_PRIVATE 0.9.4
+ loc_stringpool_unref@LIBLOC_PRIVATE 0.9.4
+ loc_unref@LIBLOC_1 0.9.4
+ loc_writer_add_as@LIBLOC_1 0.9.4
+ loc_writer_add_country@LIBLOC_1 0.9.4
+ loc_writer_add_network@LIBLOC_1 0.9.4
+ loc_writer_get_description@LIBLOC_1 0.9.4
+ loc_writer_get_license@LIBLOC_1 0.9.4
+ loc_writer_get_vendor@LIBLOC_1 0.9.4
+ loc_writer_new@LIBLOC_1 0.9.4
+ loc_writer_ref@LIBLOC_1 0.9.4
+ loc_writer_set_description@LIBLOC_1 0.9.4
+ loc_writer_set_license@LIBLOC_1 0.9.4
+ loc_writer_set_vendor@LIBLOC_1 0.9.4
+ loc_writer_unref@LIBLOC_1 0.9.4
+ loc_writer_write@LIBLOC_1 0.9.4
diff --git a/debian/location-python.examples b/debian/location-python.examples
new file mode 100644
index 0000000..cf2a6ee
--- /dev/null
+++ b/debian/location-python.examples
@@ -0,0 +1 @@ 
+examples/python/
diff --git a/debian/rules b/debian/rules
index 8893b7b..05b88fd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,3 +18,11 @@  override_dh_perl:
 
 override_dh_systemd_enable:
 	dh_systemd_enable location-update.timer
+
+override_dh_install:
+	dh_install
+	# lintian: unknown-file-in-python-module-directory
+	rm debian/location-python/usr/lib/python3*/site-packages/_location.la
+	# linitan: binaries-have-file-conflict (d/location-importer.install)
+	rm debian/location-python/usr/lib/python3*/site-packages/location/database.py
+	rm debian/location-python/usr/lib/python3*/site-packages/location/importer.py
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..19ace6d
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@ 
+version=4
+https://source.ipfire.org/releases/libloc/ \
+    @PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate
diff --git a/src/systemd/location-update.service.in b/src/systemd/location-update.service.in
index daae2c5..1c8e116 100644
--- a/src/systemd/location-update.service.in
+++ b/src/systemd/location-update.service.in
@@ -1,5 +1,6 @@ 
 [Unit]
 Description=Automatic Location Database Updater
+Documentation=man:location(8) https://man-pages.ipfire.org/libloc/location.html
 Requires=network.target
 
 [Service]