Package DNF plugin for both python2 and python3
DNF in Fedora 22 uses python2, but in Fedora 23 - python3. Package both of them, in separate packages (according to Fedora packaging guidelines) and depend on the right one depending on target distribution version. Fixes QubesOS/qubes-issues#1529
This commit is contained in:
parent
8f0a024f6d
commit
2478cb5c05
12
Makefile
12
Makefile
@ -10,6 +10,8 @@ SYSLIBDIR ?= /lib
|
|||||||
|
|
||||||
PYTHON = /usr/bin/python2
|
PYTHON = /usr/bin/python2
|
||||||
PYTHON_SITEARCH = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)'`
|
PYTHON_SITEARCH = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1)'`
|
||||||
|
PYTHON2_SITELIB = `python2 -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()'`
|
||||||
|
PYTHON3_SITELIB = `python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())'`
|
||||||
|
|
||||||
# This makefile uses some bash-isms, make uses /bin/sh by default.
|
# This makefile uses some bash-isms, make uses /bin/sh by default.
|
||||||
SHELL = /bin/bash
|
SHELL = /bin/bash
|
||||||
@ -131,11 +133,9 @@ install-rh: install-systemd install-systemd-dropins install-sysvinit
|
|||||||
$(DESTDIR)/usr/lib/dracut/dracut.conf.d/30-qubes.conf
|
$(DESTDIR)/usr/lib/dracut/dracut.conf.d/30-qubes.conf
|
||||||
|
|
||||||
install -D -m 0644 misc/dnf-qubes-hooks.py \
|
install -D -m 0644 misc/dnf-qubes-hooks.py \
|
||||||
$(DESTDIR)/usr/lib/python2.7/site-packages/dnf-plugins/qubes-hooks.py
|
$(DESTDIR)$(PYTHON2_SITELIB)/dnf-plugins/qubes-hooks.py
|
||||||
install -D -m 0644 misc/dnf-qubes-hooks.pyc \
|
install -D -m 0644 misc/dnf-qubes-hooks.py \
|
||||||
$(DESTDIR)/usr/lib/python2.7/site-packages/dnf-plugins/qubes-hooks.pyc
|
$(DESTDIR)$(PYTHON3_SITELIB)/dnf-plugins/qubes-hooks.py
|
||||||
install -D -m 0644 misc/dnf-qubes-hooks.pyo \
|
|
||||||
$(DESTDIR)/usr/lib/python2.7/site-packages/dnf-plugins/qubes-hooks.pyo
|
|
||||||
install -D -m 0644 misc/dnf-qubes-hooks.conf $(DESTDIR)/etc/dnf/plugins/qubes-hooks.conf
|
install -D -m 0644 misc/dnf-qubes-hooks.conf $(DESTDIR)/etc/dnf/plugins/qubes-hooks.conf
|
||||||
|
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ install-common:
|
|||||||
ifeq ($(shell lsb_release -is), Debian)
|
ifeq ($(shell lsb_release -is), Debian)
|
||||||
install -m 0644 misc/xdg.py $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
|
install -m 0644 misc/xdg.py $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
|
||||||
else
|
else
|
||||||
install -m 0644 misc/xdg.py* $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
|
install -m 0644 misc/py2/xdg.py* $(DESTDIR)/$(PYTHON_SITEARCH)/qubes/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
install -d $(DESTDIR)/mnt/removable
|
install -d $(DESTDIR)/mnt/removable
|
||||||
|
@ -11,8 +11,21 @@ xenstore-watch: xenstore-watch.o
|
|||||||
$(CC) -o xenstore-watch xenstore-watch.o -lxenstore
|
$(CC) -o xenstore-watch xenstore-watch.o -lxenstore
|
||||||
close-window: close-window.c
|
close-window: close-window.c
|
||||||
$(CC) -o $@ $< -lX11
|
$(CC) -o $@ $< -lX11
|
||||||
python:
|
python: python2 python3
|
||||||
python -m compileall .
|
python2:
|
||||||
python -O -m compileall .
|
rm -rf py2
|
||||||
|
mkdir -p py2
|
||||||
|
cp *.py py2/
|
||||||
|
python2 -m compileall py2
|
||||||
|
python2 -O -m compileall py2
|
||||||
|
|
||||||
|
# Only some scripts does support python3 for now
|
||||||
|
python3:
|
||||||
|
rm -rf py3
|
||||||
|
mkdir -p py3
|
||||||
|
cp dnf-qubes-hooks.py xdg.py py3/
|
||||||
|
python3 -m compileall py3
|
||||||
|
python3 -O -m compileall py3
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f xenstore-watch *.o *~ *.pyc *.pyo
|
rm -f xenstore-watch *.o *~ *.pyc *.pyo
|
||||||
|
@ -68,6 +68,11 @@ Requires: pygtk2
|
|||||||
Requires: zenity
|
Requires: zenity
|
||||||
Requires: qubes-libvchan
|
Requires: qubes-libvchan
|
||||||
Requires: qubes-db-vm
|
Requires: qubes-db-vm
|
||||||
|
%if 0%{fedora} >= 23
|
||||||
|
Requires: python3-dnf-plugins-qubes-hooks
|
||||||
|
%else
|
||||||
|
Requires: python2-dnf-plugins-qubes-hooks
|
||||||
|
%endif
|
||||||
Obsoletes: qubes-core-vm-kernel-placeholder <= 1.0
|
Obsoletes: qubes-core-vm-kernel-placeholder <= 1.0
|
||||||
Obsoletes: qubes-upgrade-vm < 3.1
|
Obsoletes: qubes-upgrade-vm < 3.1
|
||||||
BuildRequires: xen-devel
|
BuildRequires: xen-devel
|
||||||
@ -75,6 +80,26 @@ BuildRequires: libX11-devel
|
|||||||
BuildRequires: qubes-utils-devel >= 3.1.3
|
BuildRequires: qubes-utils-devel >= 3.1.3
|
||||||
BuildRequires: qubes-libvchan-%{backend_vmm}-devel
|
BuildRequires: qubes-libvchan-%{backend_vmm}-devel
|
||||||
|
|
||||||
|
%package -n python2-dnf-plugins-qubes-hooks
|
||||||
|
Summary: DNF plugin for Qubes specific post-installation actions
|
||||||
|
BuildRequires: python2-devel
|
||||||
|
%{?python_provide:%python_provide python2-dnf-plugins-qubes-hooks}
|
||||||
|
|
||||||
|
%description -n python2-dnf-plugins-qubes-hooks
|
||||||
|
DNF plugin for Qubes specific post-installation actions:
|
||||||
|
* notify dom0 that updates were installed
|
||||||
|
* refresh applications shortcut list
|
||||||
|
|
||||||
|
%package -n python3-dnf-plugins-qubes-hooks
|
||||||
|
Summary: DNF plugin for Qubes specific post-installation actions
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
%{?python_provide:%python_provide python3-dnf-plugins-qubes-hooks}
|
||||||
|
|
||||||
|
%description -n python3-dnf-plugins-qubes-hooks
|
||||||
|
DNF plugin for Qubes specific post-installation actions:
|
||||||
|
* notify dom0 that updates were installed
|
||||||
|
* refresh applications shortcut list
|
||||||
|
|
||||||
%define _builddir %(pwd)
|
%define _builddir %(pwd)
|
||||||
|
|
||||||
%define kde_service_dir /usr/share/kde4/services
|
%define kde_service_dir /usr/share/kde4/services
|
||||||
@ -390,7 +415,6 @@ rm -f %{name}-%{version}
|
|||||||
/usr/lib/qubes/upgrades-installed-check
|
/usr/lib/qubes/upgrades-installed-check
|
||||||
/usr/lib/qubes/upgrades-status-notify
|
/usr/lib/qubes/upgrades-status-notify
|
||||||
/usr/lib/yum-plugins/yum-qubes-hooks.py*
|
/usr/lib/yum-plugins/yum-qubes-hooks.py*
|
||||||
/usr/lib/python2.7/site-packages/dnf-plugins/qubes-hooks.py*
|
|
||||||
/usr/lib/dracut/dracut.conf.d/30-qubes.conf
|
/usr/lib/dracut/dracut.conf.d/30-qubes.conf
|
||||||
/usr/lib64/python2.7/site-packages/qubes/xdg.py*
|
/usr/lib64/python2.7/site-packages/qubes/xdg.py*
|
||||||
/usr/sbin/qubes-firewall
|
/usr/sbin/qubes-firewall
|
||||||
@ -409,6 +433,12 @@ rm -f %{name}-%{version}
|
|||||||
%dir /mnt/removable
|
%dir /mnt/removable
|
||||||
%dir /rw
|
%dir /rw
|
||||||
|
|
||||||
|
%files -n python2-dnf-plugins-qubes-hooks
|
||||||
|
%{python2_sitelib}/dnf-plugins/*
|
||||||
|
|
||||||
|
%files -n python3-dnf-plugins-qubes-hooks
|
||||||
|
%{python3_sitelib}/dnf-plugins/*
|
||||||
|
|
||||||
%package sysvinit
|
%package sysvinit
|
||||||
Summary: Qubes unit files for SysV init style or upstart
|
Summary: Qubes unit files for SysV init style or upstart
|
||||||
License: GPL v2 only
|
License: GPL v2 only
|
||||||
|
Loading…
Reference in New Issue
Block a user