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 |
|
---|
11 | Summary: PBSUMMARY
|
---|
12 |
|
---|
13 | Name: PBPKG
|
---|
14 | Version: PBVER
|
---|
15 | Release: PBTAGPBSUF
|
---|
16 | License: PBLIC
|
---|
17 | Group: PBGRP
|
---|
18 | Url: PBURL
|
---|
19 | Source: PBREPO/PBSRC
|
---|
20 | BuildArch: noarch
|
---|
21 | #PBPATCHSRC
|
---|
22 |
|
---|
23 | %if %py2
|
---|
24 | #Requires: PBDEP
|
---|
25 | BuildRequires: PBBDEP
|
---|
26 |
|
---|
27 | %description
|
---|
28 | PBDESC
|
---|
29 | python2 version
|
---|
30 | %endif
|
---|
31 |
|
---|
32 | %if %py3
|
---|
33 | %if %py2
|
---|
34 | %package -n python3-%{shortname}
|
---|
35 | %endif
|
---|
36 | #Requires: PBDEP
|
---|
37 | BuildRequires: PBBDEP
|
---|
38 |
|
---|
39 | %if %py2
|
---|
40 | Summary: PBSUMMARY / Python3 version
|
---|
41 | %description -n python3-%{shortname}
|
---|
42 | %else
|
---|
43 | %description
|
---|
44 | %endif
|
---|
45 | PBDESC
|
---|
46 | python3 version
|
---|
47 | %endif
|
---|
48 |
|
---|
49 | %prep
|
---|
50 | %setup -q -n PBPKG-%{version}PBEXTDIR
|
---|
51 | %if %py3
|
---|
52 | cd ..
|
---|
53 | cp -fr PBPKG-%{version}PBEXTDIR python3
|
---|
54 | cd -
|
---|
55 | %endif
|
---|
56 | #PBPATCHCMD
|
---|
57 |
|
---|
58 | %build
|
---|
59 | %if %py2
|
---|
60 | %{__python} setup.py build
|
---|
61 | %endif
|
---|
62 | %if %py3
|
---|
63 | cd ../python3
|
---|
64 | python3 setup.py build
|
---|
65 | cd -
|
---|
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
|
---|
74 | cd ../python3
|
---|
75 | python3 setup.py install -O1 --skip-build --root %{buildroot}
|
---|
76 | cd -
|
---|
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
|
---|
96 | PBLOG
|
---|
Note:
See
TracBrowser
for help on using the repository browser.