User:JBond (WMF)/dgit
notes to add debian packaging to an existing github repo. for this git repo ill use BGPalerter.
This guide is mostly just https://manpages.debian.org/testing/dgit/dgit-maint-merge.7.en.html but apparently theses commands just don't stick, further i have very little confidence that this will work when i next come to it but perhaps it will be a better starting ground :P
Initial build
Fork the repo and create a debian branch
The first thing to do is fork the repo. Just do this via github in the normal way then clone it locally, add the original remote (this will help later) and create a debian branch. the dgit-maint-merge documents suggest doing everything in main but my preference is to do this in a separate branch (lets see if i change my mind here next time i look at this document)
$ git clone https://github.com/b4ldr/BGPalerter
$ cd BGPalerter
$ # note to self i wonder if using upstream here will confuse other debian tooling
$ git remote add upstream https://github.com/nttgin/BGPalerter
$ git checkout -b debian
debiannise
Next add all the debian files that you need to add and commit them. Adding the Debian files is beyond the scope of this article but you can check this PR. however at the very least create the following files
- debian/source/options
single-debian-patch
auto-commit
- debian/source/format
3.0 (quilt)
generate the latests tarball release
By default the following should create a tarball of the most recent release, this is required by dgit to compare source
$ git deborig
or on the build hosts use uscan
$ uscan --verbose --force-download
building the package
locally
$ dch -n
$ git deborig
$ git debrebase new-upstream $version
$ dgit sbuild
on the build host
$ uscan --verbose --debug --force-download
$ DIST=bookworm pdebuild --debbuildopts -sa
Building New versions
This section is untested and expected to need fixes when i actually come to test it. The first thing you should do is rebase upir debian branch on the upstream remote
$ cd BGPalerter
$ git fetch --all
$ git checkout debian
$ git rebase upstream/main
update the changelog and generate new source file
At this point you should create a new commit to the debian branch to update the change log with the new version. Once complete regenrate the tar ball and in theory you shuold be able to rebuild
$ git deborig
$ dgit build