how can I create a debian package to distribute python modules without using distutils? -


i'm getting myself thoroughly confused how correctly package python3 based application.

my application uses makefile install stuff correct file locations e.g.

/usr/lib/rhythmbox/plugins/foo/myfoo.plugin /usr/lib/rhythmbox/plugins/foo/myfoo/po/translation.mo /usr/lib/rhythmbox/plugins/foo/myfoo_module.py /usr/lib/rhythmbox/plugins/foo/myfoo_module2.py 

i'm not using python distutils setup.py type installation - straightforward sudo make install based method.

when try debian package rules straightforward:

 #!/usr/bin/make -f  %:     dh $@ --parallel --with autoreconf,python3  override_dh_autoreconf:     dh_autoreconf -- ./autogen.sh  override_dh_auto_configure:     dh_auto_configure -- --libdir="\$${exec_prefix}/lib" 

my debian/control file "build-depends" again straightword:

 build-depends: debhelper (>= 9),                dh-autoreconf,                dh-python (>= 1.20130903),                gir1.2-glib-2.0,                gir1.2-gstreamer-1.0,                gir1.2-gtk-3.0,                gir1.2-peas-1.0,                gir1.2-rb-3.0,                gobject-introspection (>= 0.10.0),                intltool (>= 0.35.0),                libglib2.0-dev,                python3 

that works fine - can run debuild -us -uc , creates .deb , when install via sudo dpkg -i myfoo-0.1_all.deb installed in correct file locations.

except 1 small matter - each python module should byte-compiled on installation there subfolder /usr/lib/rhythbox/plugins/foo/__pycache__ containing myfoo_module.pyc , myfoo_module2.pyc

now know cannot byte-compile during build process - debian rules forbid having .deb byte-compiled modules. somehow need debhelper work me.

looking @ debian packaging guide mention stuff cdbs, distutils etc - debhelper examples use syntax like:

 override_dh_auto_install:         dh_auto_install         python setup.py install --root=$(curdir)/debian/$(deb_source) --install-layout=deb) 

... i'm not using distutils setup.py install application.

so i'm must missing pretty obvious - thoughts?

you don't need use distutils or setup.py create valid deb python program; dh_python3 make things easier if were using distutils. since you're not, should proceed if using other python.

since don't know structure is, can't describe exact steps, in general should install right files right places dh_install , create appropriate maintainer scripts whatever work necessary byte-compiling (on install or update) , removing byte-compiled files (on remove or purge). maintainer scripts dh_python3 produces may provide starting point (which can find in files matching /var/lib/dpkg/info/python3-*.postinst , .postrm on system).


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -