python-setuptools-git-versi.../python-setuptools-git-versioning.spec
2025-02-11 09:06:12 +08:00

81 lines
2.5 KiB
RPMSpec
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

%global _empty_manifest_terminate_build 0
%global pypi_name setuptools-git-versioning
Name: python-%{pypi_name}
Version: 2.1.0
Release: 1
Summary: Use git repo data for building a version number according PEP-440
License: MIT
URL: https://github.com/dolfinus/setuptools-git-versioning
Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%global _description %{expand:
Use git repo data (latest tag, current commit hash, etc) for building a version
number according PEP 440.
Features:
- Can be installed & configured through both setup.py and PEP 518s
pyproject.toml
- Does not require to change source code of the project
- Tag-, file-, and callback-based versioning schemas are supported
- Templates for tag, dev and dirty versions are separated
- Templates support a lot of substitutions including git and environment
information
- Well-documented
Limitations:
- Currently the only supported VCS is Git
- Only git v2 is supported
- Currently does not support automatic exporting of package version to a file
for runtime use (but you can use setuptools-git-versioning > file redirect
instead)
}
%description %_description
%package -n python3-setuptools-git-versioning
Summary: Support for physical quantities with units, based on numpy
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-hatchling
# man page
BuildRequires: help2man
%description -n python3-setuptools-git-versioning %_description
%prep
%autosetup -n %{pypi_name}-%{version}
%build
%pyproject_build
%install
%pyproject_install
for binary in setuptools-git-versioning
do
echo "Generating man page for ${binary// /-/}"
PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python3_sitelib}/" PATH="$PATH:%{buildroot}/%{_bindir}/" help2man --no-info --no-discard-stderr --name="${binary}" --version-string="${binary} %{version}" --output="${binary// /-}.1" "${binary}"
cat "${binary// /-}.1"
install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary// /-}.1"
done
%files -n python3-setuptools-git-versioning
%doc README.rst
%license LICENSE
%{python3_sitelib}/__pycache__/*.pyc
%{python3_sitelib}/setuptools_git_versioning.py
%{python3_sitelib}/setuptools_git_versioning-*.dist-info/
%{_bindir}/setuptools-git-versioning
%{_mandir}/man1/setuptools-git-versioning.*
%changelog
* Mon Feb 10 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 2.1.0-1
- Initial package.