From 6e63f04a667dd73c8c1d211296d5131880273fe7 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 10 Apr 2024 22:55:15 +0100 Subject: [PATCH] Packaging: Debian packaging machinery. --- .gitignore | 5 +++++ Makefile | 11 ++++++++++- debian/changelog | 5 +++++ debian/control | 20 ++++++++++++++++++++ debian/copyright | 22 ++++++++++++++++++++++ debian/rules | 4 ++++ debian/source/format | 1 + debian/upstream/metadata | 6 ++++++ pyproject.toml | 13 +++---------- 9 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/upstream/metadata diff --git a/.gitignore b/.gitignore index fa45562..c22991b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,8 @@ library/debian/ .coverage .pytest_cache .tox +debian/*.substvars +debian/*.debhelper +debian/.debhelper/ +debian/rpipins +debian/files \ No newline at end of file diff --git a/Makefile b/Makefile index 258be77..a872075 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,10 @@ endif @echo "build: build Python distribution files" @echo "testdeploy: build and upload to test PyPi" @echo "deploy: build and upload to PyPi" - @echo "tag: tag the repository with the current version\n" + @echo "tag: tag the repository with the current version" + @echo "deb-deps: install debian packaging dependencies" + @echo "deb: build a debian package" + @echo "" dev-deps: python3 -m pip install -r requirements-dev.txt @@ -50,3 +53,9 @@ testdeploy: build deploy: nopost build twine upload dist/* + +deb-deps: + sudo apt install debhelper dh-python pybuild-plugin-pyproject + +deb: + dpkg-buildpackage diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..57670fe --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rpipins (1.0.0) UNRELEASED; urgency=medium + + * Initial Release + + -- Phil Wed, 10 Apr 2024 21:03:39 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e3fd80e --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: rpipins +Section: utils +Priority: optional +Maintainer: Phil +Rules-Requires-Root: no +Build-Depends: + debhelper-compat (= 13), python3, pybuild-plugin-pyproject +Standards-Version: 4.6.2 +X-Python3-Version: >= 3.7 +Homepage: https://github.com/pinout-xyz/rpipins +Vcs-Browser: https://github.com/pinout-xyz/rpipins +Vcs-Git: https://github.com/pinout-xyz/rpipins.git + +Package: rpipins +Architecture: all +Depends: + ${misc:Depends}, ${python3:Depends}, python3-rich +Description: A command-line pinout for the Raspberry Pi 5 + A beautiful GPIO pinout and pin function guide for the Raspberry Pi + with live pin config, drive and level monitoring. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..0e20b5f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,22 @@ +Files: + debian/* +Copyright: + 2024 Phil +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..59d615d --- /dev/null +++ b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ --with=python3 --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000..68f4ca1 --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,6 @@ +Bug-Database: https://github.com/pinout-xyz/rpipins/issues +Bug-Submit: https://github.com/pinout-xyz/rpipins/issues/new +Changelog: https://github.com/pinout-xyz/rpipins/blob/master/CHANGELOG.md +# Documentation: https://github.com/pinout-xyz/rpipins/wiki +Repository-Browse: https://github.com/pinout-xyz/rpipins +Repository: https://github.com/pinout-xyz/rpipins.git diff --git a/pyproject.toml b/pyproject.toml index 4329f9e..220b051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,14 @@ [build-system] -requires = ["hatchling", "hatch-fancy-pypi-readme"] +requires = ["hatchling"] build-backend = "hatchling.build" [project] name = "rpipins" -dynamic = ["version", "readme"] +dynamic = ["version"] description = "A command-line pinout for the Raspberry Pi Pico W" license = {file = "LICENSE"} requires-python = ">= 3.7" +readme = {file = "README.md", content-type = "text/markdown"} authors = [ { name = "Philip Howard", email = "pinout@gadgetoid.com" }, ] @@ -62,14 +63,6 @@ exclude = [ "dist" ] -[tool.hatch.metadata.hooks.fancy-pypi-readme] -content-type = "text/markdown" -fragments = [ - { path = "README.md" }, - { text = "\n" }, - { path = "CHANGELOG.md" } -] - [tool.ruff] exclude = [ '.tox',