public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
From: Jochen Sprickerhof <libloc@jochen.sprickerhof.de>
To: location@lists.ipfire.org
Subject: Re: Upload libloc to Debian
Date: Wed, 06 Jul 2022 09:41:25 +0200	[thread overview]
Message-ID: <YsU8pT9YYst9QLOY@vis.fritz.box> (raw)
In-Reply-To: <1A4374F1-A42A-4A64-8787-BC14BDEDD7E3@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 4275 bytes --]

* Michael Tremer <michael.tremer(a)ipfire.org> [2022-07-05 15:28]:
>The license is part of the database file. That is however not very human-frieldy to read.
>
>I added the file to the directory: https://location.ipfire.org/databases/COPYING

Nice, thanks.

>> Sounds great, I see that the updated puts the file in
>>
>> /var/lib/location/database.db
>>
>> But I don't see where it is used. The libloc-database package would probably install to /usr/share/libloc-database/database.db. Would it be easier if libloc uses that path as a backup if the one in /var is not there or should the package add a symlink to be overwritten by the updater?
>
>The updater would overwrite that symlink since it downloads the file to a temporary location, verifies it with the key, and then replaces the old file. So that would work.
>
>We could also search in a backup location. That would not be a lot of extra work. I am just wondering whether that is very intuitive or whether that would lead to confusion?

I guess that depends on how well known the location is and if users 
could mess with the file such that it would be good to have some program 
logic with a fall back.

>Does the build system not support overwriting that file at all?

In principal you can overwrite the file if you have the rights on the 
system (for example the updater running as root) but you should not 
modify (non configuration) files installed though a package manager.
For one dpkg --verify would complain and also it could produce non 
deterministic results if a new package version would overwrite the file 
again with a maybe older version.

I guess the symlink should work, will test it.

>>>> - According to the Debian Python policy the Python package needs to be renamed to python3-location. It would simplify the transition if you could do the same in your package repo and add a transition package [3].
>>>
>>> Oh, I named it that way because that is how Python packages were usually named in Debian. We can of course absolutely change this.
>>>
>>> Would you be up for sending a patch for this?
>>
>> Sure, as a patch to the list or a pull request on Github?
>
>Please use this list only. We have our tools integrated to it, and GitHub does not allow us to host the database on there since it is too large - so we try to keep the home of the project on our own infrastructure.

Patch attached.

>>> That might be a lot easier since you are already an expert with the Debian packaging system. We have been fighting a couple of problems that we couldn’t really solve. Maybe you can help us with those, too: https://bugzilla.ipfire.org/show_bug.cgi?id=12468
>>
>> I was not able to reproduce this, could you send me a log of when this happens?
>> How do you build the package? With the debian/build.sh?
>
>Yes, we wrote a little helper script to do this.
>
>As mentioned before, I personally have very limited experience with the Debian build system and so this is what we put together :) Any improvements are greatly appreciated.

debian/build.sh uses sbuild so there could be logs from the old runs on 
your system, still. If you could have a look for one with the problem, 
that would help a lot.

>>>> - Similar I would propose to merge the location-importer package into the python package (for the library part) and the location package (for the binary).
>>>
>>> We tried to keep the main package as small as possible. The importer part is not very large, but it does have a dependency to PostgreSQL. Hence we split it, because regular users won’t need it.
>>
>> Oh, that does not seem to be modeled in the package. Is the location-importer by normal users of libloc? Otherwise I would propose to add a suggest to PostgreSQL only.
>
>That is true. We use a database wrapper around psycopg2 which is what should be added here:
>
>  https://git.ipfire.org/?p=location/libloc.git;a=blob;f=src/python/location/database.py;h=5d79941515cf830f81d4aff4a1897c4525d99e82;hb=HEAD

Ah, that's much easier, you can add python3-psycopg2 to the Depends: 
field of the location-importer package in debian/control.

For Debian I would still propose to merge the packages, should we do 
that in your packages as well?

Cheers Jochen

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Rename-Python-package-to-python3-location.patch --]
[-- Type: text/x-diff, Size: 3195 bytes --]

From cf627c7101131d720ec0e2296edbfdc343ed65b6 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Tue, 5 Jul 2022 23:30:29 +0200
Subject: [PATCH] Rename Python package to python3-location

To comply with the Debian Python policy. Also add a transitional package
with the old name.
---
 debian/control                                   | 16 +++++++++++++---
 ...python.examples => python3-location.examples} |  0
 ...n-python.install => python3-location.install} |  0
 debian/rules                                     |  6 +++---
 4 files changed, 16 insertions(+), 6 deletions(-)
 rename debian/{location-python.examples => python3-location.examples} (100%)
 rename debian/{location-python.install => python3-location.install} (100%)

diff --git a/debian/control b/debian/control
index 4b1407a..660f759 100644
--- a/debian/control
+++ b/debian/control
@@ -54,7 +54,7 @@ Architecture: any
 Pre-Depends:
  ${misc:Pre-Depends}
 Depends:
- location-python (= ${binary:Version}),
+ python3-location,
  ${misc:Depends},
  ${python3:Depends}
 Multi-Arch: same
@@ -66,14 +66,14 @@ Architecture: any
 Pre-Depends:
  ${misc:Pre-Depends}
 Depends:
- location-python (= ${binary:Version}),
+ python3-location,
  ${misc:Depends},
  ${python3:Depends}
 Multi-Arch: foreign
 Description: Tools to author location databases
  This package contains tools that are required to build location databases
 
-Package: location-python
+Package: python3-location
 Architecture: any
 Section: python
 Pre-Depends:
@@ -82,6 +82,16 @@ Depends:
  ${misc:Depends},
  ${python3:Depends},
  ${shlibs:Depends}
+Replaces: location-python (<< 0.9.14-1~)
+Breaks: location-python (<< 0.9.14-1~)
 Multi-Arch: foreign
 Description: Python modules for libloc
  This package contains Python bindings for libloc
+
+Package: location-python
+Depends: python3-location, ${misc:Depends}
+Architecture: all
+Priority: optional
+Section: oldlibs
+Description: transitional package
+ This is a transitional package. It can safely be removed.
diff --git a/debian/location-python.examples b/debian/python3-location.examples
similarity index 100%
rename from debian/location-python.examples
rename to debian/python3-location.examples
diff --git a/debian/location-python.install b/debian/python3-location.install
similarity index 100%
rename from debian/location-python.install
rename to debian/python3-location.install
diff --git a/debian/rules b/debian/rules
index 05b88fd..8c252ec 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,7 +22,7 @@ override_dh_systemd_enable:
 override_dh_install:
 	dh_install
 	# lintian: unknown-file-in-python-module-directory
-	rm debian/location-python/usr/lib/python3*/site-packages/_location.la
+	rm debian/python3-location/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
+	rm debian/python3-location/usr/lib/python3*/site-packages/location/database.py
+	rm debian/python3-location/usr/lib/python3*/site-packages/location/importer.py
-- 
2.36.1


[-- Attachment #3: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-07-06  7:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <82DB10C8-A848-42EF-B395-3E27205E81D8@ipfire.org>
2022-07-02  6:57 ` Jochen Sprickerhof
2022-07-05 14:28   ` Michael Tremer
2022-07-06  7:41     ` Jochen Sprickerhof [this message]
2022-07-06  8:29       ` Michael Tremer
2022-07-07  5:46         ` Jochen Sprickerhof
2022-07-08  9:13           ` Michael Tremer
2022-07-08  9:58             ` Jochen Sprickerhof
2022-07-08 11:02               ` Michael Tremer
2022-07-08 12:56                 ` Jochen Sprickerhof
2022-07-13 12:12                   ` Michael Tremer
2022-07-22 21:06                     ` Jochen Sprickerhof
2022-08-16  9:00                       ` Michael Tremer
2022-08-17 13:17                         ` Jochen Sprickerhof
     [not found]                           ` <048f09d9-9985-a356-fed1-4cd8e286b87e@guardianproject.info>
2023-03-02 16:19                             ` Stefan Schantl
2023-03-02 17:26                               ` Michael Tremer
     [not found]                                 ` <9c740e42-cd03-428c-814a-fa8bdee99db9@guardianproject.info>
2025-03-06 10:48                                   ` Michael Tremer
2025-03-10 14:32                                     ` Michael Tremer
     [not found]                                       ` <6e7a9c4e-63c1-4896-bdb0-e621542ca3a7@guardianproject.info>
2025-03-19 10:41                                         ` Michael Tremer
     [not found]                                           ` <633f6312-7914-45db-882b-cb890a6f770c@guardianproject.info>
2025-03-23 12:18                                             ` Michael Tremer
2025-03-25 18:56                                               ` Valters Jansons
2025-03-26 10:17                                                 ` Michael Tremer
2025-03-27  0:25                                                   ` Valters Jansons
2025-03-27 16:39                                                     ` Michael Tremer
2025-03-27 16:55                                                       ` Jochen Sprickerhof
2025-03-28 12:39                                                         ` Michael Tremer
     [not found]                                                       ` <9068f306-8558-4913-8c4e-dad8dc0ee42d@guardianproject.info>
2025-03-28 13:02                                                         ` Michael Tremer
     [not found]                                                         ` <3209250b-4bb9-42f1-89d2-63ac86085148@guardianproject.info>
2025-03-28 13:05                                                           ` Michael Tremer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsU8pT9YYst9QLOY@vis.fritz.box \
    --to=libloc@jochen.sprickerhof.de \
    --cc=location@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox