| |
@@ -1,121 +1,97 @@
|
| |
- # Created by pyp2rpm-3.3.2
|
| |
- %global pypi_name userpath
|
| |
-
|
| |
- Name: python-%{pypi_name}
|
| |
- Version: 1.7.0
|
| |
- Release: 2%{?dist}
|
| |
+ Name: python-userpath
|
| |
+ Version: 1.8.0
|
| |
+ Release: %autorelease
|
| |
Summary: Cross-platform tool for adding locations to the user PATH
|
| |
|
| |
- License: MIT OR ASL 2.0
|
| |
+ License: MIT
|
| |
URL: https://github.com/ofek/userpath
|
| |
- Source0: https://files.pythonhosted.org/packages/source/u/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
|
| |
- BuildArch: noarch
|
| |
+ Source0: %{pypi_source userpath}
|
| |
|
| |
- BuildRequires: python3-devel
|
| |
- BuildRequires: python3dist(click)
|
| |
- BuildRequires: python3dist(distro)
|
| |
- BuildRequires: python3dist(pytest)
|
| |
- BuildRequires: python3dist(setuptools)
|
| |
+ # Man pages in groff_man(7) format hand-written for Fedora based on --help
|
| |
+ # output.
|
| |
+ Source10: userpath.1
|
| |
+ Source11: userpath-append.1
|
| |
+ Source12: userpath-prepend.1
|
| |
+ Source13: userpath-verify.1
|
| |
|
| |
- %description
|
| |
- Ever wanted to release a cool new app but found it difficult to add its
|
| |
- location to PATH for users? Me too! This tool does that for you on all major
|
| |
- operating systems and does not require elevated privileges! Fear not, this
|
| |
- only modifies the user PATH; the system PATH is never touched nor even looked
|
| |
- at!
|
| |
+ BuildArch: noarch
|
| |
|
| |
- %package -n python3-%{pypi_name}
|
| |
- Summary: %{summary}
|
| |
- %{?python_provide:%python_provide python3-%{pypi_name}}
|
| |
+ BuildRequires: python3-devel
|
| |
|
| |
- Requires: python3dist(click)
|
| |
- Requires: python3dist(distro)
|
| |
- Requires: python3dist(setuptools)
|
| |
+ # For script in %%generate_buildrequires:
|
| |
+ BuildRequires: python3dist(tomli)
|
| |
|
| |
- %description -n python3-%{pypi_name}
|
| |
- Ever wanted to release a cool new app but found it difficult to add its
|
| |
- location to PATH for users? Me too! This tool does that for you on all major
|
| |
- operating systems and does not require elevated privileges! Fear not, this
|
| |
- only modifies the user PATH; the system PATH is never touched nor even looked
|
| |
- at!
|
| |
+ %global common_description %{expand: \
|
| |
+ Cross-platform tool for adding locations to the user PATH, no elevated
|
| |
+ privileges required!}
|
| |
|
| |
- %prep
|
| |
- %autosetup -n %{pypi_name}-%{version}
|
| |
- # Remove bundled egg-info
|
| |
- rm -rf %{pypi_name}.egg-info
|
| |
+ %description
|
| |
+ %common_description
|
| |
|
| |
- %build
|
| |
- %py3_build
|
| |
|
| |
- %install
|
| |
- %py3_install
|
| |
+ %package -n python3-userpath
|
| |
+ Summary: %{summary}
|
| |
|
| |
- %check
|
| |
- %{__python3} -m pytest
|
| |
+ %description -n python3-userpath
|
| |
+ %common_description
|
| |
|
| |
- %files -n python3-%{pypi_name}
|
| |
- %license LICENSE-APACHE LICENSE-MIT
|
| |
- %doc README.rst
|
| |
- %{_bindir}/%{pypi_name}
|
| |
- %{python3_sitelib}/%{pypi_name}
|
| |
- %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
| |
|
| |
- %changelog
|
| |
- * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-2
|
| |
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
| |
+ %prep
|
| |
+ %autosetup -n userpath-%{version}
|
| |
|
| |
- * Sun Jul 25 2021 Lumír Balhar <lbalhar@redhat.com> - 1.7.0-1
|
| |
- - Update to 1.7.0
|
| |
- Resolves: rhbz#1985646
|
| |
+ # Dev requirements include test requirements; but we want to filter out
|
| |
+ # coverage, linting, etc.
|
| |
+ sed -r '/^(coverage)$/d' requirements-dev.txt > requirements-dev-filtered.txt
|
| |
|
| |
- * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-3
|
| |
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
| |
|
| |
- * Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.6.0-2
|
| |
- - Rebuilt for Python 3.10
|
| |
+ %generate_buildrequires
|
| |
+ # Cannot use -r (the default) with hatchling: “ValueError: build backend cannot
|
| |
+ # provide build metadata (incl. runtime requirements) before build”. We work
|
| |
+ # around this by writing the dependencies from pyproject.toml into a text file.
|
| |
+ #
|
| |
+ # https://github.com/ofek/hatch/issues/128
|
| |
+ '%{python3}' <<EOF
|
| |
+ from tomli import load
|
| |
|
| |
- * Mon May 31 2021 Lumír Balhar <lbalhar@redhat.com> - 1.6.0-1
|
| |
- - Update to 1.6.0
|
| |
- Resolves: rhbz#1965766
|
| |
+ def emit(tomlbase, reqtag, getdeps):
|
| |
+ with open(f'{tomlbase}.toml', 'rb') as cfgfile:
|
| |
+ deps = getdeps(load(cfgfile))
|
| |
+ with open(f'requirements.{reqtag}.txt', 'w') as reqfile:
|
| |
+ reqfile.writelines(f'{dep}\n' for dep in deps)
|
| |
|
| |
- * Mon May 10 2021 Lumír Balhar <lbalhar@redhat.com> - 1.5.0-1
|
| |
- - Update to 1.5.0
|
| |
- Resolves: rhbz#1958519
|
| |
+ emit('pyproject', 'pyproject', lambda cfg: cfg['project']['dependencies'])
|
| |
+ EOF
|
| |
+ %pyproject_buildrequires -R requirements.pyproject.txt requirements-dev-filtered.txt
|
| |
|
| |
- * Thu Feb 18 2021 Lumír Balhar <lbalhar@redhat.com> - 1.4.2-3
|
| |
- - No longer provide the old package name
|
| |
|
| |
- * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-2
|
| |
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
| |
+ %build
|
| |
+ %pyproject_wheel
|
| |
|
| |
- * Mon Jan 18 2021 Lumír Balhar <lbalhar@redhat.com> - 1.4.2-1
|
| |
- - Update to 1.4.2 (#1917150)
|
| |
|
| |
- * Tue Aug 04 2020 Lumír Balhar <lbalhar@redhat.com> - 1.4.1-4
|
| |
- - Fix FTBFS — remove unversioned python macro
|
| |
+ %install
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files userpath
|
| |
|
| |
- * Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-3
|
| |
- - Second attempt - Rebuilt for
|
| |
- https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
| |
+ install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D \
|
| |
+ '%{SOURCE10}' '%{SOURCE11}' '%{SOURCE12}' '%{SOURCE13}'
|
| |
|
| |
- * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-2
|
| |
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
| |
|
| |
- * Wed Jul 01 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.4.1-1
|
| |
- - Update to 1.4.1 (#1851126)
|
| |
+ %check
|
| |
+ # We use pytest directly, since the only contribution of the tox configuration
|
| |
+ # is adding coverage analysis—which we do not want.
|
| |
+ %pytest
|
| |
|
| |
- * Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.4.0-2
|
| |
- - Rebuilt for Python 3.9
|
| |
|
| |
- * Mon May 11 2020 Lumír Balhar <lbalhar@redhat.com> - 1.4.0-1
|
| |
- - Update to 1.4.0 (#1833676)
|
| |
+ %files -n python3-userpath -f %{pyproject_files}
|
| |
+ # The license file is installed in an unusual subdirectory:
|
| |
+ %dir %{python3_sitelib}/userpath-%{version}.dist-info/license_files
|
| |
+ %license %{python3_sitelib}/userpath-%{version}.dist-info/license_files/LICENSE.txt
|
| |
+ %doc HISTORY.rst
|
| |
+ %doc README.md
|
| |
|
| |
- * Sat Feb 08 2020 Lumír Balhar <lbalhar@redhat.com> - 1.3.0-3
|
| |
- - Provide more variants of the old package name
|
| |
+ %{_bindir}/userpath
|
| |
+ %{_mandir}/man1/userpath*.1*
|
| |
|
| |
- * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
|
| |
- - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
| |
|
| |
- * Wed Oct 30 2019 Lumír Balhar <lbalhar@redhat.com> - 1.3.0-1
|
| |
- - Initial package.
|
| |
- - Replacement for python-adduserpath
|
| |
+ %changelog
|
| |
+ %autochangelog
|
| |
First ports to
pyproject-rpm-macros
, then updates to 1.8.0.Requires https://bugzilla.redhat.com/show_bug.cgi?id=2050889 and, transitively, https://bugzilla.redhat.com/show_bug.cgi?id=2050876.
Builds in COPR: https://copr.fedorainfracloud.org/coprs/music/hatchling/builds/