source: ProjectBuilder/projects/python-formats/pbconf/python-formats/rpm/python-formats.spec@ 2478

Last change on this file since 2478 was 2478, checked in by Bruno Cornec, 4 years ago

Fix python-formats build with the 2 python versions when needed

File size: 1.5 KB
Line 
1#
2# $Id$
3#
4# Used if virtual name != real name (perl, ...) - replace PBPKG by PBREALPKG in the line below
5%define srcname PBPKG
6%define shortname formats
7%define py3 PBPY3
8%define py2 PBPY2
9%define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
10
11Summary: PBSUMMARY
12
13Name: PBPKG
14Version: PBVER
15Release: PBTAGPBSUF
16License: PBLIC
17Group: PBGRP
18Url: PBURL
19Source: PBREPO/PBSRC
20BuildArch: noarch
21#PBPATCHSRC
22
23%if %py2
24#Requires: PBDEP
25BuildRequires: PBBDEP
26
27%description
28PBDESC
29python2 version
30%endif
31
32%if %py3
33%if %py2
34%package -n python3-%{shortname}
35%endif
36#Requires: PBDEP
37BuildRequires: PBBDEP
38
39%if %py2
40Summary: PBSUMMARY / Python3 version
41%description -n python3-%{shortname}
42%else
43%description
44%endif
45PBDESC
46python3 version
47%endif
48
49%prep
50%setup -q -n PBPKG-%{version}PBEXTDIR
51%if %py3
52cd ..
53cp -fr PBPKG-%{version}PBEXTDIR python3
54cd -
55%endif
56#PBPATCHCMD
57
58%build
59%if %py2
60%{__python} setup.py build
61%endif
62%if %py3
63cd ../python3
64python3 setup.py build
65cd -
66%endif
67
68%install
69%{__rm} -rf %{buildroot}
70%if %py2
71%{__python} setup.py install -O1 --skip-build --root %{buildroot}
72%endif
73%if %py3
74cd ../python3
75python3 setup.py install -O1 --skip-build --root %{buildroot}
76cd -
77%endif
78
79%if %py2
80%files
81%doc README.rst
82%{python_sitelib}/*
83%endif
84
85%if %py3
86%if %py2
87%files -n python3-%{shortname}
88%else
89%files
90%endif
91%doc README.rst
92%{python3_sitelib}/*
93%endif
94
95%changelog
96PBLOG
Note: See TracBrowser for help on using the repository browser.