[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to split modules in multiple deb packages



Hello everybody, I'm packaging a daemon that I've developed in python3 and I
need to split the core modules in two deb packages, but I don't now how to do
that.

One of the module is specific for Raspberry Pi, it adds some
functionalities, but
the daemon itself doesn't require a Pi hardware and can still do its job
without that module even on a Pi. What I want to do is to split the modules
in two deb packages, one with all the modules except rpi.py and one with only
rpi.py (setting the appropriate dependencies, i.e. python3-gpiozero, etc).

How can I do that?

I can exclude rpi.py module from main package and create a
python3-mypackage.rpi.install
file installing rpi.py in /usr/lib/python3/mypackage but I don't think it is
the right way of doing that.


This is the source folder:
 mydaemon/
 |-- bin/
 |   `-- mydaemon*
 |
 |-- debian/
 |   |-- changelog
 |   |-- [...]
 |   |-- mydaemon.install
 |   |-- mydaemon.service
 |   |-- python3-mypackage-doc.install
 |   |-- rules*
 |   `-- [...]
 |
 |-- MANIFEST.in
 |-- mypackage/
 |   |-- module1.py
 |   |-- module2.py
 |   |-- moduleN.py
 |   `-- rpi.py
 |
 `-- setup.py

The setup.py file is almost this:
 > setup(name='mydaemon',
 >       packages=['mypackage'],
 >       scripts=['bin/mydaemon'],
 >       install_requires=['python-daemon','jsonschema'])

The MANIFEST.in
 > include setup.py
 > include MANIFEST.in
 > recursive-include mypackage *.py
 > include bin/mydaemon

The debian/rules file contains:
 > dh $@ --with python3,systemd --buildsystem=pybuild


Thanks, bye
Simone


Reply to: