]>
Commit | Line | Data |
---|---|---|
a9349246 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build and run tests (requires root) | |
4 | ||
e769518e JB |
5 | Summary: Checkpoint/restore functionality for Linux in userspace |
6 | Summary(pl.UTF-8): Funkcja checkpoint/restore w przestrzeni użytkownika dla Linuksa | |
6be8c1d2 | 7 | Name: criu |
db5fa3a6 | 8 | Version: 2.5 |
83bc7f40 | 9 | Release: 1 |
1d80f334 | 10 | License: GPL v2 (tools), LGPL v2.1 (library) |
6be8c1d2 AM |
11 | Group: Applications/System |
12 | Source0: http://download.openvz.org/criu/%{name}-%{version}.tar.bz2 | |
db5fa3a6 | 13 | # Source0-md5: 5d5115454d110adb744e885d82d2c1f6 |
1d80f334 | 14 | Patch0: %{name}-python.patch |
a9349246 | 15 | Patch1: tests.patch |
6be8c1d2 | 16 | URL: http://criu.org/ |
6e51e7f7 ER |
17 | BuildRequires: asciidoc |
18 | BuildRequires: libcap-devel | |
19 | BuildRequires: libnl-devel >= 1:3.2 | |
20 | BuildRequires: pkgconfig | |
6e51e7f7 | 21 | BuildRequires: protobuf |
7a48cad9 | 22 | BuildRequires: protobuf-c-devel |
6e51e7f7 | 23 | BuildRequires: protobuf-devel |
1d80f334 | 24 | BuildRequires: python >= 2 |
6e51e7f7 ER |
25 | BuildRequires: python-modules |
26 | BuildRequires: rpm-pythonprov | |
7a48cad9 | 27 | BuildRequires: rpmbuild(macros) >= 1.697 |
7a8067bd | 28 | BuildRequires: sed >= 4.0 |
aa51aa10 | 29 | Requires: %{name}-libs = %{version}-%{release} |
db5fa3a6 ER |
30 | Requires: iproute2 >= 3.5 |
31 | Requires: uname(release) >= 3.11 | |
6073a3d8 | 32 | ExclusiveArch: %{x8664} %{arm} aarch64 ppc64 |
6be8c1d2 AM |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
a27aad5c ER |
35 | %define _libexecdir %{_prefix}/lib |
36 | ||
6be8c1d2 | 37 | %description |
7a8067bd ER |
38 | Checkpoint/Restore In Userspace, or CRIU, is a software tool for Linux |
39 | operating system. Using this tool, you can freeze a running | |
40 | application (or part of it) and checkpoint it to a hard drive as a | |
41 | collection of files. You can then use the files to restore and run the | |
42 | application from the point it was frozen at. The distinctive feature | |
43 | of the CRIU project is that it is mainly implemented in user space. | |
44 | ||
45 | %description -l en.UTF-8 | |
6be8c1d2 AM |
46 | Checkpoint/Restore In Userspace, or CRIU (pronounced kree-oo, IPA: |
47 | /krɪʊ/, Russian: криу), is a software tool for Linux operating system. | |
48 | Using this tool, you can freeze a running application (or part of it) | |
49 | and checkpoint it to a hard drive as a collection of files. You can | |
50 | then use the files to restore and run the application from the point | |
51 | it was frozen at. The distinctive feature of the CRIU project is that | |
52 | it is mainly implemented in user space. | |
53 | ||
e769518e JB |
54 | %description -l pl.UTF-8 |
55 | CRIU (Checkpoint/Restore In Userspace) to narzędzie programowe dla | |
56 | systemu operacyjnego Linux. Przy jego użyciu można zamrozić działającą | |
57 | aplikację (lub jej część) i zapisać migawkę na twardym dysku jako | |
58 | zestaw plików. Następnie można użyć tych plików do odtworzenia i | |
59 | uruchomienia aplikacji od miejsca, w którym została zamrożona. | |
60 | Wyróżnikiem projektu CRIU jest to, że został zaimplementowany głównie | |
61 | w przestrzeni użytkownika. | |
62 | ||
aa51aa10 AM |
63 | %package libs |
64 | Summary: CRIU shared library | |
65 | Summary(pl.UTF-8): Biblioteka współdzielona CRIU | |
1d80f334 | 66 | License: LGPL v2.1 |
aa51aa10 AM |
67 | Group: Libraries |
68 | ||
69 | %description libs | |
70 | CRIU shared library. | |
71 | ||
72 | %description libs -l pl.UTF-8 | |
73 | Biblioteka współdzielona CRIU. | |
74 | ||
75 | %package devel | |
1d80f334 JB |
76 | Summary: Header files for CRIU library |
77 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki CRIU | |
78 | License: LGPL v2.1 | |
aa51aa10 AM |
79 | Group: Development/Libraries |
80 | Requires: %{name}-libs = %{version}-%{release} | |
81 | ||
82 | %description devel | |
1d80f334 | 83 | Header files for CRIU library. |
aa51aa10 AM |
84 | |
85 | %description devel -l pl.UTF-8 | |
1d80f334 JB |
86 | Pliki nagłówkowe biblioteki CRIU. |
87 | ||
88 | %package -n python-pycriu | |
89 | Summary: Python interface to CRIU | |
90 | Summary(pl.UTF-8): Pythonowy interfejs do CRIU | |
91 | Group: Libraries/Python | |
92 | Requires: %{name}-libs = %{version}-%{release} | |
93 | ||
94 | %description -n python-pycriu | |
95 | Python interface to CRIU. This package contains also crit utility. | |
96 | ||
97 | %description -n python-pycriu -l pl.UTF-8 | |
98 | Pythonowy interfejs do CRIU. Ten pakiet zawiera także narzędzie crit. | |
aa51aa10 | 99 | |
6be8c1d2 AM |
100 | %prep |
101 | %setup -q | |
1d80f334 | 102 | %patch0 -p1 |
a9349246 | 103 | %patch1 -p1 |
1d80f334 | 104 | |
83bc7f40 | 105 | %{__sed} -i -e 's#-O2 -g#$(OPT)#g' Makefile |
6be8c1d2 AM |
106 | |
107 | %build | |
7a48cad9 ER |
108 | %define _make_opts \\\ |
109 | DEB_HOST_MULTIARCH= \\\ | |
110 | CC="%{__cc}" \\\ | |
111 | OPT="%{rpmcppflags} %{rpmcflags}" \\\ | |
112 | PREFIX=%{_prefix} \\\ | |
113 | LIBDIR=%{_libdir} \\\ | |
114 | LOGROTATEDIR=%{_sysconfdir}/logrotate.d \\\ | |
a27aad5c | 115 | LIBEXECDIR=%{_libexecdir} \\\ |
7a48cad9 ER |
116 | PYSITESCRIPTDIR=%{py_sitescriptdir} \\\ |
117 | MANDIR=%{_mandir} \\\ | |
118 | WERROR=0 \\\ | |
119 | V=1 | |
120 | %{__make} | |
6be8c1d2 | 121 | |
a9349246 ER |
122 | %if %{with tests} |
123 | %{__make} test | |
124 | %endif | |
125 | ||
6be8c1d2 AM |
126 | %install |
127 | rm -rf $RPM_BUILD_ROOT | |
6be8c1d2 | 128 | %{__make} install \ |
6be8c1d2 | 129 | DESTDIR=$RPM_BUILD_ROOT |
7a8067bd | 130 | |
59290952 ER |
131 | install -p contrib/docker_cr.sh $RPM_BUILD_ROOT%{_libexecdir}/%{name}/scripts |
132 | ||
133 | # optional scripts, do not autogenerate bash dep | |
134 | chmod -x $RPM_BUILD_ROOT%{_libexecdir}/%{name}/scripts/*.sh | |
a27aad5c | 135 | |
1d80f334 JB |
136 | %py_postclean |
137 | ||
6be8c1d2 AM |
138 | %clean |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
af06864b | 141 | %post libs -p /sbin/ldconfig |
aa51aa10 AM |
142 | %postun libs -p /sbin/ldconfig |
143 | ||
6be8c1d2 AM |
144 | %files |
145 | %defattr(644,root,root,755) | |
59290952 | 146 | %doc CREDITS README.md |
aa51aa10 | 147 | %attr(755,root,root) %{_sbindir}/criu |
6be8c1d2 | 148 | %{_mandir}/man8/criu.8* |
a27aad5c ER |
149 | %dir %{_libexecdir}/%{name} |
150 | %dir %{_libexecdir}/%{name}/scripts | |
59290952 ER |
151 | %attr(755,root,root) %{_libexecdir}/%{name}/scripts/systemd-autofs-restart.sh |
152 | %attr(755,root,root) %{_libexecdir}/%{name}/scripts/docker_cr.sh | |
aa51aa10 AM |
153 | |
154 | %files libs | |
155 | %defattr(644,root,root,755) | |
156 | %attr(755,root,root) %{_libdir}/libcriu.so.*.* | |
157 | %attr(755,root,root) %ghost %{_libdir}/libcriu.so.1 | |
158 | ||
159 | %files devel | |
160 | %defattr(644,root,root,755) | |
161 | %attr(755,root,root) %{_libdir}/libcriu.so | |
162 | %{_includedir}/criu | |
163 | %{_pkgconfigdir}/criu.pc | |
1d80f334 JB |
164 | |
165 | %files -n python-pycriu | |
166 | %defattr(644,root,root,755) | |
167 | %attr(755,root,root) %{_bindir}/crit | |
168 | %{py_sitescriptdir}/pycriu | |
169 | %{py_sitescriptdir}/crit-0.0.1-py*.egg-info |