Restructure repo layout, wiring src/ and packaging for local and distro builds

- Add dev runner main.py that prefers local src/ over installed pkgmgr
- Move Arch/Debian/Fedora packaging files under packaging/* and update build scripts
- Adjust .gitignore/.dockerignore for new packaging paths and src/source/
- Improve config defaults discovery to support src/ layout and installed packages
- Update architecture diagram and add TODO overview for TAGS/MIRROR/SIGNING_KEY

https://chatgpt.com/share/693a76a0-e408-800f-9939-868524cbef4d
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-11 08:45:07 +01:00
parent 0a6c2f2988
commit a24a819511
89 changed files with 125 additions and 38 deletions

55
packaging/debian/rules Executable file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/make -f
%:
dh $@
# ---------------------------------------------------------------------------
# Disable automatic build + tests for Debian package
#
# The package is effectively a wrapper around the project source and the
# Nix flake. We do not need dh_auto_build to invoke the top-level Makefile,
# because that Makefile is meant for developer workflows (venv, setup, etc.)
# and would fail in the minimal build environment.
# ---------------------------------------------------------------------------
override_dh_auto_build:
# No build step required for this package; skip calling the top-level Makefile.
:
override_dh_auto_test:
# We do not run tests as part of the Debian package build.
:
# ---------------------------------------------------------------------------
# Install phase: copy wrapper + init script + full project source
# ---------------------------------------------------------------------------
override_dh_auto_install:
# Create target directories
install -d debian/package-manager/usr/bin
install -d debian/package-manager/usr/lib/package-manager
# Install wrapper
install -m0755 scripts/pkgmgr-wrapper.sh \
debian/package-manager/usr/bin/pkgmgr
# Install shared Nix init script
install -m0755 scripts/init-nix.sh \
debian/package-manager/usr/lib/package-manager/init-nix.sh
# Copy full project source into /usr/lib/package-manager,
# but do not include the debian/ directory itself.
find . -mindepth 1 -maxdepth 1 \
! -name debian \
! -name .git \
-exec cp -a {} debian/package-manager/usr/lib/package-manager/ \;
# Remove packaging-only and development artefacts from the installed tree
rm -rf \
debian/package-manager/usr/lib/package-manager/debian \
debian/package-manager/usr/lib/package-manager/PKGBUILD \
debian/package-manager/usr/lib/package-manager/Dockerfile \
debian/package-manager/usr/lib/package-manager/.git \
debian/package-manager/usr/lib/package-manager/.github \
debian/package-manager/usr/lib/package-manager/tests \
debian/package-manager/usr/lib/package-manager/.gitignore \
debian/package-manager/usr/lib/package-manager/__pycache__ \
debian/package-manager/usr/lib/package-manager/.gitkeep || true