]> git.pld-linux.org Git - projects/template-specs.git/blame - python.spec
use G: Libraries/Python (python-nose uses it)
[projects/template-specs.git] / python.spec
CommitLineData
4cdaa512
ER
1#
2# Conditional build:
3%bcond_without tests # do not perform "make test"
4
b81eefa5 5%define module template
7170a7b1
ER
6Summary: -
7Summary(pl.UTF-8): -
3256a2f0 8# Name must match the python module/package name (as in 'import' statement)
b81eefa5 9Name: python-%{module}
7170a7b1
ER
10Version: _
11Release: 0.1
12License: - (enter GPL/GPL v2/GPL v3/LGPL/BSD/BSD-like/other license name here)
6177d217 13Group: Libraries/Python
7170a7b1
ER
14Source0: %{name}-%{version}.tar.gz
15# Source0-md5: -
7170a7b1 16URL: -
dbb3e196 17# remove BR: python-devel for 'noarch' packages.
278010a4 18BuildRequires: python-devel
dbb3e196 19BuildRequires: python-distribute
0a48bf0d 20BuildRequires: rpm-pythonprov
7592d76f
JB
21# if py_postclean is used
22BuildRequires: rpmbuild(macros) >= 1.219
10305643 23#Requires: python-libs
24Requires: python-modules
7170a7b1
ER
25#BuildArch: noarch
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
29
e6f4b058 30%description -l pl.UTF-8
31
7170a7b1 32%prep
641675c1 33%setup -q -n %{module}-%{version}
7170a7b1 34
5a020810
ER
35# fix #!/usr/bin/env python -> #!/usr/bin/python:
36%{__sed} -i -e '1s,^#!.*python,#!%{__python},' %{name}.py
37
7170a7b1 38%build
46094905
ER
39# CC/CFLAGS is only for arch packages - remove on noarch packages
40CC="%{__cc}" \
41CFLAGS="%{rpmcflags}" \
7592d76f 42%{__python} setup.py build
7170a7b1 43
a4ec70eb
ER
44%{?with_tests:%{__python} setup.py test}
45
7170a7b1
ER
46%install
47rm -rf $RPM_BUILD_ROOT
7592d76f 48%{__python} setup.py install \
e7663425 49 --skip-build \
7170a7b1
ER
50 --optimize=2 \
51 --root=$RPM_BUILD_ROOT
52
8424aa58
ER
53install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
54cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
55
9a83d846 56# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
e5a26a61
ER
57%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
58%py_comp $RPM_BUILD_ROOT%{py_sitedir}
59%py_postclean
60
7170a7b1
ER
61%clean
62rm -rf $RPM_BUILD_ROOT
63
7170a7b1
ER
64%files
65%defattr(644,root,root,755)
66%doc AUTHORS CREDITS ChangeLog NEWS README THANKS TODO
9a83d846 67# change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
e5a26a61
ER
68%{py_sitedir}/*.py[co]
69%attr(755,root,root) %{py_sitedir}/*.so
ef0b62a1 70%if "%{py_ver}" > "2.4"
47501bae 71%{py_sitedir}/TEMPLATE-*.egg-info
ef278603 72%endif
8424aa58 73%{_examplesdir}/%{name}-%{version}
This page took 0.040692 seconds and 4 git commands to generate.