diff --git a/.gitignore b/.gitignore index e69de29..04afb77 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +/rpmautospec_core-0.1.0.tar.gz +/rpmautospec_core-0.1.1.tar.gz +/rpmautospec_core-0.1.2.tar.gz +/rpmautospec_core-0.1.3.tar.gz +/rpmautospec_core-0.1.4.tar.gz +/rpmautospec_core-0.1.5.tar.gz diff --git a/README.md b/README.md new file mode 100644 index 0000000..a5e150c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# python-rpmautospec-core + +The python-rpmautospec-core package diff --git a/python-rpmautospec-core.spec b/python-rpmautospec-core.spec new file mode 100644 index 0000000..392eb3f --- /dev/null +++ b/python-rpmautospec-core.spec @@ -0,0 +1,97 @@ +%bcond_with testcoverage + +# Only generate buildrequires or use PEP 518 style building on Fedora and new EPEL releases because +# Poetry is missing elsewhere. Fall back to using setuptools instead. +%if ! 0%{?rhel} || 0%{?epel} >= 10 +%bcond_without genbrs +%bcond_without pyproject_build +%else +%bcond_with genbrs +%bcond_with pyproject_build +%endif + +%if 0%{undefined pyproject_files} +%global pyproject_files %{_builddir}/%{name}-%{version}-%{release}.%{_arch}-pyproject-files +%endif + +%global srcname rpmautospec_core +%global canonicalname rpmautospec-core + +Name: python-%{canonicalname} +Version: 0.1.5 +Release: %autorelease +Summary: Minimum functionality for rpmautospec + +License: MIT +URL: https://github.com/fedora-infra/%{canonicalname} +Source0: %{pypi_source %{srcname}} +BuildArch: noarch +BuildRequires: python3-devel >= 3.6.0 +# The dependencies needed for testing don’t get auto-generated. +BuildRequires: python3dist(pytest) +%if %{with testcoverage} +BuildRequires: python3dist(pytest-cov) +%endif +BuildRequires: sed + +%if %{with genbrs} +%generate_buildrequires +%{pyproject_buildrequires} +%else +BuildRequires: python3dist(pip) +BuildRequires: python3dist(setuptools) +%endif + +%global _description %{expand: +This package contains minimum functionality to determine if an RPM spec file +uses rpmautospec features.} + +%description %_description + +%package -n python3-%{canonicalname} +Summary: %{summary} +%if %{without pyproject_build} +%py_provides python3-%{canonicalname} +%endif + +%description -n python3-%{canonicalname} %_description + +%prep +%autosetup -n %{srcname}-%{version} + +%if %{without testcoverage} +cat << PYTESTINI > pytest.ini +[pytest] +addopts = +PYTESTINI +%endif + +%build +%if %{with pyproject_build} +%pyproject_wheel +%else +%py3_build +%endif + +%install +%if %{with pyproject_build} +%pyproject_install +%pyproject_save_files %{srcname} +# Work around poetry not listing license files as such in package metadata. +sed -i -e 's|^\(.*/LICENSE\)|%%license \1|g' %{pyproject_files} +%else +%py3_install +echo '%{python3_sitelib}/%{srcname}*' > %{pyproject_files} +%endif + +%check +%pytest + +%files -n python3-%{canonicalname} -f %{pyproject_files} +%doc README.md +%if %{without pyproject_build} +%license LICENSE +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..4354f50 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (rpmautospec_core-0.1.5.tar.gz) = ab04ad5f97cc2fafc0ae3064aa2aee1b894c987b8402ecc3709e66bafb1f6c0096844be845036fbceefc3b88b5b1ced277f936a1d5e5f35b252415115bd307bb