Closed toddrme2178 closed 1 year ago
You need to specify the filename with the -f
parameter to what you want, e.g. python-{packagename}
.spec
@toddrme2178 this guideline is for libraries , python app should be without python- prefix
The issue is that the name in the spec file doesn't match the name of the spec file. So the name of the spec file is "foo.spec", but the name in the spec file is "python-foo". I think that, by default, the two should match. I personally think the "python-foo" form is more common, but that is just me. As long as it is consistent it is okay.
hit the same issue. can this be fixed to generate a correctly names spec file please?
The correctly named filename depends on the kind of package.
No, the name of the spec files depends on the name of the rpm generated, not on the type of package. If the RPM generated is "python-name", then the RPM file name should be "python-name.spec", not "name.spec". If the RPM being generated is "name" for a library, then yes, the spec shild should be "name.spec".
Sadly, the same inconsistency of spec file naming occurs for Fedora, as well.
No, the name of the spec files depends on the name of the rpm generated, not on the type of package.
In most cases (and all that I know) the type of the package defines it's name.
But anyway: What do you propose? I agree that the name of the specfile and the name of the package name should be equal, but what's the default name of the package? How can py2pack know what the name should be?
I think the solution would be to follow the naming guidelines of the package type by default. So if it is an opensuse.spec, it should follow the standard openSUSE python package naming guidelines for the both the spec file and package name. If it is a fedora.spec, it should follow the fedora guidelines for both the package name and the spec file name.
Right now, I tried running the following command:
py2pack generate -t opensuse.spec wheel
The result was a spec file named wheel.spec
with a package named python-wheel
. The package name is correct, but the spec file should be python-wheel.spec
to match openSUSE guidelines.
Currently it defaults to openSUSE.spec, but it is probably possible to detect the current Linux version at runtime and fall back to openSUSE.spec if the detected version isn't already known.
It doesn't have to "detect" the default template. That can be done at py2pack RPM building time. See
sed -i.fedora "s/'opensuse.spec'/'fedora.spec'/g" py2pack/init.py
For openSUSE spec files, the general naming pattern is
python-{packagename}.spec
. py2pack, however, creates spec files named{packagename}.spec
by default, even though the package name inside the spec file ispython-{packagename}
.