From fa947cb9ac3ec9c640de594aaba98636c7edd0ba Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Thu, 2 Jul 2026 10:53:47 +0200 Subject: [PATCH] Changes for building dpkg --- .github/workflows/build_package.yml | 41 +++++++++++++++++++++++++++++ dpkg/compat | 2 +- dpkg/control | 2 +- dpkg/python3-pytsk3.install | 1 + dpkg/rules | 2 +- dpkg/source/format | 2 +- dpkg/source/local-options | 5 ++++ 7 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build_package.yml create mode 100644 dpkg/python3-pytsk3.install create mode 100644 dpkg/source/local-options diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml new file mode 100644 index 0000000..0baf923 --- /dev/null +++ b/.github/workflows/build_package.yml @@ -0,0 +1,41 @@ +# Build packages from source. +name: build_package +on: + pull_request: + push: +permissions: read-all +jobs: + build_dpkg: + runs-on: ubuntu-latest + strategy: + matrix: + version: ['26.04'] + container: + image: ubuntu:${{ matrix.version }} + steps: + - name: Set up container + env: + DEBIAN_FRONTEND: noninteractive + run: | + apt update -q + apt install -y libterm-readline-gnu-perl locales software-properties-common + locale-gen en_US.UTF-8 + ln -f -s /usr/share/zoneinfo/UTC /etc/localtime + - name: Install build dependencies + run: | + apt update -q + apt install -y autoconf automake autopoint autotools-dev build-essential debhelper dh-autoreconf dh-python fakeroot git libtool pkg-config python3 python3-build python3-dev python3-setuptools python3-venv pybuild-plugin-pyproject + - uses: actions/checkout@v6 + - name: Build from source + run: | + git config --global --add safe.directory '*' + python3 utils/update_source.py + python3 -m build --sdist + - name: Build dpkg + run: | + PACKAGE=`ls -1 dist/*.tar.gz | head -n1` + PACKAGE=`basename "${PACKAGE}"` + PACKAGE_ORIG=`echo "${PACKAGE%.tar.gz}.orig.tar.gz" | tr '-' '_'` + mv "dist/${PACKAGE}" "../${PACKAGE_ORIG}" + cp -rf dpkg debian + dpkg-buildpackage -rfakeroot diff --git a/dpkg/compat b/dpkg/compat index ec63514..b1bd38b 100644 --- a/dpkg/compat +++ b/dpkg/compat @@ -1 +1 @@ -9 +13 diff --git a/dpkg/control b/dpkg/control index 9dd4ebd..b829fad 100644 --- a/dpkg/control +++ b/dpkg/control @@ -2,7 +2,7 @@ Source: pytsk3 Section: python Priority: extra Maintainer: Joachim Metz -Build-Depends: debhelper (>= 9), dh-autoreconf, dh-python, python3-all (>= 3.10~), python3-all-dev, python3-setuptools +Build-Depends: debhelper (>= 13), dh-autoreconf, dh-python, python3-dev, python3-setuptools, pybuild-plugin-pyproject Standards-Version: 3.9.5 X-Python3-Version: >= 3.10 Homepage: https://github.com/py4n6/pytsk/ diff --git a/dpkg/python3-pytsk3.install b/dpkg/python3-pytsk3.install new file mode 100644 index 0000000..fef6392 --- /dev/null +++ b/dpkg/python3-pytsk3.install @@ -0,0 +1 @@ +/usr/lib/python3* diff --git a/dpkg/rules b/dpkg/rules index 3abfa2c..02cb8bd 100755 --- a/dpkg/rules +++ b/dpkg/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ --buildsystem=python3 --with=autoreconf,python3 + dh $@ --buildsystem=pybuild --with=autoreconf,python3 .PHONY: override_dh_auto_test override_dh_auto_test: diff --git a/dpkg/source/format b/dpkg/source/format index d3827e7..163aaf8 100644 --- a/dpkg/source/format +++ b/dpkg/source/format @@ -1 +1 @@ -1.0 +3.0 (quilt) diff --git a/dpkg/source/local-options b/dpkg/source/local-options new file mode 100644 index 0000000..73b1e87 --- /dev/null +++ b/dpkg/source/local-options @@ -0,0 +1,5 @@ +extend-diff-ignore = "(^|/)\.git($|/)" +extend-diff-ignore = "(^|/)\.github($|/)" +extend-diff-ignore = "(^|/)\.pylintrc$" +extend-diff-ignore = "(^|/)sleuthkit($|/)" +extend-diff-ignore = "(^|/)tox\.ini$"