3 %bcond_without tests # do not perform "make test"
5 Summary: Convert Python packages to RPM .spec files
11 Source0: http://pypi.python.org/packages/source/p/pyp2rpm/%{name}-%{version}.tar.gz
12 # Source0-md5: 1e9a514d8dab9782f699ded2eb268237
14 # git clone git@bitbucket.org:bkabrda/pyp2rpm.git && cd pyp2rpm
15 # git checkout v1.0.1 && tar czf pyp2rpm-1.0.1-tests.tgz tests/
16 Source1: %{name}-%{version}-tests.tgz
17 # Source1-md5: d6ffe3cd0acb10af01c99a77e6bd51f3
18 Patch0: default-savepath.patch
19 Patch1: no-rpmdev-packager.patch
20 URL: https://pypi.python.org/pypi/pyp2rpm
21 BuildRequires: python-flexmock >= 0.9.3
22 BuildRequires: python-pytest
23 BuildRequires: python-setuptools
24 BuildRequires: rpm-pythonprov
25 BuildRequires: rpmbuild(macros) >= 1.219
26 Requires: python-jinja2
27 Requires: python-setuptools
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Convert Python packages to RPM .spec.
34 Users can provide their own templates for rendering the package
35 metadata. Both the package source and metadata can be extracted from
36 PyPI or from local filesystem (local file doesn't provide that much
43 # Remove bundled egg-info
44 rm -r %{name}.egg-info
47 %{__python} setup.py build
50 PYTHONPATH=$(pwd) py.test
54 rm -rf $RPM_BUILD_ROOT
55 %{__python} setup.py install \
58 --root=$RPM_BUILD_ROOT
63 rm -rf $RPM_BUILD_ROOT
66 %defattr(644,root,root,755)
67 %doc README.rst LICENSE
68 %attr(755,root,root) %{_bindir}/pyp2rpm
69 %{py_sitescriptdir}/%{name}
70 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info