Commit c357ffbc08ded24454ca0c6eb17bcb594326493d

Authored by Davide Madrisan
1 parent 28a476679d
Exists in master

templates/python: multiversion package build

Add the rpm macros required for building both Python2 and Python3 packages
with a single specfile:

  python2:  rpmbuild -ba <specfile>
  python3:  rpmbuild -ba <specfile> --define="with_pyver 3"

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>

Showing 2 changed files with 16 additions and 2 deletions Side-by-side Diff

  1 +Changes in version 1.16.7
  2 +--- --- -- 2016 Madrisan <davide.madrisan(a)gmail.com>
  3 +
  4 ++ improvement
  5 + * templates/python - Davide Madrisan
  6 + Add the rpm macros required for building both Python2 and Python3 packages
  7 + with a single specfile.
  8 +
  9 +-------------------------------------------------------------------------------
  10 +
1 11 Changes in version 1.16.6
2 12 Thu May 07 2015 Madrisan <davide.madrisan(a)gmail.com>
3 13  
... ... @@ -19,6 +19,10 @@
19 19 %description
20 20 %{summary}.
21 21  
  22 +%if 0%{?with_pyver}
  23 +%pyver_package
  24 +%endif
  25 +
22 26 %prep
23 27 %setup -q
24 28  
25 29  
... ... @@ -30,13 +34,13 @@
30 34 %{__python} setup.py install \\
31 35 \ -O1 --skip-build \\
32 36 \ --root="%{buildroot}" \\
33   -\ --install-headers=%{_includedir}/python \
  37 +\ --install-headers=%{python_inc} \
34 38 \ --install-lib=%{python_sitearch} \\
35 39 \ --record=%{name}.filelist
36 40  
37 41 sed -i "\\,\\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
38 42  
39   -%files -f %{name}.filelist
  43 +%files %{?pyappend} -f %{name}.filelist
40 44 %defattr(-,root,root)
41 45 ## note: this list is just an example; modify as required
42 46 # %{python_sitearch}/%{name}.py*