packaging hy for Debian
=======================

'hy' for Debian is packaged according to the the hylang team,
which kind-of mandates that the repository contains only a
'debian/' directory.
This is the 'master' branch.

For those (like me) who prefer to work with the full (upstream) sources
readily at hand, you can have a traditional patches-unapplied view in
the 'debian/latest' branch.
This is for convenience only, the authoritative branch for packaging is
'master'.


# quick guide for packaging

This is how I (think that I) currently do the packaging for 'hy';
It's *not* a recommended workflow, but just a writeup-as-i-go, so i remember
what to do the next time i need to update this package.

My personal packaging workflow is gbp (patches-unapplied) and 'dgit push-source').

## new upstream release
- Checkout the 'debian/latest' branch
- Import the new upstream:
  ```
  gbp import-orig --uscan
  ```
- continue with the 'new debian release' instructions

## new debian release
- Checkout the 'debian/latest' branch
- Make changes like usual (quilt, debian/)
  - Commit them :-)
- Build/test/... the package with 'gbp buildpackage'
- Once you are satisfied:
  - Upload the package with 'dgit push-source'
  - Fix the git-history
    1. Cherry pick the changes to 'debian/latest' into the 'master' branch
    2. Delete the  'debian/*' tag created by 'dgit' and create a new
       (signed) tag on the 'master' branch
    3. Merge the 'master' branch into 'debian/latest'
    4. push 'master' and 'debian/latest'


    E.g. using the following script (This assumes that the last
    merge-commit on the 'debian/latest' branch was right after the
    last upload on 'master'):

    ```sh
    # on branch 'debian/latest'
    workbranch=$(git rev-parse --abbrev-ref HEAD)
    mergecommit=$(git rev-list --min-parents=2 --max-count=1 HEAD)
    git checkout master
    # on branch 'master'
    git cherry-pick --empty=drop "${mergecommit}..${workbranch}"
    tag=$(git tag --list "debian/*" --sort "-version:refname" | head -1)
    version=$(dpkg-parsechangelog -SVersion)
    git tag -d "${tag}"
    git tag -s -m "hy Debian release ${version}" "${tag}"
    git push
    git checkout "${workbranch}"
    git merge master
    git push
    ```

 -- IOhannes m zmölnig (Debian/GNU) <umlaeute@debian.org>  Wed, 11 Sep 2024 09:20:45 +0200
