Wednesday, April 13, 2022

[SOLVED] How to explicitly set the name of the rpm-package for python application

Issue

I'm creating a rpm package for my python project using setuptools. In my setup.py I declare the name of the package and the version number Lets say they are: name='myproject' version='0.0.1'

as I run

$python setup.py bdist_rpm

I would assume that my rpm package would be named myproject-0.0.1.noarch.rpm but instead it is myproject-0.0.1-1.noarch.rpm.

In addition, if I use '-' in the version number it is converted to word 'post' in the rpm name. This doesn't make any sense to me.

How can I explicitly set the name of the rpm?

I know that I can edit the .spec file, but that feels kinda sketchy.


Solution

First - the bdist_rpm use quite old template and produce awful rpms. Try to use pyp2rpm instead.

The "-1" you mentioned is release number. It usually start with 1 and is incremented with every change of rpm, but when tar file is intact. I.e. when you add patch or change spec file (e.g change file location). More about it here: https://fedoraproject.org/wiki/Packaging:Versioning#Release_Tag



Answered By - msuchy
Answer Checked By - Cary Denson (WPSolving Admin)