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
Note that propellor still contains a debian/ directory upstream. That has always used debhelper not CDBS. And it uses debian/compat. That's why the cabal file lists those files.
So I would need to either merge your debian/ directory, or remove it from upstream. Any preference? I think I prefer removing it at this point; reviewing your debian/rules I see enough stuff that I'm not up to speed with that I would be blindly copying.
I've merged the Makefile change.
Re the default branch change, I dislike hardcoding a default, so the right choice would probably be for propellor to detect what branch git init creates, and use that. That will be easier said than done; as well as the Makefile, src/Propellor/DotDir.hs hardcodes master in several places.
Apparently last time removing debian/ from upstream came up, the sticking point involved CHANGELOG converting from a symlink to a file breaking propellor's self-build. See 891ba4e31c8c382f7398ec6fd475309015975445
I’m fine with you keeping the debian directory upstream, I can keep the patch removing compat from the propellor.cabal file.
Regarding the branch name, upstream git still uses “master”, wouldn't it be strange to have the local distrepo use whatever the default is, and the full upstream repo use master?
I made some local tests using just HEAD, but it needs more work to test all the upgrade paths.