Yes you can bootstrap a Debian root filesystem for a different arch, but that's after someone already did the work before you can do that, which again, is really complex and I have there are better ways to do it now(e.g. adding a new CPU family to Debian)
I wanted to rebuild Debian 2.2 against GCC 3.3 with its better support for SMP and SSE support for an old Pentium 3 workstation I've been playing with. Back then that kind of optimization could yield impressive performance benefits
Unfortunately there's just no documentation for how to rebuild those ancient versions of Debian. The oldest I could find targeted the much newer Debian 4.0 "Etch" which came out in the mid 2000's
All of these bugs are super well-known, written about, and documented.
I never did find a good Deb package cache manager. I simply wrote a script that distributes common packages between my LAN systems as I update them in a serial matter. It works but I wish there was something better. Everything I've tried is either sub-Alpha bugware and incomprehensibly complicated.
It's mind-blowing how complicated it is; at the end of the day it's just an archive. I hate having to do it.
Then I have a "src/DEBIAN" folder with a control file and maybe things like conffiles, postinst, etc.
Control file looks like
Package: mypackage
Version: 1.0.__datestamp__
Architecture: all
Maintainer: My Name <my.name@email.com>
Depends: perl, libcgi-pm-perl, libtimedate-perl, apache2
Section: web
Priority: optional
Installed-Size: 1000
Description: My fun package which does good stuff
Do wonderful things like existing
sed replaces the __datestamp__ line with yyyy.mm.dd.hh.mm.ss, then fakeroot dpkg-deb --build ./src
builds a deb.(I have a larger script which does things like checking out from git, tagging, etc)
- default: https://vaporup.github.io/books/the-pragmatic-sysadmin/debian-packaging/
- quick: https://nfpm.goreleaser.com/usage/