]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %define module template | |
6 | Summary: - | |
7 | Summary(pl.UTF-8): - | |
8 | Name: python-%{module} | |
9 | Version: _ | |
10 | Release: 0.1 | |
11 | License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here) | |
12 | Group: Development/Languages/Python | |
13 | Source0: %{name}-%{version}.tar.gz | |
14 | # Source0-md5: - | |
15 | URL: - | |
16 | # remove BR: python-devel for 'noarch' packages. | |
17 | BuildRequires: python-devel | |
18 | BuildRequires: python-distribute | |
19 | BuildRequires: rpm-pythonprov | |
20 | # if py_postclean is used | |
21 | BuildRequires: rpmbuild(macros) >= 1.219 | |
22 | #Requires: python-libs | |
23 | Requires: python-modules | |
24 | #BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | ||
29 | %description -l pl.UTF-8 | |
30 | ||
31 | %prep | |
32 | %setup -q -n %{module}-%{version} | |
33 | ||
34 | # fix #!/usr/bin/env python -> #!/usr/bin/python: | |
35 | %{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py | |
36 | ||
37 | %build | |
38 | # CC/CFLAGS is only for arch packages - remove on noarch packages | |
39 | CC="%{__cc}" \ | |
40 | CFLAGS="%{rpmcflags}" \ | |
41 | %{__python} setup.py build | |
42 | ||
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
45 | %{__python} setup.py install \ | |
46 | --skip-build \ | |
47 | --optimize=2 \ | |
48 | --root=$RPM_BUILD_ROOT | |
49 | ||
50 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
51 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
52 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
53 | %py_postclean | |
54 | ||
55 | %clean | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %files | |
59 | %defattr(644,root,root,755) | |
60 | %doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO | |
61 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
62 | %{py_sitedir}/*.py[co] | |
63 | %attr(755,root,root) %{py_sitedir}/*.so | |
64 | %if "%{py_ver}" > "2.4" | |
65 | %{py_sitedir}/TEMPLATE-*.egg-info | |
66 | %endif |