]> git.pld-linux.org Git - projects/template-specs.git/blob - python.spec
use G: Libraries/Python (python-nose uses it)
[projects/template-specs.git] / python.spec
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 must match the python module/package name (as in 'import' statement)
9 Name:           python-%{module}
10 Version:        _
11 Release:        0.1
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
15 # Source0-md5:  -
16 URL:            -
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
25 #BuildArch:     noarch
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29
30 %description -l pl.UTF-8
31
32 %prep
33 %setup -q -n %{module}-%{version}
34
35 # fix #!/usr/bin/env python -> #!/usr/bin/python:
36 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
37
38 %build
39 # CC/CFLAGS is only for arch packages - remove on noarch packages
40 CC="%{__cc}" \
41 CFLAGS="%{rpmcflags}" \
42 %{__python} setup.py build
43
44 %{?with_tests:%{__python} setup.py test}
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48 %{__python} setup.py install \
49         --skip-build \
50         --optimize=2 \
51         --root=$RPM_BUILD_ROOT
52
53 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
54 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
55
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}
59 %py_postclean
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %files
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
72 %endif
73 %{_examplesdir}/%{name}-%{version}
This page took 0.082289 seconds and 3 git commands to generate.