]>
Commit | Line | Data |
---|---|---|
20e72201 ER |
1 | # |
2 | # Conditional build: | |
c1f92037 | 3 | %bcond_without tests # do not perform "make test" |
20e72201 ER |
4 | |
5 | Summary: Convert Python packages to RPM .spec files | |
6 | Name: pyp2rpm | |
7 | Version: 1.0.1 | |
8 | Release: 1 | |
14705ca7 ER |
9 | License: MIT |
10 | Group: Applications | |
20e72201 ER |
11 | Source0: http://pypi.python.org/packages/source/p/pyp2rpm/%{name}-%{version}.tar.gz |
12 | # Source0-md5: 1e9a514d8dab9782f699ded2eb268237 | |
13 | # to get tests: | |
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 | |
c1f92037 | 17 | # Source1-md5: d6ffe3cd0acb10af01c99a77e6bd51f3 |
41a9b90b | 18 | Source2: pld.spec.tmpl |
aa1c3d8d | 19 | Patch0: default-savepath.patch |
86badbed | 20 | Patch1: no-rpmdev-packager.patch |
20e72201 | 21 | URL: https://pypi.python.org/pypi/pyp2rpm |
20e72201 | 22 | BuildRequires: python-flexmock >= 0.9.3 |
20e72201 ER |
23 | BuildRequires: python-pytest |
24 | BuildRequires: python-setuptools | |
25 | BuildRequires: rpm-pythonprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.219 | |
27 | Requires: python-jinja2 | |
28 | Requires: python-setuptools | |
29 | BuildArch: noarch | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | Convert Python packages to RPM .spec. | |
34 | ||
35 | Users can provide their own templates for rendering the package | |
36 | metadata. Both the package source and metadata can be extracted from | |
37 | PyPI or from local filesystem (local file doesn't provide that much | |
38 | information though). | |
39 | ||
40 | %prep | |
c1f92037 | 41 | %setup -q |
aa1c3d8d | 42 | %patch0 -p1 |
86badbed | 43 | %patch1 -p1 |
20e72201 ER |
44 | # Remove bundled egg-info |
45 | rm -r %{name}.egg-info | |
46 | ||
41a9b90b ER |
47 | cp -p %{SOURCE2} pyp2rpm/templates/pld.spec |
48 | ||
20e72201 ER |
49 | %build |
50 | %{__python} setup.py build | |
51 | ||
52 | %if %{with tests} | |
53 | PYTHONPATH=$(pwd) py.test | |
54 | %endif | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | %{__python} setup.py install \ | |
59 | --skip-build \ | |
60 | --optimize=2 \ | |
61 | --root=$RPM_BUILD_ROOT | |
62 | ||
63 | %py_postclean | |
64 | ||
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
70 | %doc README.rst LICENSE | |
71 | %attr(755,root,root) %{_bindir}/pyp2rpm | |
41a9b90b ER |
72 | %dir %{py_sitescriptdir}/%{name} |
73 | %{py_sitescriptdir}/%{name}/*.py[co] | |
74 | %dir %{py_sitescriptdir}/%{name}/templates | |
75 | %{py_sitescriptdir}/%{name}/templates/macros.spec | |
76 | %{py_sitescriptdir}/%{name}/templates/fedora.spec | |
77 | %{py_sitescriptdir}/%{name}/templates/mageia.spec | |
78 | %{py_sitescriptdir}/%{name}/templates/pld.spec | |
20e72201 | 79 | %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info |
41a9b90b | 80 |