Hi!

The debian package changed from CDBS to debhelper, with the haskell add-on, and now uses compat level 13.

This leads to several changes in the propellor sources, first debian/compat has to be dropped from propellor.cabal, because it does not exists anymore and propellor.cabal is read by sdist when building the propellor bundle:

diff --git a/propellor.cabal b/propellor.cabal
index 7adab8ff..13491b94 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -23,7 +23,6 @@ Extra-Source-Files:
   stack.yaml
   debian/changelog
   debian/propellor.README.Debian
-  debian/compat
   debian/control
   debian/copyright
   debian/rules

Then, as dh_haskell builds and installs propellor itself, I split the install rule in two parts. I also had to tune a condition because dh_haskell uses debian/hlibrary.setup instead of ./Setup:

diff --git a/Makefile b/Makefile
index 4351f70f..00c01720 100644
--- a/Makefile
+++ b/Makefile
@@ -9,16 +9,22 @@ build: tags propellor.1 configured
                ln -sf dist/build/propellor-config/propellor-config propellor; \
        fi

-install:
-       install -d $(DESTDIR)/usr/bin $(DESTDIR)/usr/src/propellor
+install: install-bin install-src
+
+install-bin:
+       install -d $(DESTDIR)/usr/bin
        if [ -d dist-newstyle ]; then \
                install -s $$(cabal exec -- sh -c 'command -v propellor') $(DESTDIR)/usr/bin/propellor; \
        else \
                install -s dist/build/propellor/propellor $(DESTDIR)/usr/bin/propellor; \
        fi
+
+install-src:
+       install -d $(DESTDIR)/usr/src/propellor
        mkdir -p gittmp
-       if [ "$(CABAL)" = ./Setup ]; then \
-               ./Setup sdist --output-directory=gittmp; \
+       # cabal outputs an archive while the setup program outputs files
+       if [ -z "$(findstring cabal,$(CABAL))" ]; then \
+               $(CABAL) sdist --output-directory=gittmp; \
        else \
                $(CABAL) sdist -o - | (cd gittmp && tar zx --strip-components=1); \
        fi

Finally, I made a preventive change to git init so it does not break once main became the default. Another solution would have been to use main instead of master:

@@ -32,7 +38,7 @@ install:
        && export GIT_COMMITTER_NAME=build \
        && export GIT_COMMITTER_EMAIL=build@buildhost \
        && export GIT_COMMITTER_DATE="$(DATE)" \
-       && cd gittmp && git init \
+       && cd gittmp && git init -b master \
        && git add . \
        && git commit -q -m "distributed version of propellor" \
        && git bundle create $(DESTDIR)/usr/src/propellor/propellor.git master HEAD \

Do you have an opinion on whether those changes could be made upstream?

I prepared a branch with the Makefile changes at salsa repository here: https://salsa.debian.org/debian/propellor.git branch dh-haskell

I did not include the .cabal change as it would not make sense if you still uses compat level 9.

--Nicolas