Blob Blame History Raw
%global mod_name userpath
%global pypi_name adduserpath

Name:           python-%{pypi_name}
Version:        0.4.0
Release:        7%{?dist}
Summary:        Cross-platform tool for adding locations to the user PATH

License:        MIT or ASL 2.0
URL:            https://github.com/ofek/%{mod_name}
Source0:        https://files.pythonhosted.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  dos2unix

BuildRequires:  python3-devel
BuildRequires:  python3-click
BuildRequires:  python3-pytest
BuildRequires:  python3-setuptools

%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!

%package -n     python3-%{pypi_name}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
 
Requires:       python3-click
Requires:       python3-setuptools
%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! Package contains Python 3 module and executable.

%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# Convert EOL encoding to Unix one
# https://github.com/ofek/userpath/issues/2
dos2unix -v README.rst

%build
%py3_build

%install
%py3_install

%check
%{__python3} -m pytest
# Remove tests from sitelibs
rm -r %{buildroot}%{python3_sitelib}/tests

%files -n python3-%{pypi_name}
%license LICENSE-APACHE LICENSE-MIT
%doc README.rst
%{_bindir}/%{mod_name}
%{python3_sitelib}/%{mod_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%changelog
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Tue Oct 02 2018 Lumír Balhar <lbalhar@redhat.com> - 0.4.0-5
- Remove Python 2 subpackage

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.0-3
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Oct 02 2017 Lumir Balhar <lbalhar@redhat.com> - 0.4.0-1
- Initial package.