From max at simplyblock.io Thu Mar 6 16:59:31 2025 From: max at simplyblock.io (Max Schettler) Date: Thu, 6 Mar 2025 16:59:31 +0100 Subject: [git-buildpackage] Questions on packaging a native package using gbp Message-ID: Hi, I am new to Debian packaging and am trying to use `git-buildpackage` to create packages for a relatively simple piece of code. My structure looks like this: - my code resides in a git repository - the (only) branch is 'main' - the repository includes a `debian/`-dir which contains the meta information for packaging - my versions are tagged `vX.Y.Z`. From what I understand, this represents a "native" package. I have tried creating the relevant files, but have trouble piecing the workflow for my use-case together. From what I assume it should look something like this: ``` # Finish work git tag vX.Y.Z gbp dch --commit --release gbp buildpackage # --git-tag? # Push to origin # Publish package ``` Is this workflow roughly correct? I have struggled to get it to work, in particular I have a few specific questions: - Can I configure 'debian-branch' in 'debian/gbp.conf'? It doesn't seem to be picked up from the '[DEFAULT]' section and I have to pass it to both `gbp dch` and `gbp buildpackage`. - How can I convince `gbp dch` to pick up the version? I have tried passing `--git-upstream-tag=v%(version)s` as documented in the man-page, but the option is not known to the tool. Likewise, configuring it in 'debian/gbp.conf' changes nothing. - Does the changelog have to be tracked in the repository or is it possible to regenerate it from scratch on every release? Thanks for the help! Best regards Max Schettler From agx at sigxcpu.org Thu Mar 6 21:52:56 2025 From: agx at sigxcpu.org (Guido =?iso-8859-1?Q?G=FCnther?=) Date: Thu, 6 Mar 2025 21:52:56 +0100 Subject: [git-buildpackage] Questions on packaging a native package using gbp In-Reply-To: References: Message-ID: Hi, On Thu, Mar 06, 2025 at 04:59:31PM +0100, Max Schettler wrote: > Hi, > > I am new to Debian packaging and am trying to use `git-buildpackage` to > create packages for a relatively simple piece of code. My structure looks > like this: > - my code resides in a git repository > - the (only) branch is 'main' > - the repository includes a `debian/`-dir which contains the meta > information for packaging > - my versions are tagged `vX.Y.Z`. > > From what I understand, this represents a "native" package. I have tried > creating the relevant files, but have trouble piecing the workflow for my > use-case together. From what I assume it should look something like this: > > ``` > # Finish work > git tag vX.Y.Z > gbp dch --commit --release > gbp buildpackage # --git-tag? > # Push to origin > # Publish package > ``` > > Is this workflow roughly correct? I have struggled to get it to work, in > particular I have a few specific questions: > - Can I configure 'debian-branch' in 'debian/gbp.conf'? It doesn't seem to > be picked up from the '[DEFAULT]' section and I have to pass it to both `gbp > dch` and `gbp buildpackage`. > - How can I convince `gbp dch` to pick up the version? I have tried passing > `--git-upstream-tag=v%(version)s` as documented in the man-page, but the > option is not known to the tool. Likewise, configuring it in > 'debian/gbp.conf' changes nothing. > - Does the changelog have to be tracked in the repository or is it possible > to regenerate it from scratch on every release? You can commit it at arbitrary times (e.g. after each change or on every release). git-buildpackage itself is a Debian native package so by looking at its configuration and git history and trying the above commands on its cloned repo you should be able to figure out most of the above. We apprecite documentation improvements in case you find anything lacking in that area. Hope that helps! -- Guido > > Thanks for the help! > > Best regards > Max Schettler > _______________________________________________ > git-buildpackage mailing list > git-buildpackage at lists.sigxcpu.org > http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage > From otto at debian.org Thu Mar 6 21:58:34 2025 From: otto at debian.org (=?UTF-8?B?T3R0byBLZWvDpGzDpGluZW4=?=) Date: Thu, 6 Mar 2025 12:58:34 -0800 Subject: [git-buildpackage] Questions on packaging a native package using gbp In-Reply-To: References: Message-ID: Hi! > I am new to Debian packaging and am trying to use `git-buildpackage` to > create packages for a relatively simple piece of code. My structure > looks like this: > - my code resides in a git repository > - the (only) branch is 'main' > - the repository includes a `debian/`-dir which contains the meta > information for packaging > - my versions are tagged `vX.Y.Z`. > > From what I understand, this represents a "native" package. I have > tried creating the relevant files, but have trouble piecing the workflow > for my use-case together. From what I assume it should look something > like this: > > ``` > # Finish work > git tag vX.Y.Z > gbp dch --commit --release > gbp buildpackage # --git-tag? > # Push to origin > # Publish package > ``` > > Is this workflow roughly correct? I have struggled to get it to work, in > particular I have a few specific questions: > - Can I configure 'debian-branch' in 'debian/gbp.conf'? It doesn't seem > to be picked up from the '[DEFAULT]' section and I have to pass it to > both `gbp dch` and `gbp buildpackage`. Yes. As git-buildpackage uses branch 'master' by default you should create a file debian/gbp.conf with the contents: [DEFAULT} debian-branch = main > - How can I convince `gbp dch` to pick up the version? I have tried > passing `--git-upstream-tag=v%(version)s` as documented in the man-page, > but the option is not known to the tool. Likewise, configuring it in > 'debian/gbp.conf' changes nothing. You have no upstream as it is a native package. The version would come directly from debian/changelog. If you share the URL to your git repo I can check it out. > - Does the changelog have to be tracked in the repository or is it > possible to regenerate it from scratch on every release? For Debian packages a debian/changelog is mandatory, so to not maintain one you need to do extra hacks instead or in addition to running git-buildpackage. You could for example generate it right before running the Debian build and then do a binary-only build that does not care about uncommitted changes.