Skip to content

Commit 8e560d6

Browse files
tridgeclaude
andcommitted
debian: auto-sync package version from setup.py
Extract version from setup.py at build time using grep and pass to dh_gencontrol, ensuring the debian package version always matches the upstream version. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0f47d02 commit 8e560d6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

debian/rules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
PY3VERS := $(shell py3versions -vs)
88
PY3VER := $(shell py3versions -vd)
99

10+
# Extract version from setup.py to keep debian package version in sync
11+
UPSTREAM_VERSION := $(shell grep '^version = ' setup.py | head -1 | cut -d'"' -f2)
12+
1013
include /usr/share/dpkg/pkg-info.mk
1114

1215
include /usr/share/python3/python.mk
@@ -68,7 +71,7 @@ binary-indep: build install
6871
dh_fixperms -i
6972
dh_installdeb -i
7073
dh_shlibdeps -i
71-
dh_gencontrol -i
74+
dh_gencontrol -i -- -v$(UPSTREAM_VERSION)
7275
dh_md5sums -i
7376
dh_builddeb -i
7477

@@ -87,7 +90,7 @@ binary-arch: build install
8790
dh_fixperms -a
8891
dh_installdeb -a
8992
dh_shlibdeps -a
90-
dh_gencontrol -a
93+
dh_gencontrol -a -- -v$(UPSTREAM_VERSION)
9194
dh_md5sums -a
9295
dh_builddeb -a
9396

0 commit comments

Comments
 (0)