Fossil Forum

chungy 1 week, 1 day ago

Post: Small improvements in the Debian package generator

PACKAGE_VERSION sets the epoch to 9, and the version component comes from the manifest file, separating both the date and time by a period (I think it’s still pretty readable for where it comes from). Sub-second differences in the Fossil timeline won’t be represented (the old one doesn’t represent the real checkout date anyway), but those are so extremely rare I hardly think it’s worth accounting for. fossil version is always available to see anyway.

Debian’s own Fossil package currently has an epoch of 1, so the old script (with an implied epoch 0) would have always installed a version that apt would upgrade to Debian’s own. Setting it to 9 should keep that from happening for many years to come.

fakeroot is invoked for the actual package creation, so that the package installs all the files as owned by root and not the current user invoking the command. This is merely a “Recommends” dependency on dpkg-dev, which is technically optional but you’d have to go out of your way to avoid apt installing it. A commentary note was added to the top of the script to point it out anyway.

It may also help to chmod +x debian/makedeb.sh for convenience.

``` Index: debian/makedeb.sh ================================================================== --- debian/makedeb.sh
+++ debian/makedeb.sh
@@ -1,8 +1,10 @@ #!/bin/bash # A quick hack to generate a Debian package of fossil. i took most of this # from Martin Krafft's "The Debian System" book. + +# Requires dpkg-dev and fakeroot installed.

DEB_REV=${1-1} # .deb package build/revision number. PACKAGE_DEBNAME=fossil THISDIR=${PWD}

@@ -37,11 +39,11 @@

rm -fr DEBIAN mkdir DEBIAN

-PACKAGE_VERSION=$(date +%Y.%m.%d) +PACKAGE_VERSION=9:$(date -ud $(grep ^D "$THISDIR"/../manifest | cut -c 3-)Z +%Y%m%d.%H%M%S) PACKAGE_DEB_VERSION=${PACKAGE_VERSION}-${DEB_REV} DEBFILE=${THISDIR}/${PACKAGE_DEBNAME}-${PACKAGE_DEB_VERSION}-dev-${DEB_ARCH_NAME}.deb PACKAGE_TIME=$(/bin/date)

rm -f ${DEBFILE} @@ -113,11 +115,11 @@ # rm -f ${GZ_CONTROL} ${GZ_DATA} ${DEBFILE} 2>/dev/null # tar cz -C DEBIAN -f ${GZ_CONTROL} . # tar czf ${GZ_DATA} --exclude='/doxygen-' usr # echo '2.0' > debian-binary #ar rcu ${DEBFILE} debian-binary ${GZ_CONTROL} ${GZ_DATA} - dpkg-deb -b ${DEBROOT} ${DEBFILE} + fakeroot dpkg-deb -b ${DEBROOT} ${DEBFILE} echo "Package file created:" ls -la ${DEBFILE} dpkg-deb --info ${DEBFILE} }

``` Z a53a9677c2c8888

stephan 1 week ago

Small improvements in the Debian package generator

That script isn't really still used, is it? That was one of my very earliest commits, back when Ubuntu was my OS of choice but, to the best of my knowledge, it's never actually been used beyond the few months i may have used it back then.

If downstream packagers aren't using this, we really ought to nuke it, rather than update it.

chungy 1 week ago

I thought I'd use it to push out trunk builds to a few Debian machines, but I'd admit it's only a small convenience. I wouldn't shed any tears if it goes away. :-)

Another alternative is to have all the actual debian/rules, debian/control, etc files so that dpkg-buildpackage works. I didn't feel like putting in that much effort. I think an update script would still be necessary so the versioning is "correct" there, and rendering www/changes.wiki to a changelog.html (I think the wiki export command would need to be enhanced to take a file instead of wiki page).

I might whip something to that tune up this weekend, even if it's only for my benefit. There's a good argument none of this ought to be in the upstream repository.

chungy 5 days, 15 hours ago

I ended up whipping it up regardless if anyone else would use it: https://www.chungy.name/debian-packaging.bundle

I went back on the previous idea to set the epoch to 9, and matched it to Debian's epoch of 1 anyway. It was increased in 2011 when Fossil started having actual version numbers and the Debian packager needed to make it upgrade from the date-based ones. It's exceedingly unlikely that it will ever be increased again. The versioning I've set in these files is such that Debian updates to major versions should supersede packages built from these files. 1:2.29~20260405… will always be lesser than 1:2.29-1 per dpkg and apt's rules. I thought it's not entirely unlikely for me (or anyone else) to install a self-made package, forget about it, upgrade Debian, and end up having a new release through that path instead. Z

chungy 2 days, 23 hours ago

Still going along the lines of post 4, I moved my packaging files to their own repository: https://fossil.chungy.name/fossil-debian-packaging/

I've convinced myself that these files don't truly belong in the Fossil repository itself. They may too quickly go outdated or simply unmaintained, and the presence of such files in the upstream repository would likely cause needless headache for the Debian project itself. They'd rather inject their own files, and especially to a different standard: eg, they prefer a dynamic link to libsqlite3.so instead of using the vendored source and a static link.

Though it hasn't happened yet, there's a precedent set that it'd be ok for an RPM script, FreeBSD packaging, Arch Linux PKGBUILD, et al to be included, and that just seems needlessly messy for items that are better managed externally.

As long as Stephan doesn't mind, I would argue in favor of deleting the existing debian/makedeb.sh entirely and remove that precedent. :-)

stephan 2 days, 23 hours ago

I would argue in favor of deleting the existing debian/makedeb.sh entirely and remove that precedent. :-)

Done! Thank you for looking into this.

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button