[HN Gopher] Creating Debian packages from upstream Git
       ___________________________________________________________________
        
       Creating Debian packages from upstream Git
        
       Author : JNRowe
       Score  : 68 points
       Date   : 2025-05-26 16:05 UTC (6 hours ago)
        
 (HTM) web link (optimizedbyotto.com)
 (TXT) w3m dump (optimizedbyotto.com)
        
       | dundarious wrote:
       | Compare with Arch, e.g.,
       | https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=gf2-g...,
       | where you just run `makepkg` or `makechrootpkg -r ~/archroot`
       | (setup is just `mkdir -p ~/archroot ; mkarchroot ~/archroot/root
       | base-devel`). The wiki is also wonderful (even for general-
       | linux/non-Arch-specific information) -- informative and to-the-
       | point.
        
         | JNRowe wrote:
         | To be fair, if all you want is _a package_ with Debian you can
         | do that too. Just copy files in to a dir(like package() in your
         | Arch example), write a 10 line DEBIAN /control in there(like
         | the preamble in your Arch example), and call "dpkg-deb
         | --build". The linked document is describing something
         | different, joeyh has a short "why?"1 from years ago that may be
         | helpful.
         | 
         | 1 https://joeyh.name/blog/entry/upstream_git_repositories/
        
           | viraptor wrote:
           | Or use FPM and ignore all the official rules. It will still
           | work. https://github.com/jordansissel/fpm
        
         | LtWorf wrote:
         | And will arch tell you that the package has updated the
         | configuration and that you might want to review your canges
         | with the changes from the new version?
         | 
         | Will it automatially restart the .service file of the daemon
         | you just upgraded? Will it autodetect which python modules it
         | requires to install?
        
           | okanat wrote:
           | Arch/pacman will tell you config changes. There is even an
           | utility called pacdiff to review all of them at once. It will
           | not restart service files since it is a more hands-on distro.
           | Since Arch is a quick rolling-release distro, it is better to
           | reboot your system since ABI stability is not guaranteed.
           | 
           | Arch/pacman packages are quite simple which makes the
           | maintenance burden less. However, when compared to more
           | mainstream distros like OpenSUSE and Fedora, Debian's package
           | recipes are more unwieldy and arcane. Why do we need to put
           | things in the upstream source in the first place? Why do we
           | use scripts that don't make sense and full of legacy in 2025?
           | 
           | I deal with Yocto almost daily, still most Debian packages
           | are a mistery to me. Don't even mention things like getting
           | an almost upstream Linux kernel (like a vanilla release +
           | some patches on top) to be ported as a normal Debian package.
        
           | dundarious wrote:
           | 1. If you mean merging package/upstream config with
           | user/system modified config, yes, run pacdiff
           | 
           | 2. Use needsrestart (isn't this what Debian uses also?)
           | 
           | 3. I don't package python things, I wouldn't know. Maybe,
           | maybe not.
           | 
           | Do the above have different trade offs that are not best fit
           | for everyone? Yes, of course. I used Debian for about a
           | decade, and Arch for almost as long, and have found
           | everything clear and well documented. All the various
           | functionality I want is typically implemented by a simple
           | tool designed for that one job, with a nice wiki page/entry
           | that I could find trivially.
           | 
           | I didn not primarily write my post in order to start a
           | "distribution debate". I had the sense that the contents of
           | debian/ in the OP were not fully given, because there was a
           | lot there, and I wanted to know if that was true, and if so,
           | why.
        
       | mrweasel wrote:
       | This is awesome, well, useful. I have a package I'd like to have
       | in Debian, and I am willing to maintain it, but getting startet
       | is just ... complex.
       | 
       | The whole Debian package infrastructure is remarkable complete
       | and capable, but it's dense and the documentation is not great.
       | The git-buildpackage is barely documented, at least not in a
       | manor which where a newbie can just build a package and be sure
       | that an upgrade will work in the future.
        
         | LtWorf wrote:
         | I think this is a good starting point
         | https://mentors.debian.net/
         | 
         | Also personally I'd avoid using git buildpackage at the
         | beginning since it's rather complicated and not everyone uses
         | it (although those who do are very vocal!)
         | 
         | You don't need git at all, but if you want something easier,
         | create a repo on salsa and keep the debian/ directory there and
         | that's it.
        
       | denkmoon wrote:
       | Just gonna share a tool I found recently that is really awesome
       | for making debs, Debcraft
       | (https://salsa.debian.org/debian/debcraft). It uses podman to
       | isolate the build environment. The author of OP is also a major
       | contributor, even though he barely mentions Debcraft in the post.
        
       ___________________________________________________________________
       (page generated 2025-05-26 23:00 UTC)