From 05c069879f7b66250c916161a115e746066b1a2e Mon Sep 17 00:00:00 2001 From: Ben Steffen Date: Sat, 7 Dec 2019 16:27:04 -0500 Subject: [PATCH] Make package use setup.py and update debian files to modern era --- debian/changelog | 17 ++++++++++++----- debian/compat | 2 +- debian/control | 12 +++++++----- debian/{invirt-images.install => install} | 0 debian/rules | 6 ++++-- debian/source/format | 1 + invirt-images => scripts/invirt-images | 2 +- setup.py | 23 +++++++++++++++++++++++ 8 files changed, 49 insertions(+), 14 deletions(-) rename debian/{invirt-images.install => install} (100%) create mode 100644 debian/source/format rename invirt-images => scripts/invirt-images (99%) create mode 100755 setup.py diff --git a/debian/changelog b/debian/changelog index 7bff0d4..87dbf03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,23 +1,30 @@ -invirt-images (0.0.10) precise; urgency=medium +invirt-images (0.0.11) bionic; urgency=medium + + * Make package use setup.py + * Update debian files to modern era + + -- Ben Steffen Sat, 07 Dec 2019 16:24:47 -0500 + +invirt-images (0.0.10) bionic; urgency=medium * Fix Depends: so that it works with an older version of debhelper - -- me Mon, 25 Nov 2019 22:29:27 -0500 + -- Ben Steffen Mon, 25 Nov 2019 22:29:27 -0500 -invirt-images (0.0.9) precise; urgency=medium +invirt-images (0.0.9) bionic; urgency=medium * Rename load_image to update_image -- Ben Steffen Mon, 25 Nov 2019 01:52:32 -0500 -invirt-images (0.0.8) precise; urgency=medium +invirt-images (0.0.8) bionic; urgency=medium * Use argparse instead of optparse * Change cli to resemble git -- Ben Steffen Mon, 25 Nov 2019 01:39:57 -0500 -invirt-images (0.0.7) precise; urgency=medium +invirt-images (0.0.7) bionic; urgency=medium * Port to Python 3 diff --git a/debian/compat b/debian/compat index 7ed6ff8..b4de394 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +11 diff --git a/debian/control b/debian/control index 152c4f0..a2e70fc 100644 --- a/debian/control +++ b/debian/control @@ -1,13 +1,15 @@ Source: invirt-images -Section: base -Priority: extra +Section: libs +Priority: optional Maintainer: Invirt project -Build-Depends: debhelper (>= 7) -Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 11), python3, python3-setuptools, dh-python +Standards-Version: 4.1.4 +X-Python3-Version: >= 3.6 Package: invirt-images Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, python3 >= 3.6.5-2, invirt-database +Depends: ${python3:Depends}, ${misc:Depends}, python3 (>= 3.6), + invirt-database Description: Invirt's tools for managing disk images for VMs These install the tools for managing disk images for Invirt VMs. Images can share common mirrors. The tools include mechanisms diff --git a/debian/invirt-images.install b/debian/install similarity index 100% rename from debian/invirt-images.install rename to debian/install diff --git a/debian/rules b/debian/rules index 4f2c774..340cd18 100755 --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,6 @@ #!/usr/bin/make -f -%: - dh $@ +export PYBUILD_NAME=invirt-images + +%: + 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/invirt-images b/scripts/invirt-images similarity index 99% rename from invirt-images rename to scripts/invirt-images index 5d59438..d087268 100755 --- a/invirt-images +++ b/scripts/invirt-images @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 import os import subprocess diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..d8a18a9 --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +from os import path +from debian_bundle.changelog import Changelog +from debian_bundle.deb822 import Deb822 +from email.utils import parseaddr +from glob import glob +from setuptools import setup, find_packages + +version = Changelog(open(path.join(path.dirname(__file__), 'debian/changelog')).read()).\ + get_version().full_version + +maintainer_full = Deb822(open(path.join(path.dirname(__file__), 'debian/control')))['Maintainer'] +maintainer, maintainer_email = parseaddr(maintainer_full) + +setup( + name='invirt-images', + version=version, + maintainer=maintainer, + maintainer_email=maintainer_full, + + scripts=glob('scripts/*') +) -- 1.7.9.5