Reputation: 5795
When you deal with a big project and you need to create RPM packages for RHEL-based Linux distributions, it's often convenient to sparse your soft into RPM subpackages (for instance: -client, -server, -devel, -debuginfo etc). In this case you can get multiple packages that contain different parts of the project using the only spec file.
I would like to know if this functionality is supported in standard Python packaging modules (setuptools or distutils) in order to build multiple differing rpm packages from one project. I guess that something in my setup.py should correlate to this section of spec file:
%package server
%package client
Upvotes: 1
Views: 542
Reputation: 6907
No, distutils and its derivatives do not support that. You would have two codebases, each with a setup.py script, producing two different sets of sdists/wheels/RPMs. Or you could have one repository with e.g. setup_client.py and setup_server.py scripts (with different package name and list of files to package), but that is less common.
When we were developping distutils2, Tarek Ziadé wrote pypi2rpm to improve upon the bdist_rpm command provided in distutils. There is no recent development, probably because it provides the feature his team needs, but you could contact him and see if he’d accept a pull request adding support for subpackages.
Upvotes: 1