| 1 |
HOWTO make a python-central based package
|
| 2 |
=========================================
|
| 3 |
|
| 4 |
1) install python-central
|
| 5 |
# echo "deb http://people.debian.org/~doko/pycentral/ ./" >> /etc/apt/sources.list
|
| 6 |
# aptitude update
|
| 7 |
# aptitude install python-central # new python package will be installed as well
|
| 8 |
|
| 9 |
2) fix python-central bug (temporary)
|
| 10 |
# ln -s /usr/bin/py_compilefiles /usr/sbin/py_compilefiles
|
| 11 |
|
| 12 |
3) debian/control content
|
| 13 |
* source package:
|
| 14 |
- add "XS-Python-Version: all" header
|
| 15 |
* binary package:
|
| 16 |
- extend Depends: header with "${pycentral:Depends}"
|
| 17 |
- add "XB-Python-Version: ${pycentral:Versions}" header
|
| 18 |
- change Architecture: to all or any (if package contains .so files)
|
| 19 |
- if previous package version has python2.X-foo packages, add:
|
| 20 |
Conflicts: python2.X-foo (<< version), python2.X-bar (<< version)
|
| 21 |
Replaces: python2.X-foo (<< version), python2.X-bar (<< version)
|
| 22 |
- if there is an external package that depends on python2.X-foo, add:
|
| 23 |
Provides: python2.X-foo
|
| 24 |
* remove all python2.X-foo binary packages
|
| 25 |
|
| 26 |
4) debian/rules
|
| 27 |
* install .py files into root dir: /usr/share/pycentral/$package_name/
|
| 28 |
* install .so files into root dir: /usr/lib/python2.X/
|
| 29 |
* remember to add "--no-compile --single-version-externally-managed "
|
| 30 |
to "python setup.py install" command if you want to provide Egg support
|
| 31 |
* install Egg dir into root dir: /usr/share/pycentral/$package_name/
|
| 32 |
(remove python version from dirname)
|
| 33 |
* add new "pycentral:Versions" and "pycentral:Depends" substvars
|
| 34 |
echo 'pycentral:Versions=2.3, 2.4' >> debian/$package_name.substvars
|
| 35 |
echo 'pycentral:Depends=python (>= 2.3), python (<< 2.5), python-central' \
|
| 36 |
>> debian/$package_name.substvars
|
| 37 |
|
| 38 |
5) debian/postinst content
|
| 39 |
|
| 40 |
#! /bin/sh
|
| 41 |
set -e
|
| 42 |
pycentral pkginstall $package_name
|
| 43 |
#DEBHELPER#
|
| 44 |
exit 0
|
| 45 |
|
| 46 |
6) debian/prerm content
|
| 47 |
|
| 48 |
#! /bin/sh
|
| 49 |
set -e
|
| 50 |
pycentral pkgremove $package_name
|
| 51 |
#DEBHELPER#
|
| 52 |
exit 0
|
| 53 |
|
| 54 |
7) example packages
|
| 55 |
|
| 56 |
# package without .so files
|
| 57 |
http://people.debian.org/~doko/pycentral/pyparallel_0.2-2.diff.gz
|
| 58 |
|
| 59 |
# package with .so files
|
| 60 |
http://people.debian.org/~doko/pycentral/python-imaging_1.1.5-5.diff.gz
|
| 61 |
|
| 62 |
# package with .so files and Egg support
|
| 63 |
http://svn.debian.org/wsvn/python-modules/packages/pyenchant/trunk/debian/ or
|
| 64 |
http://debian.pox.one.pl/pyenchant_1.1.5-2.diff.gz
|
| 65 |
|