From c295a9c09deae50d00778caeb74b79d189f5065f Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sat, 8 Apr 2017 19:04:14 +0100 Subject: [PATCH] wip packaging Organization: Straylight/Edgeware From: Ian Jackson Signed-off-by: Ian Jackson --- .gitignore | 11 +++++++++++ debian/changelog | 6 ++++++ debian/compat | 1 + debian/control | 9 +++++++++ debian/pkg.install | 1 + debian/rules | 6 ++++++ setup.py | 33 +++++++++++++++++++++++++++++++++ 7 files changed, 67 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/pkg.install create mode 100755 debian/rules create mode 100755 setup.py diff --git a/.gitignore b/.gitignore index fd96470..4f7644d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,14 @@ data.dump.dbg tmp srcbomb.tar.gz srcpkgsbomb.tar + +.pybuild +hippotat.egg-info + +debian/files +debian/debhelper-*-stamp +debian/*.debhelper.log +debian/hippotat.substvars +debian/hippotat.*.debhelper + +debian/hippotat/ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..298792c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +hippotat (0.1~UNRELEASED) unstable; urgency=medium + + * + + -- Ian Jackson Sat, 08 Apr 2017 17:57:42 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..13247e4 --- /dev/null +++ b/debian/control @@ -0,0 +1,9 @@ +Source: hippotat +Build-Depends: dh-python, python3 +Maintainer: Ian Jackson + +Package: hippotat +Depends: python3, ${python3:Depends} +Architecture: all +Description: Asinine IP Over HTTP + tbd diff --git a/debian/pkg.install b/debian/pkg.install new file mode 100644 index 0000000..51a1828 --- /dev/null +++ b/debian/pkg.install @@ -0,0 +1 @@ +hippotatlib/*.py diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..d087b53 --- /dev/null +++ b/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f + +export PYBUILD_INSTALL_DIR=/usr/share/hippotat/python3 + +%: + dh $@ --with python3 --buildsystem=pybuild diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..60c5c5d --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 + +from setuptools import setup, find_packages + +import re as regexp +import glob +import sys + +scripts = ['hippotat','hippotatd'] +scan = scripts + glob.glob('hippotatlib/*.py') + +def find_requires(): + mod_pat = r'[._0-9a-zA-Z]+' + res = list(map(regexp.compile, + [r'from\s+('+mod_pat+r')\s+import\b', + r'import\s+('+mod_pat+r')\s'])) + reqs = { } + for scanf in scan: + print('scanning %s' % scanf, file=sys.stderr) + for l in open(scanf): + for re in res: + m = re.match(l) + if m is not None: + reqs[m.group(1)] = True + break + print(repr(reqs), file=sys.stderr) + return list(reqs.keys()) + +setup( + name="hippotat", + packages=find_packages(), + requires=find_requires() +) -- [mdw]