]>
Commit | Line | Data |
---|---|---|
57784c4e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %define module bunch | |
6 | Summary: Python dictionary with attribute-style access | |
7 | Name: python-bunch | |
8 | Version: 1.0.1 | |
44cc8c7a | 9 | Release: 3 |
57784c4e ER |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | Source0: http://pypi.python.org/packages/source/b/bunch/bunch-%{version}.tar.gz | |
13 | # Source0-md5: 0a829d64e95ed96defbcae2bf9061bb0 | |
14 | URL: http://github.com/dsc/bunch | |
a243cb9a | 15 | BuildRequires: rpmbuild(macros) >= 1.710 |
57784c4e | 16 | BuildRequires: dos2unix |
57784c4e ER |
17 | BuildRequires: python-nose |
18 | BuildRequires: python-setuptools | |
3390ca0d | 19 | BuildRequires: rpm-pythonprov |
57784c4e ER |
20 | BuildArch: noarch |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
23 | %description | |
24 | python-bunch provides a Python class which can perform as a dict whose | |
25 | keys are also accessible as attributes, similar to JavaScript objects. | |
26 | ||
27 | The piece of python-bunch that sets it apart from similar modules | |
28 | found inside other projects is the bunchify() function which | |
29 | recursively converts from a dict to a Bunch. | |
30 | ||
31 | %prep | |
32 | %setup -q -n %{module}-%{version} | |
33 | dos2unix LICENSE.txt README.rst | |
34 | ||
35 | %build | |
1aec34b1 | 36 | %py_build |
57784c4e ER |
37 | |
38 | %if %{with tests} | |
44cc8c7a JR |
39 | PYTHONPATH=buidl-2/lib nosetests-%{py_ver} --with-doctest |
40 | PYTHONPATH=build-2/lib %{__python} build-2/lib/bunch/test.py | |
57784c4e ER |
41 | %endif |
42 | ||
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
1aec34b1 | 45 | %py_install |
57784c4e ER |
46 | |
47 | rm $RPM_BUILD_ROOT%{py_sitescriptdir}/bunch/test.* | |
48 | ||
49 | %py_postclean | |
50 | ||
51 | %clean | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | ||
54 | ||
55 | %files | |
56 | %defattr(644,root,root,755) | |
57 | %doc LICENSE.txt README.rst | |
58 | %{py_sitescriptdir}/bunch | |
59 | %{py_sitescriptdir}/bunch-%{version}-py*.egg-info |