From e162e7d580ee08f2286c7468018e9a727e5fe3c4 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Thu, 18 Dec 2014 23:51:59 +0000 Subject: [PATCH] Port ubuntutools library --- debian/control | 32 +++++++++++++++++++++++++++++++- debian/rules | 19 ++++++++++--------- setup.py | 20 +++++++++++++------- 3 files changed, 54 insertions(+), 17 deletions(-) diff --git a/debian/control b/debian/control index e5249b8..b915eec 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Vcs-Bzr: lp:ubuntu-dev-tools Vcs-Browser: https://code.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk Build-Depends: dctrl-tools, debhelper (>= 9), + dh-python, devscripts (>= 2.11.0~), distro-info (>= 0.2~), libwww-perl, @@ -21,8 +22,17 @@ Build-Depends: dctrl-tools, python-launchpadlib (>= 1.5.7), python-setuptools, python-soappy, - python-unittest2 + python-unittest2, + python3-all, + python3-apt, + python3-debian, + python3-distro-info, + python3-httplib2, + python3-launchpadlib, + python3-setuptools, + python3-soappy, X-Python-Version: >= 2.6 +X-Python3-Version: >= 3.2 Homepage: https://launchpad.net/ubuntu-dev-tools Standards-Version: 3.9.5 @@ -113,3 +123,23 @@ Description: useful tools for Ubuntu developers - ubuntu-upload-permission - query / list the upload permissions for a package. - update-maintainer - script to update maintainer field in ubuntu packages. + +Package: python-ubuntutools +Architecture: all +Depends: ${python:Depends} +Breaks: ubuntu-dev-tools (<< 0.154) +Replaces: ubuntu-dev-tools (<< 0.154) +Description: useful library of APIs for Ubuntu developer tools (Python 2) + This package ships a collection of APIs, helpers and wrappers used to + develop useful utiliteis for Ubuntu developers. + . + Python 2 variant. + +Package: python3-ubuntutools +Architecture: all +Depends: ${python3:Depends} +Description: useful library of APIs for Ubuntu developer tools + This package ships a collection of APIs, helpers and wrappers used to + develop useful utiliteis for Ubuntu developers. + . + Python 3 variant. diff --git a/debian/rules b/debian/rules index da314d6..9baf9c1 100755 --- a/debian/rules +++ b/debian/rules @@ -1,12 +1,13 @@ #!/usr/bin/make -f -%: - dh $@ --with python2 +export PYBUILD_NAME=ubuntutools -ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) -override_dh_auto_test: - set -e; \ - for python in $(shell pyversions -r); do \ - $$python setup.py test; \ - done -endif +%: + dh $@ --with python2,python3 --buildsystem=pybuild + +override_dh_install: + dh_install + mkdir -p debian/ubuntu-dev-tools/usr + mv debian/python-ubuntutools/etc debian/ubuntu-dev-tools + mv debian/python-ubuntutools/usr/bin debian/ubuntu-dev-tools/usr/ + mv debian/python-ubuntutools/usr/share debian/ubuntu-dev-tools/usr/ diff --git a/setup.py b/setup.py index 8b0163f..b7f55e3 100755 --- a/setup.py +++ b/setup.py @@ -4,6 +4,7 @@ from setuptools import setup import glob import os import re +import sys # look/set what version we have changelog = "debian/changelog" @@ -13,7 +14,11 @@ if os.path.exists(changelog): if match: version = match.group(1) -scripts = ['404main', +if sys.version_info[0] >= 3: + scripts = [] + data_files = [] +else: + scripts = ['404main', 'backportpackage', 'bitesize', 'check-mir', @@ -46,6 +51,12 @@ scripts = ['404main', 'ubuntu-upload-permission', 'update-maintainer', ] + data_files = [ + ('/etc/bash_completion.d', glob.glob("bash_completion/*")), + ('share/man/man1', glob.glob("doc/*.1")), + ('share/man/man5', glob.glob("doc/*.5")), + ('share/ubuntu-dev-tools', ['enforced-editing-wrapper']), + ] if __name__ == '__main__': setup(name='ubuntu-dev-tools', @@ -57,11 +68,6 @@ if __name__ == '__main__': 'ubuntutools/sponsor_patch', 'ubuntutools/test', ], - data_files=[('/etc/bash_completion.d', - glob.glob("bash_completion/*")), - ('share/man/man1', glob.glob("doc/*.1")), - ('share/man/man5', glob.glob("doc/*.5")), - ('share/ubuntu-dev-tools', ['enforced-editing-wrapper']), - ], + data_files=data_files, test_suite='ubuntutools.test.discover', )