Skip to content

Replace stdeb packaging with policy-conformant debian/ directory - #104

Merged
Willi Mann (wmann-celonis) merged 9 commits into
mainfrom
debian-policy-packaging
Jul 15, 2026
Merged

Replace stdeb packaging with policy-conformant debian/ directory#104
Willi Mann (wmann-celonis) merged 9 commits into
mainfrom
debian-policy-packaging

Conversation

@wmann-celonis

@wmann-celonis Willi Mann (wmann-celonis) commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the stdeb-generated .deb build with a hand-written, Debian Policy conformant debian/ directory built via the standard debhelper / dh-python (pybuild) tooling.

A single source package now produces three binary packages:

Package Contents Depends on
python3-homcc-common homcc/__init__.py, homcc/common/ python3-lzo (>= 1.12)
homcc /usr/bin/homcc, homcc/client/ python3-homcc-common (= 1.0.3), python3-sysv-ipc
homccd /usr/bin/homccd, homcc/server/, systemd unit python3-homcc-common (= 1.0.3)

Moving the shared code into python3-homcc-common removes the file conflict that previously forced dpkg -i --force-overwrite when installing both the client and the server.

Changes

Packaging

  • New debian/: control, changelog, rules, copyright, source/format (3.0 (native)), per-package *.install, python3-homcc-common.docs. Kept homccd.service; removed compat (now debhelper-compat (= 13)).
  • Unified setup.py declaring all sub-packages + both console-script entry points (drives pybuild).
  • Rewrote Makefile to build via dpkg-buildpackage and collect .debs in ./target.
  • Bumped client/server __version__ to 1.0.3 to match the changelog.
  • Updated README installation/build sections; removed the --force-overwrite note.
  • .gitignore: ignore debhelper/pybuild in-tree build artifacts.
  • Legacy stdeb files (stdeb.cfg, setup_client.py, setup_server.py) kept for now, unaffected.

CI

  • Dropped stdeb entirely: removed python3-stdeb (and the other stdeb-flow-only apt packages) from the build job, and removed stdeb from requirements.txt. The build job now installs only what dpkg-buildpackage / make all needs (dh-python debhelper devscripts fakeroot python3-all python3-setuptools liblzo2-dev) and sudo make all drives the new flow. Also removed the now-vestigial pip install -r requirements.txt step (and the unused python3-pip dep) from the build job.
  • Bumped actions (checkout@v4, setup-python@v5, upload-artifact@v4) to fix Cache service responded with 400 from the retired cache backend.
  • Replaced the psf/black@stable / isort/isort-action marketplace steps with direct calls to the pinned black==22.6.0 / isort from requirements.txt. (psf/black@stable installs the latest black, whose wrapper script crashes under the pinned Python 3.9.)

Verification

  • make builds all three Architecture: all packages; make clean fully resets the tree.
  • dpkg-deb -c confirms zero file overlap between packages; systemd unit lands only in homccd.
  • Ran the split packages together: homcc --version, homccd --version, and cross-package homcc.common imports all resolve.
  • lintian clean except: no-manual-page (manpages out of scope) and bad-distribution-in-changes-file unstable (an Ubuntu-vendor artifact; unstable is Debian-correct).
  • CI green on the branch (linter, format-check, tests). The same fixes are mirrored in build-main.yml, so main's CI stays healthy after merge.

Notes / open questions

  • Changelog distribution is unstable (Debian-correct). If CI should target an Ubuntu series (noble/jammy), that can be changed.
  • The packaging build job lives in build-main.yml (push to main only); the PR workflow build-branch.yml has no build job, so make all is first exercised post-merge. Verified locally in the meantime.

🤖 Generated with Claude Code

Build all Debian packages from a hand-written debian/ directory using the
standard debhelper / dh-python (pybuild) tooling instead of stdeb.

A single source package now produces three binary packages:
  - homcc                 the client (/usr/bin/homcc)
  - homccd                the server (/usr/bin/homccd) plus its systemd unit
  - python3-homcc-common  the shared homcc.common code

The homcc and homccd packages depend on python3-homcc-common instead of each
shipping their own copy of homcc.common. This removes the file conflict that
previously required "dpkg -i --force-overwrite" when installing both.

Also:
  - add a unified setup.py declaring all sub-packages and both console scripts
  - rewrite the Makefile to build via dpkg-buildpackage and collect the .deb
    files in ./target
  - update the README installation and build instructions
  - ignore debhelper/pybuild in-tree build artifacts

The legacy stdeb files (stdeb.cfg, setup_client.py, setup_server.py) are kept
for now and are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Match the debian/changelog 1.0.3 entry so the built package metadata and the
egg-info agree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Debian packages are now built from the hand-written debian/ directory via
dpkg-buildpackage, so stdeb is no longer used. Remove python3-stdeb (and the
now-unused stdeb-flow apt packages) from the build workflow and drop stdeb from
requirements.txt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitHub retired the cache service backend used by the older action versions,
so setup-python's cache: 'pip' fails with "Cache service responded with 400".
Bump checkout to v4, setup-python to v5, and upload-artifact to v4, which use
the current cache backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
psf/black@stable installs the latest black and its wrapper script crashes
under Python 3.9 ("str | None" requires 3.10+), failing format-check. Run the
black==22.6.0 and isort versions already installed from requirements.txt
directly instead, which is both version-consistent with local development and
free of the broken action wrapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The debian/ directory was authored in 2026.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread README.md Outdated
Comment thread Makefile
Comment on lines +17 to +19
homcc client: deb

homccd: server
homccd server: deb

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
homcc client: deb
homccd: server
homccd server: deb
homcc client homccd server: deb

but honestly, I am also fine with dropping these convenience targets completely

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove the Makefile completely - the debian packages can be built e.g. by just calling debuild in the base directory of the repository. For cleanup, there is debclean.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks! I think it'd be nice to still keep the Makefile for convenience but no strong opinion.

Comment thread .github/workflows/build-main.yml
Comment thread .github/workflows/build-main.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

This PR replaces the prior stdeb-based Debian packaging flow with a Debian Policy–conformant debian/ directory (debhelper + dh-python/pybuild), producing three binary packages (homcc, homccd, python3-homcc-common) to avoid file conflicts between client/server installs.

Changes:

  • Added a complete debian/ packaging directory (control, rules, changelog, copyright, source/format).
  • Updated the Makefile to build via dpkg-buildpackage and collect .deb artifacts into ./target.
  • Dropped legacy debian/compat in favor of debhelper-compat (= 13) in debian/control.

Reviewed changes

Copilot reviewed 15 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Makefile Switches build/clean targets to dpkg-buildpackage and collects .deb outputs into ./target.
debian/source/format Declares native source format (3.0 (native)).
debian/rules Uses dh-python/pybuild and overrides install staging dir for package splitting.
debian/control Defines source package metadata and three binary packages with dependencies.
debian/changelog Introduces Debian changelog entry for the packaging rewrite and package split.
debian/copyright Adds DEP-5 formatted copyright/licensing metadata.
debian/compat Removes deprecated compat level file (now handled via debhelper-compat).
Files excluded by content exclusion policy (12)
  • .github/workflows/build-branch.yml
  • .github/workflows/build-main.yml
  • .gitignore
  • README.md
  • debian/homcc.install
  • debian/homccd.install
  • debian/python3-homcc-common.docs
  • debian/python3-homcc-common.install
  • homcc/client/init.py
  • homcc/server/init.py
  • requirements.txt
  • setup.py

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
Comment thread Makefile
Comment on lines 21 to +23
clean:
rm -rf target/*.deb
rm -f homcc*.tar.gz
dpkg-buildpackage -rfakeroot -T clean || true
rm -rf target

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is standard for debian packaging work.

The Debian packages are built with dpkg-buildpackage against system
python3-setuptools, so the build job does not need the dev/test tooling from
requirements.txt. Remove the pip install step and the now-unused python3-pip
dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dpkg-buildpackage runs with -rfakeroot and debian/control sets
Rules-Requires-Root: no, so the build needs no real root privileges. Running
it under sudo only left root-owned artifacts in the workspace. Drop sudo from
the build step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread Makefile
Comment on lines +17 to +19
homcc client: deb

homccd: server
homccd server: deb

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks! I think it'd be nice to still keep the Makefile for convenience but no strong opinion.

@wmann-celonis
Willi Mann (wmann-celonis) merged commit 0a276d6 into main Jul 15, 2026
7 checks passed
@wmann-celonis
Willi Mann (wmann-celonis) deleted the debian-policy-packaging branch July 15, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants