Updated build system to use pybuild

- now generates python-pyqtgraph, python3-pyqtgraph, and python-pyqtgraph-doc packages
- `python setup.py sdist deb` works
This commit is contained in:
Luke Campagnola 2014-01-12 23:59:53 -05:00
parent 9a131f763b
commit c8739e5425
11 changed files with 63 additions and 20 deletions

View File

@ -5,4 +5,5 @@ recursive-include doc *.rst *.py *.svg *.png *.jpg
recursive-include doc/build/html * recursive-include doc/build/html *
recursive-include tools * recursive-include tools *
include doc/Makefile doc/make.bat README.md LICENSE.txt CHANGELOG include doc/Makefile doc/make.bat README.md LICENSE.txt CHANGELOG
global-exclude *.pyc

View File

@ -1,5 +0,0 @@
python-pyqtgraph (0.9.1-1) UNRELEASED; urgency=low
* Initial release.
-- Luke <luke.campagnola@gmail.com> Sat, 29 Dec 2012 01:07:23 -0500

View File

@ -3,16 +3,47 @@ Maintainer: Luke Campagnola <luke.campagnola@gmail.com>
Section: python Section: python
Priority: optional Priority: optional
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Build-Depends: debhelper (>= 8) Build-Depends: debhelper (>= 8), python-all (>= 2.6.6-3~), python-setuptools, python3-all, python3-setuptools, python-docutils, python-sphinx (>= 1.0.7+dfsg-1~)
X-Python-Version: >= 2.6
X-Python3-Version: >= 3.2
Package: python-pyqtgraph Package: python-pyqtgraph
Architecture: all Architecture: all
Homepage: http://www.pyqtgraph.org Homepage: http://www.pyqtgraph.org
Depends: python (>= 2.6), python-support (>= 0.90), python-qt4 | python-pyside, python-scipy, python-numpy, ${misc:Depends} Depends: python-qt4 | python-pyside, python-scipy, python-numpy, ${python:Depends}, ${misc:Depends}
Suggests: python-opengl, python-qt4-gl Suggests: python-pyqtgraph-doc, python-opengl, python-qt4-gl
Description: Scientific Graphics and GUI Library for Python Description: Scientific Graphics and GUI Library (Python 2)
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 and numpy. PyQtGraph is a pure-python graphics and GUI library built on PyQt4 and numpy.
It is intended for use in mathematics / scientific / engineering applications. It is intended for use in mathematics / scientific / engineering applications.
Despite being written entirely in python, the library is very fast due to its Despite being written entirely in python, the library is very fast due to its
heavy leverage of numpy for number crunching and Qt's GraphicsView framework heavy leverage of numpy for number crunching and Qt's GraphicsView framework
for fast display. for fast display.
.
This is the Python 2 version of the package.
Package: python3-pyqtgraph
Architecture: all
Homepage: http://www.pyqtgraph.org
Depends: python-qt4 | python-pyside, python-scipy, python-numpy, ${python3:Depends}, ${misc:Depends}
Suggests: python-pyqtgraph-doc, python-opengl, python-qt4-gl
Description: Scientific Graphics and GUI Library (Python 3)
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 and numpy.
It is intended for use in mathematics / scientific / engineering applications.
Despite being written entirely in python, the library is very fast due to its
heavy leverage of numpy for number crunching and Qt's GraphicsView framework
for fast display.
.
This is the Python 3 version of the package.
Package: python-pyqtgraph-doc
Architecture: all
Section: doc
Depends: ${sphinxdoc:Depends}, ${misc:Depends}
Description: Scientific Graphics and GUI Library (common documentation)
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 and numpy.
It is intended for use in mathematics / scientific / engineering applications.
Despite being written entirely in python, the library is very fast due to its
heavy leverage of numpy for number crunching and Qt's GraphicsView framework
for fast display.
.
This is the common documentation package.

View File

@ -1 +0,0 @@
python-pyqtgraph_0.9.1-1_all.deb python optional

View File

@ -1,3 +0,0 @@
#!/bin/sh -e
#DEBHELPER#
rm -rf /usr/lib/python2.7/dist-packages/pyqtgraph

View File

@ -0,0 +1 @@
usr/lib/python2*

View File

@ -0,0 +1 @@
usr/lib/python3*

View File

@ -1,4 +1,15 @@
#!/usr/bin/make -f #!/usr/bin/make -f
#export DH_VERBOSE=1
export PYBUILD_NAME=pyqtgraph
%: %:
dh $@ dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
override_dh_installdocs:
PYTHONPATH=`pwd` make -C doc html
dh_installdocs -ppython-pyqtgraph-doc doc/build/html
dh_installdocs -A
override_dh_clean:
dh_clean
find ./ -name "*.pyc" -delete

3
tools/debian/watch Normal file
View File

@ -0,0 +1,3 @@
version=3
opts=uversionmangle=s/(rc|dev|a|b|c)/~$1/ \
https://pypi.python.org/packages/source/p/pyqtgraph/pyqtgraph-(.*)\.(?:tar\.gz|zip|tar\.bz2)

View File

@ -76,5 +76,5 @@ if __name__ == '__main__':
sys.stderr.write('Usage: generateChangelog.py package_name log_file version "Maintainer <maint@email.com>"\n') sys.stderr.write('Usage: generateChangelog.py package_name log_file version "Maintainer <maint@email.com>"\n')
sys.exit(-1) sys.exit(-1)
print generateDebianChangelog(*sys.argv[1:]) print(generateDebianChangelog(*sys.argv[1:]))

View File

@ -114,14 +114,13 @@ def getVersionStrings(pkg):
return version, forcedVersion, gitVersion, initVersion return version, forcedVersion, gitVersion, initVersion
from distutils.core import Command from distutils.core import Command
import shutil, subprocess import shutil, subprocess
from generateChangelog import generateDebianChangelog from generateChangelog import generateDebianChangelog
class DebCommand(Command): class DebCommand(Command):
description = "build .deb package using `debuild -us -uc`" description = "build .deb package using `debuild -us -uc`"
maintainer = "Luke <luke.campagnola@gmail.com>" maintainer = "Luke Campagnola <luke.campagnola@gmail.com>"
debTemplate = "tools/debian" debTemplate = "tools/debian"
debDir = "deb_build" debDir = "deb_build"
@ -150,24 +149,30 @@ class DebCommand(Command):
# copy sdist to build directory and extract # copy sdist to build directory and extract
os.mkdir(debDir) os.mkdir(debDir)
renamedSdist = '%s_%s.orig.tar.gz' % (debName, version) renamedSdist = '%s_%s.orig.tar.gz' % (debName, version)
print("copy %s => %s" % (sdist, os.path.join(debDir, renamedSdist)))
shutil.copy(sdist, os.path.join(debDir, renamedSdist)) shutil.copy(sdist, os.path.join(debDir, renamedSdist))
print("cd %s; tar -xzf %s" % (debDir, renamedSdist))
if os.system("cd %s; tar -xzf %s" % (debDir, renamedSdist)) != 0: if os.system("cd %s; tar -xzf %s" % (debDir, renamedSdist)) != 0:
raise Exception("Error extracting source distribution.") raise Exception("Error extracting source distribution.")
buildDir = '%s/%s-%s' % (debDir, pkgName, version) buildDir = '%s/%s-%s' % (debDir, pkgName, version)
# copy debian control structure # copy debian control structure
print("copytree %s => %s" % (self.debTemplate, buildDir+'/debian'))
shutil.copytree(self.debTemplate, buildDir+'/debian') shutil.copytree(self.debTemplate, buildDir+'/debian')
# Write new changelog # Write new changelog
chlog = generateDebianChangelog(pkgName, 'CHANGELOG', version, self.maintainer) chlog = generateDebianChangelog(pkgName, 'CHANGELOG', version, self.maintainer)
print("write changelog %s" % buildDir+'/debian/changelog')
open(buildDir+'/debian/changelog', 'w').write(chlog) open(buildDir+'/debian/changelog', 'w').write(chlog)
# build package # build package
print('cd %s; debuild -us -uc' % buildDir)
if os.system('cd %s; debuild -us -uc' % buildDir) != 0: if os.system('cd %s; debuild -us -uc' % buildDir) != 0:
raise Exception("Error during debuild.") raise Exception("Error during debuild.")
class TestCommand(Command): class TestCommand(Command):
"""Just for learning about distutils; not for running package tests."""
description = "" description = ""
user_options = [] user_options = []
def initialize_options(self): def initialize_options(self):
@ -177,6 +182,5 @@ class TestCommand(Command):
def run(self): def run(self):
global cmd global cmd
cmd = self cmd = self
print self.distribution.name print(self.distribution.name)
print self.distribution.version print(self.distribution.version)