criu/criu-py-install-fix.diff
Takashi Iwai ed0c6841f8 Accepting request 1091121 from home:tiwai:branches:devel:tools
- Update to criu 3.18:
  New features:
  * Allow CRIU to be used as non-root
  * Add SIGTSTP support
  * Add opt to skip file r/w/x check on restore
  Bugfixes:
  * Many fixes here and there
  Improvements:
  * cgroup2: Dump cgroup controllers of every threads in a process
  * save IP_FREEBIND option for SOCK_RAW sockets also
  * support IP_PKTINFO and IPV6_RECVPKTINFO options
  * Implement hw breakpoint for arm64 platform
  * Set only used XFEATURE_* in xstate_bv
  * Checkpoint and restore some global properties
  * A checkpoint optimization for highly sparse ghost files (--ghost-fiemap)
- Refresh criu-py-install-fix.diff:
  a workaround for non-working python-pip inside build environment by
  reviving the old setup script
- Fix shebang of criu-ns script:
  criu-ns-python3-shebang.patch
- Drop obsoleted patches:
  criu-fix-conflicting-headers.patch
  mount-add-definition-for-FSOPEN_CLOEXEC.patch

OBS-URL: https://build.opensuse.org/request/show/1091121
OBS-URL: https://build.opensuse.org/package/show/devel:tools/criu?expand=0&rev=117
2023-06-06 16:26:28 +00:00

57 lines
1.8 KiB
Diff

---
lib/Makefile | 7 ++++++-
scripts/crit-setup.py | 25 +++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -2,6 +2,10 @@ CRIU_SO := libcriu.so
CRIU_A := libcriu.a
UAPI_HEADERS := lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h
+#
+# File to keep track of files installed by setup.py
+CRIT_SETUP_FILES := lib/.crit-setup.files
+
all-y += lib-c lib-a lib-py
#
@@ -56,7 +60,8 @@ install: lib-c lib-a lib-py crit/crit li
$(Q) install -m 644 lib/c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
ifeq ($(PYTHON),python3)
$(E) " INSTALL " crit
- $(Q) $(PYTHON) -m pip install --upgrade --force-reinstall --prefix=$(DESTDIR)$(PREFIX) ./crit
+ # $(Q) $(PYTHON) -m pip install --upgrade --force-reinstall --prefix=$(DESTDIR)$(PREFIX) ./crit
+ $(Q) $(PYTHON) scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) --record $(CRIT_SETUP_FILES)
endif
.PHONY: install
--- /dev/null
+++ b/scripts/crit-setup.py
@@ -0,0 +1,25 @@
+import os
+from distutils.core import setup
+
+criu_version = "0.0.1"
+env = os.environ
+
+if 'CRIU_VERSION_MAJOR' in env and 'CRIU_VERSION_MINOR' in env:
+ criu_version = '{}.{}'.format(
+ env['CRIU_VERSION_MAJOR'],
+ env['CRIU_VERSION_MINOR']
+ )
+
+ if 'CRIU_VERSION_SUBLEVEL' in env and env['CRIU_VERSION_SUBLEVEL']:
+ criu_version += '.' + env['CRIU_VERSION_SUBLEVEL']
+
+setup(name="crit",
+ version=criu_version,
+ description="CRiu Image Tool",
+ author="CRIU team",
+ author_email="criu@openvz.org",
+ license="GPLv2",
+ url="https://github.com/checkpoint-restore/criu",
+ package_dir={'pycriu': 'lib/py'},
+ packages=["pycriu", "pycriu.images"],
+ scripts=["crit/crit"])