Hi,

I am re-working my first Debian package, console-log, which I wrote back two decades ago. The rewrite is going to be in python, and I have never packaged python code before. The code is not yet in git.

What I have:
.
├── debian
│   ├── changelog
│   ├── control
│   ├── copyright
│   ├── rules
│   └── source
│       └── format
├── pyproject.toml
└── src
    ├── console_log
    │   ├── base.py
    │   ├── config.py
    │   ├── __init__.py
    │   └── pagers
    │       ├── __init__.py
    │       └── less.py
    ├── console-log.generator
    └── do_console_log

console-log.generator will go to
/usr/lib/systemd/system-generators; do_console_log ends up in /usr/share/console-log. Both programs are not supposed to be called from a user. do_console_log imports from console-log/pagers. There will be other modules at the side of less.py. I am moving both from debian/console-log.install.

Google tells me that I am supposed to use dh-python and pyproject. Here is what I coughed up:

[206/6622]mh@swivel:~/packages/console-log/console-log (wip-systemd *+%) $ cat 
debian/rules
#!/usr/bin/make -f

%:
        dh $@ --with python3 --buildsystem=pybuild
[207/6622]mh@swivel:~/packages/console-log/console-log (wip-systemd *+%) $ cat 
pyproject.toml
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "console-log"
version = "2.0"
description = "Console Log - Displays Logs on Virtual Consoles"
authors = [
    { name = "Marc Haber", email = "[email protected]" }
]
license = "GPL-2.0"
requires-python = ">=3.7"
dependencies = [
]

[tool.setuptools.packages.find]
where = ["src"]
[208/6623]mh@swivel:~/packages/console-log/console-log (wip-systemd *+%) $

However, building this does not seem to give the desired results:

(1)
My package contains /usr/lib/python3/console_log-2.0.dist-info, and lintian doesn't like that. How can I preent that from being installed?

(2)
Additionally, the package doesn't build twice in a row since .pybuild and build directories are generated and not cleaned up on package clean.

Am I supposed to clean those two directories up in dh_override_auto_clean?

(3)
Is it okay to move the two binaries from src/ to the respective directories in the package via debian/console-log.install or, how would I
tell setuptools to install those files to their targets?

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to