1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-19 08:59:33 +03:00
Commit Graph

33 Commits

Author SHA1 Message Date
9dc11ea157 spec: Build python2 package in fedora < 31
Since commit ee0cfbe65c (spec: Unconditionally build python2 on
Fedora) python2-libvirt is not built on any Fedora version.

Fix the spec to drop python2-libvirt on Fedora 31.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2019-09-03 10:42:36 -04:00
5e9d1aa7fa spec: Bump minimum supported Fedora version to 29
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-09 19:11:20 -04:00
ee0cfbe65c spec: Unconditionally build python2 on Fedora
In Fedora we are currently shipping python2 bindings for all builds,
so this conditional is out of date. Fedora 31 may be the time that
python2 bindings are dropped:

https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal

But I think it's better to wait for that to actually happen before
we change this again

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-07-09 19:11:20 -04:00
da3391a135 rpm: use new python macros for build/install rules
The new %py{2,3}_{build,install} macros ensure that the right compiler
and linker flags are used when building python modules.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-04-04 12:37:23 +01:00
8bd4c9374a rpm spec: remove %{extra_release} from spec
The %{extra_release} field was previously populated by data from the old
autobuild.sh file but is no longer used.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-01-22 11:20:04 +00:00
7b4d676065 rpm: update min required rhel/fedora
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:58 +01:00
cc55ae62d7 rpm: add BuildRequires on gcc
The gcc RPM is no longer part of the default build root.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:56 +01:00
5ca2cb0018 rpm: use the versioned python2 macro names
The use of non-versioned python2 macro names is deprecated in Fedora

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-07-23 14:10:37 +01:00
2efd1e9ab2 spec: Remove Group: and %defattr
These are only needed for RHEL5 builds, which are no longer supported

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CMCUBB4SWS3URHTRRS3OPFM4HF5CGKBW/
https://fedoraproject.org/wiki/RPMGroups

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-07-10 13:34:44 -04:00
74eab13a2b Disable Python 2 on future RHEL and Fedora > 29
The end of Python 2 is nearing, so declare when it will be removed
from libvirt Python binding RPMs.

NB, this doesn't imply we'll be removing py2 support from upstream
libvirt-python on the same timeframe - we'll consider what todo
wrt that when upstream Python 2 finally goes EOL.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-23 15:18:51 +00:00
6a9905cc97 Use python*_sitearch macros instead of manually defining the dir
Note we use python_sitearch not python2_sitearch, since the former
is more portable.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:16:01 +00:00
7cb4a80387 Fix filtering of RPM provides for .so files
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:57 +00:00
948d77335e Require libvirt native version matching py version by default
Although we're capable of building against any libvirt >= 0.9.11, 99% of the
time we want RPM builds to be done against matching libvirt version, otherwise
we might silently build against an unexpected/wrong version.

We don't support building against a native libvirt that's newer than the
python binding, since the generator may incorrectly handle new APIs. So use
== instead of >= too.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:54 +00:00
d11f4e4199 Turn on python3 sub-RPMs for RHEL > 7
It is expected that future RHEL-8 will have python3 by default, so enable that.
It is unclear whether python2 will still be available, so leave that enabled
for now.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:52 +00:00
8dfa907b2f Adapt to rename of py2 RPMs from python- to python2- prefix
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:50 +00:00
53a6d49660 Add emacs mode marker to activate rpm-spec highlighting
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:49 +00:00
f6ea01496a Add checks for min supported distros
Be clear about which distros we aim to support with the specfile, so we know
what we can cleanup in the spec later.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:45 +00:00
7cde26caa9 Allow override of which sub-RPMs to build
Allow using

  rpmbuild --define "with_python2 0"

to override the default logic about which python sub-RPMs to build

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:43 +00:00
ba234bd831 Allow disabling of python2 RPM build
With Fedora modularity, it is possible to have add-on repos for multiple
versions of python3. It is thus desirable to be able to build libvirt-python
in these repos, with only the python3 sub-RPMs enabled.

Thus also helps if future RHEL/Fedora drop python2 entirely from their default
repos.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-01-12 18:15:27 +00:00
abce5971b2 Change Obsoletes to an explicit version
We only want to obsolete versions which actually had the
original name, not all future versions.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-09-04 13:13:53 +01:00
49cb00a5eb Fix package name in description of sub-RPMs
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 12:12:24 +01:00
a2e3bb8ea7 Revert "rpm: assume python3 is always available"
This reverts commit b302b6d884.

Only drop the Fedora 18 test - RHEL must still build without
python 3
2017-08-10 12:11:40 +01:00
bbfea06114 rpm: rename packages to python2-libvirt / python3-libvirt
This complies with Fedora naming policy for python packages

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 10:36:26 +01:00
b302b6d884 rpm: assume python3 is always available
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-10 10:36:19 +01:00
7695aa5a3b spec: Install egg-info with rpm package
This was being done due to now deprecated policy and that file should
be installed so that pip can recognize that the packages is already
installed in the system.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2017-05-15 17:58:25 +02:00
e985010674 Add asyncio event loop implementation
This is usable only on python >= 3.4 (or 3.3 with out-of-tree asyncio),
however it should be harmless for anyone with older python versions.

In simplest case, to have the callbacks queued on the default loop:

    >>> import libvirtaio
    >>> libvirtaio.virEventRegisterAsyncIOImpl()

The function is not present on non-compatible platforms.

Signed-off-by: Wojtek Porczyk <woju@invisiblethingslab.com>
2017-04-04 15:28:50 +01:00
8067f0bed0 spec: Don't pull in dependencies for example scripts
If the scripts are marked as executable, RPM magic will scan them
for dependencies, which can pull in python2 for the python3 package
2016-04-20 14:47:48 -04:00
e715a1c86b spec: Reorganize to satisfy buggy spectool
spectool parses a specfile and strips everything but a preamble.
However, if the first section is preceded by %if clause, it keeps it
there which then makes rpmbuild complain about unmatched %if. Let's make
the buggy tool happy by moving sections around so that the first one is
not in any conditional.
2014-07-29 16:24:48 +02:00
959629a801 build: add BuildRequires for python-lxml and python3-lxml
python-lxml is likely always already present anyway (due to so many
packages being dependent on it), but at least on my F20 system,
python3-lxml wasn't installed, leading to a failure of "python
setup.py rpm" without an informative error message.
2014-04-07 15:33:24 +03:00
0eaf951979 Fix nosetests usage with python3
Add RPM deps on python/python3-nose, make RPM build run the
test suite and invoke nosetests using correct python binary

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-04-02 16:33:53 +02:00
c95c635d9b Add python3 to the automated build and RPM
This updates autobuild.sh to test the python3 build process.
The RPM specfile is changed to build a libvirt-python3 RPM
on Fedora > 18

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-12 11:26:11 +00:00
b9579cb6fd Fix misc RPM specfile flaws
Fix the RPM summary line, add placeholder %changelog tag,
make %setup quiet, add Url: tag and filter out bogus
provides and add example programs as docs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-28 11:54:02 +00:00
41562e063e Setup distutils build system
Create a setup.py for building libvirt python code and add
supporting files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-22 15:58:06 +00:00