3 %bcond_without tests # do not perform "make test"
5 %define module template
8 # Name must match the python module/package name (as in 'import' statement)
12 License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
13 Group: Libraries/Python
14 Source0: %{name}-%{version}.tar.gz
17 # remove BR: python-devel for 'noarch' packages.
18 BuildRequires: python-devel
19 BuildRequires: python-distribute
20 BuildRequires: rpm-pythonprov
21 # if py_postclean is used
22 BuildRequires: rpmbuild(macros) >= 1.219
23 #Requires: python-libs
24 Requires: python-modules
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %description -l pl.UTF-8
33 %setup -q -n %{module}-%{version}
35 # fix #!/usr/bin/env python -> #!/usr/bin/python:
36 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
39 # CC/CFLAGS is only for arch packages - remove on noarch packages
41 CFLAGS="%{rpmcflags}" \
42 %{__python} setup.py build
44 %{?with_tests:%{__python} setup.py test}
47 rm -rf $RPM_BUILD_ROOT
48 %{__python} setup.py install \
51 --root=$RPM_BUILD_ROOT
53 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
54 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
56 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
57 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
58 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
62 rm -rf $RPM_BUILD_ROOT
65 %defattr(644,root,root,755)
66 %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
67 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
68 %{py_sitedir}/*.py[co]
69 %attr(755,root,root) %{py_sitedir}/*.so
70 %if "%{py_ver}" > "2.4"
71 %{py_sitedir}/TEMPLATE-*.egg-info
73 %{_examplesdir}/%{name}-%{version}