Skip to content

Commit

Permalink
Update rules to translate from dpkg to PEP440 version (infra) (#725)
Browse files Browse the repository at this point in the history
Update rules to translate from dpkg to PEP440 version

This removes the (automatically included) -ubuntu or ~ubuntu
version postfix (optional from dpkg but violating PEP440) and
translates the dev annotation (~dev for dpkg) to a valid
PEP440 annotation (.dev)
  • Loading branch information
Hook25 authored Sep 14, 2023
1 parent 0a2f517 commit ef79796
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion checkbox-ng/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ export LANGUAGE=
export NO_PNG_PKG_MANGLE=1
export SRCTOP=checkbox-ng

# DEBVER is the latest version as declared by the changelog
# it is in this form pkg_version~ubuntu(ubuntu_version)
# pkg_version = setuptools_scm where .dev -> ~dev (to make this a valid dpkg version)
# This is not a valid python version, remove the ~ubuntu(ubuntu_version)
# replace ~dev -> .dev as PEP440 mandates
DEBVER := $(shell dpkg-parsechangelog -SVersion)
PYTHON_VERSION := $(shell echo $(DEBVER) | sed 's/.ubuntu.\+//' | sed 's/~dev/.dev/')
export SETUPTOOLS_SCM_PRETEND_VERSION=$(PYTHON_VERSION)

%:
dh $@ --sourcedirectory=$(SRCTOP) --with=python3 --buildsystem=pybuild

# Override dh_install to ensure that console_scripts are in the
# checkbox-ng package and not in the python3-checkbox-ng package.
# Also move the data and test-data directories to usr/share and provide
# Also move the data and test-data directories to usr/share and provide
# symlinks (via python3-checkbox-ng.links) for everything to work.
override_dh_install:
dh_install
Expand Down
9 changes: 9 additions & 0 deletions checkbox-support/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
export PYBUILD_NAME=checkbox-support
export SRCTOP=checkbox-support

# DEBVER is the latest version as declared by the changelog
# it is in this form pkg_version~ubuntu(ubuntu_version)
# pkg_version = setuptools_scm where .dev -> ~dev (to make this a valid dpkg version)
# This is not a valid python version, remove the ~ubuntu(ubuntu_version)
# replace ~dev -> .dev as PEP440 mandates
DEBVER := $(shell dpkg-parsechangelog -SVersion)
PYTHON_VERSION := $(shell echo $(DEBVER) | sed 's/.ubuntu.\+//' | sed 's/~dev/.dev/')
export SETUPTOOLS_SCM_PRETEND_VERSION=$(PYTHON_VERSION)

%:
dh $@ --sourcedirectory=$(SRCTOP) --with=python3 --buildsystem=pybuild

0 comments on commit ef79796

Please sign in to comment.