- Replace underscores and dots with dashes in projects' names
Projects like sphinx_design result in python-sphinx-design.spec
and python3-sphinx-design built RPM name.
- Convert uppercase characters to lowercase
Projects like Pello result in python-pello.spec and python3-pello
built RPM name.
This conforms better with package naming guidelines:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_naming
At least when packaging for Fedora, the fact that the specfile is
generated by pyp2spec is irrelevant as far as the changelog is
concerned. Generally, the initial changelog
entry is "Initial package" or something similar.
Signed-off-by: Maxwell G <gotmax@e.email>
- If the RPM and PyPI version strings differ, they both need to be acquired to
generate a valid spec file: PyPI string is needed for autosetup in %prep and
%pypi_source macro.
- Improve generating %{pypi_source} macro to incorporate the different
version strings if they differ. It not, there's no need to include it.
Instead of error-prone splitting the strings on hyphens, strip the
archive filename from the suffixes and versions, which shall result in
getting the pure archive name.
Refactor obtaining archive filename to traverse the json data just once.
- Include converter based on pyreq2rpm to create valid RPM versions
- For non-compatible versions no transformation is done, such string may
or may not work with RPM
- Test two spec files as generated files (one default, one custom).
This means any change to a template will require just one or two changes
in the files.
- Test each custom field separately, before they're saved to file.
- Remove configs/spec files which only duplicate what was already
tested.
- Sometimes the License keyword contains the full license text instead of
a keyword (indicated by multiline string value).
In this case it's impossible to reliably derive the keyword,
hence such value is discarded.
- Added verbose docstring with License quirks' explanation
Summary can be gotten from upstream metadata or provided via CLI.
If upstream metadata is empty and no argument was provided,
generate an empty summary string to fill in the spec file.