Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%define mod_name py2pack

Name:           python-%{mod_name}
Version:        0.6.3
Release:        2%{?dist}
Url:            http://github.com/saschpe/py2pack
Summary:        Generate distribution packages from Python packages on PyPI
License:        GPLv2
Source:         https://pypi.io/packages/source/p/%{mod_name}-%{version}.tar.gz
BuildArch:      noarch


%description
This script allows to generate RPM spec or DEB dsc files from Python modules.
It allows to list Python modules or search for them on the Python Package Index
(PyPI). Conveniently, it can fetch tarballs and change logs making it an
universal tool to package Python modules.

%package -n python2-%{mod_name}
Summary:        Generate distribution packages from Python packages on PyPI
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python-jinja2
BuildRequires:  python-lxml
BuildRequires:  python-requests
BuildRequires:  python-six
Requires:       python-jinja2
Requires:       python-lxml
Requires:       python-requests
Requires:       python-six

%{?python_provide:%python_provide python2-%{mod_name}}

%description -n python2-%{mod_name}
This script allows to generate RPM spec or DEB dsc files from Python modules.
It allows to list Python modules or search for them on the Python Package Index
(PyPI). Conveniently, it can fetch tarballs and change logs making it an
universal tool to package Python modules.


%if 0%{?with_python3}
%package -n python3-%{mod_name}
Summary:        General purpose template engine
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-jinja2
BuildRequires:  python3-lxml
BuildRequires:  python3-requests
BuildRequires:  python3-six
Requires:       python3-jinja2
Requires:       python3-lxml
Requires:       python3-requests
Requires:       python3-six
%{?python_provide:%python_provide python3-%{mod_name}}

%description -n python3-%{mod_name}
This script allows to generate RPM "spec" or DEB "dsc" files from Python modules.
It allows to list Python modules or search for them on the Python Package Index
(PyPI). Conveniently, it can fetch tarballs and change logs making it an
universal tool to package Python modules.
%endif

%prep
%setup -q -n %{mod_name}-%{version}


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif


%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif

mkdir -p  %{buildroot}/%{_mandir}/man1/
mv %{buildroot}/%{_prefix}/man/man1/%{mod_name}.* %{buildroot}/%{_mandir}/man1/
rm -rf %{buildroot}/%{_docdir}/%{mod_name}


%files -n python2-%{mod_name}
%license LICENSE
%doc AUTHORS README.rst
%doc doc/%{mod_name}.html
%{python2_sitelib}/%{mod_name}*
%if !0%{?with_python3}
%{_mandir}/man1/%{mod_name}.1.*
%{_bindir}/%{mod_name}
%endif

%if 0%{?with_python3}
%files -n python3-%{mod_name}
%license LICENSE
%doc AUTHORS README.rst
%doc doc/%{mod_name}.html
%{python3_sitelib}/%{mod_name}*
%{_mandir}/man1/%{mod_name}.1.*
%{_bindir}/%{mod_name}
%endif


%changelog
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.3-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Jul 11 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 0.6.3-1
- Upstream 0.6.3

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 0.4.4-1
- upstream 0.4.4

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.17-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.17-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.17-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Fri May 20 2011 Jerome Soyer <saispo@gmail.com> - 0.3.17-1
- Update to upstream release

* Mon May  9 2011 Jerome Soyer <saispo@gmail.com> - 0.3.15-2
- Fix inconsistent use of macros
- Set properly permission for chmod and install
- Totaly commented out the check section
- Disable python3 build since it's not fixed upstream
- Convert tab into spaces
- Use macro buildroot instead of $RPM_BUILD_ROOT

* Mon May  2 2011 Jerome Soyer <saispo@gmail.com> - 0.3.15-1
- Initial build