1

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 

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Also note that even though distutils2 is stopped, improvements of the Python packaging tools is ongoing, and there may be a discussion of the mapping from source packages to one or more binary packages in the future. For now people are focused on installation and distribution.
unfortunately Tarek Ziadé has not got in contact and there are several unaccepted pull requests for his bdist_rpm2, so it seems like bdist_rpm2 is not intended to be improved. In case if I provide a patch with %package functionality to the distutils upstream, would you support the one?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.