Debian Codegraph @

package/python-kiwi-spec-template

raw
1 #
2 # spec file for package kiwi
3 #
4 # Copyright (c) 2023 SUSE LLC
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14 #
15 # Please submit bugfixes or comments via:
16 #
17 # https://github.com/OSInside/kiwi/issues
18 #
19
20 # If they aren't provided by a system installed macro, define them
21 %{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc}
22
23 %if 0%{?suse_version} && 0%{?suse_version} < 1600
24 %global __python3 /usr/bin/python3.11
25 %global python3_pkgversion 311
26 %else
27 %{!?__python3: %global __python3 /usr/bin/python3}
28 %{!?python3_pkgversion:%global python3_pkgversion 3}
29 %endif
30
31 %if %{undefined python3_sitelib}
32 %if "%{_vendor}" == "debbuild"
33 %global python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
34 %else
35 %global python3_sitelib %(%{__python3} -c "import sysconfig; print(sysconfig.get_path('platlib'))")
36 %endif
37 %endif
38
39 %if %{undefined python3_version}
40 %global python3_version %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
41 %endif
42
43 %if %{undefined python3_version_nodots}
44 %global python3_version_nodots %(%{__python3} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
45 %endif
46
47 %if 0%{?debian} || 0%{?ubuntu}
48 %global is_deb 1
49 %global pygroup python
50 %global sysgroup admin
51 %global develsuffix dev
52 %else
53 %global pygroup Development/Languages/Python
54 %global sysgroup System/Management
55 %global develsuffix devel
56 %endif
57
58 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} >= 1600
59 %bcond_without selinux
60 %else
61 %bcond_with selinux
62 %endif
63
64 Name: python-kiwi
65 Version: %%VERSION
66 Provides: kiwi-schema = 8.1
67 Release: 0
68 Url: https://github.com/OSInside/kiwi
69 Summary: KIWI - Appliance Builder Next Generation
70 License: GPL-3.0-or-later
71 %if "%{_vendor}" == "debbuild"
72 # Needed to set Maintainer in output debs
73 Packager: Marcus Schaefer <[email protected]>
74 %endif
75 Group: %{pygroup}
76 Source0: %{name}.tar.gz
77 Source1: %{name}-rpmlintrc
78 # SUSE-specific source additions (1001+)
79 Source1001: systemd-tmpfiles-for-suse.conf
80 BuildRoot: %{_tmppath}/%{name}-%{version}-build
81 %if 0%{?fedora} || 0%{?suse_version}
82 BuildRequires: fdupes
83 %endif
84 %if 0%{?suse_version}
85 BuildRequires: shadow
86 %endif
87 %if 0%{?debian} || 0%{?ubuntu}
88 BuildRequires: passwd
89 %endif
90 # Main build requirements
91 BuildRequires: gcc
92 BuildRequires: make
93 BuildRequires: python%{python3_pkgversion}-%{develsuffix} >= 3.9
94 BuildRequires: python%{python3_pkgversion}-build
95 BuildRequires: python%{python3_pkgversion}-installer
96 BuildRequires: python%{python3_pkgversion}-poetry-core >= 1.2.0
97 BuildRequires: python%{python3_pkgversion}-wheel
98 # doc build requirements
99 %if 0%{?debian} || 0%{?ubuntu}
100 # only because of debbuild
101 BuildRequires: python%{python3_pkgversion}-setuptools
102 %endif
103 BuildRequires: python%{python3_pkgversion}-typer >= 0.19.0
104 BuildRequires: python%{python3_pkgversion}-lxml
105 BuildRequires: python%{python3_pkgversion}-requests
106 BuildRequires: python%{python3_pkgversion}-simplejson
107 %if 0%{?suse_version}
108 BuildRequires: python%{python3_pkgversion}-Sphinx
109 %else
110 BuildRequires: python%{python3_pkgversion}-sphinx
111 %endif
112 %if 0%{?debian} || 0%{?ubuntu}
113 BuildRequires: python%{python3_pkgversion}-sphinx-rtd-theme
114 BuildRequires: python%{python3_pkgversion}-yaml
115 %else
116 BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme
117 BuildRequires: python%{python3_pkgversion}-PyYAML
118 %endif
119
120 %description
121 The KIWI Image System provides an operating system image builder
122 for Linux supported hardware platforms as well as for virtualization
123 and cloud systems like Xen, KVM, VMware, EC2 and more.
124
125 %package -n kiwi-systemdeps-core
126 Summary: KIWI - Core host system dependencies
127 Group: %{sysgroup}
128 Provides: kiwi-image-tbz-requires = %{version}-%{release}
129 Obsoletes: kiwi-image-tbz-requires < %{version}-%{release}
130 %if "%{_vendor}" != "debbuild"
131 Provides: kiwi-image:tbz
132 %endif
133 %if 0%{?fedora} >= 42
134 Provides: kiwi-image:enclave
135 Requires: eif_build
136 %endif
137 # tools conditionally used by kiwi
138 %if 0%{?fedora} || 0%{?rhel} >= 8
139 Recommends: gnupg2
140 Recommends: apt
141 Recommends: dpkg
142 %endif
143 %if 0%{?suse_version}
144 Recommends: gpg2
145 %if 0%{?suse_version} >= 1650
146 Recommends: dnf
147 %endif
148 %endif
149 # package managers required by distro
150 %if 0%{?fedora} >= 41 || 0%{?rhel} >= 11 || 0%{?suse_version} >= 1650
151 Requires: dnf5
152 Requires: dnf5-plugins
153 Provides: kiwi-packagemanager:dnf5
154 %endif
155 %if (0%{?fedora} && 0%{?fedora} < 41) || (0%{?rhel} && 0%{?rhel} < 11)
156 Requires: dnf4
157 Provides: kiwi-packagemanager:dnf
158 Provides: kiwi-packagemanager:dnf4
159 Provides: kiwi-packagemanager:yum
160 %endif
161 %if (0%{?fedora} && 0%{?fedora} < 41) || (0%{?rhel} >= 8 && 0%{?rhel} < 11)
162 Provides: kiwi-packagemanager:microdnf
163 Requires: microdnf
164 %endif
165 %if 0%{?fedora} >= 26 || 0%{?suse_version}
166 Requires: zypper
167 Provides: kiwi-packagemanager:zypper
168 %endif
169 %if 0%{?debian} || 0%{?ubuntu}
170 Requires: apt
171 Requires: dpkg
172 Requires: gnupg
173 %endif
174 # tools required by kiwi
175 Requires: mtools
176 Requires: rsync
177 Requires: tar >= 1.2.7
178 Requires: cpio
179 Requires: lsof
180 Requires: openssl
181
182 %description -n kiwi-systemdeps-core
183 This metapackage installs the necessary system dependencies
184 to run KIWI.
185
186 %package -n kiwi-systemdeps-containers
187 Summary: KIWI - host requirements for OCI container images
188 Group: %{sysgroup}
189 Provides: kiwi-image-docker-requires = %{version}-%{release}
190 Obsoletes: kiwi-image-docker-requires < %{version}-%{release}
191 %if "%{_vendor}" != "debbuild"
192 Provides: kiwi-image:docker
193 Provides: kiwi-image:oci
194 %endif
195 %if 0%{?suse_version}
196 Requires: umoci
197 %else
198 Requires: buildah
199 %endif
200 Requires: skopeo
201
202 %description -n kiwi-systemdeps-containers
203 Host setup helper to pull in all packages required/useful on
204 the build host to build OCI container images
205
206 %package -n kiwi-systemdeps-containers-wsl
207 Summary: KIWI - host requirements for WSL container images
208 Group: %{sysgroup}
209 Provides: kiwi-image-wsl-requires = %{version}-%{release}
210 Obsoletes: kiwi-image-wsl-requires < %{version}-%{release}
211 %if "%{_vendor}" != "debbuild"
212 Provides: kiwi-image:appx
213 Provides: kiwi-image:wsl
214 %endif
215 %if 0%{?suse_version}
216 Requires: fb-util-for-appx
217 %endif
218 %if 0%{?fedora} || 0%{?rhel}
219 Requires: appx-util
220 %endif
221
222 %description -n kiwi-systemdeps-containers-wsl
223 Host setup helper to pull in all packages required/useful on
224 the build host to build WSL container images
225
226 %package -n kiwi-systemdeps-iso-media
227 Summary: KIWI - host requirements for live and install iso images
228 Group: %{sysgroup}
229 Provides: kiwi-image-iso-requires = %{version}-%{release}
230 Obsoletes: kiwi-image-iso-requires < %{version}-%{release}
231 %if "%{_vendor}" != "debbuild"
232 Provides: kiwi-image:iso
233 %endif
234 %if 0%{?suse_version}
235 Requires: checkmedia
236 %else
237 Requires: isomd5sum
238 %endif
239 Requires: xorriso
240 Requires: kiwi-systemdeps-core = %{version}-%{release}
241 Requires: kiwi-systemdeps-filesystems = %{version}-%{release}
242 Requires: kiwi-systemdeps-bootloaders = %{version}-%{release}
243
244 %description -n kiwi-systemdeps-iso-media
245 Host setup helper to pull in all packages required/useful on
246 the build host to build live and install iso images.
247
248 %package -n kiwi-systemdeps-bootloaders
249 Summary: KIWI - host requirements for configuring bootloaders
250 %if 0%{?suse_version}
251 %ifarch x86_64
252 Requires: grub2-x86_64-efi
253 %endif
254 %ifarch %{ix86} x86_64
255 Recommends: gfxboot
256 %endif
257 %endif
258 %if 0%{?fedora} || 0%{?rhel}
259 %ifarch x86_64
260 Requires: grub2-efi-x64
261 %endif
262 %endif
263 %ifarch %arm aarch64
264 %if 0%{?fedora} || 0%{?rhel}
265 Requires: uboot-tools
266 %endif
267 %if 0%{?suse_version}
268 Requires: u-boot-tools
269 %endif
270 %endif
271 %ifarch s390 s390x
272 %if 0%{?fedora} || 0%{?rhel}
273 Requires: s390utils
274 %else
275 Requires: s390-tools
276 %if ! (0%{?debian} || 0%{?ubuntu})
277 Requires: grub2
278 %endif
279 %endif
280 %endif
281 Requires: kiwi-systemdeps-core = %{version}-%{release}
282
283 %description -n kiwi-systemdeps-bootloaders
284 Host setup helper to pull in all packages required/useful on
285 the build host for configuring bootloaders on images.
286
287 %package -n kiwi-systemdeps-filesystems
288 Summary: KIWI - host requirements for filesystems
289 Group: %{sysgroup}
290 Provides: kiwi-image-pxe-requires = %{version}-%{release}
291 Obsoletes: kiwi-image-pxe-requires < %{version}-%{release}
292 Provides: kiwi-filesystem-requires = %{version}-%{release}
293 Obsoletes: kiwi-filesystem-requires < %{version}-%{release}
294 %if "%{_vendor}" != "debbuild"
295 Provides: kiwi-image:pxe
296 Provides: kiwi-image:kis
297 %if ! (0%{?rhel} >= 8)
298 Provides: kiwi-filesystem:btrfs
299 %endif
300 Provides: kiwi-filesystem:ext2
301 Provides: kiwi-filesystem:ext3
302 Provides: kiwi-filesystem:ext4
303 Provides: kiwi-filesystem:squashfs
304 Provides: kiwi-filesystem:xfs
305 %if ! (0%{?suse_version} && 0%{?suse_version} < 1600)
306 Provides: kiwi-filesystem:erofs
307 Provides: kiwi-image:erofs
308 %endif
309 %endif
310 Requires: dosfstools
311 Requires: e2fsprogs
312 Requires: xfsprogs
313 %if ! (0%{?suse_version} && 0%{?suse_version} < 1600)
314 Requires: erofs-utils
315 %endif
316 %if 0%{?suse_version}
317 Requires: btrfsprogs
318 %else
319 %if ! (0%{?rhel} >= 8)
320 Requires: btrfs-progs
321 %endif
322 %endif
323 %if 0%{?suse_version}
324 Requires: squashfs
325 %else
326 Requires: squashfs-tools
327 %endif
328 %ifnarch %{ix86} %{arm}
329 %if "%{_vendor}" == "debbuild"
330 Requires: qemu-utils
331 %else
332 %if 0%{?suse_version}
333 Requires: qemu-tools
334 %else
335 Requires: qemu-img
336 %endif
337 %endif
338 %endif
339 Requires: kiwi-systemdeps-core = %{version}-%{release}
340
341 %description -n kiwi-systemdeps-filesystems
342 Host setup helper to pull in all packages required/useful on
343 the build host to build filesystem images
344
345 %package -n kiwi-systemdeps-disk-images
346 Summary: KIWI - host requirements for disk images
347 Group: %{sysgroup}
348 Provides: kiwi-image-oem-requires = %{version}-%{release}
349 Obsoletes: kiwi-image-oem-requires < %{version}-%{release}
350 Provides: kiwi-image-vmx-requires = %{version}-%{release}
351 Obsoletes: kiwi-image-vmx-requires < %{version}-%{release}
352 %if "%{_vendor}" != "debbuild"
353 Provides: kiwi-image:oem
354 Provides: kiwi-image:vmx
355 %endif
356 Requires: kiwi-systemdeps-filesystems = %{version}-%{release}
357 Requires: kiwi-systemdeps-bootloaders = %{version}-%{release}
358 Requires: kiwi-systemdeps-iso-media = %{version}-%{release}
359 %if 0%{?suse_version} >= 1600
360 Requires: binutils
361 Requires: glibc-gconv-modules-extra
362 %endif
363 %if 0%{?suse_version}
364 Requires: gptfdisk
365 %else
366 Requires: gdisk
367 %endif
368 Requires: lvm2
369 Requires: kpartx
370 Requires: cryptsetup
371 Requires: mdadm
372 Requires: util-linux
373 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
374 Requires: open-vmdk
375 %endif
376 # lsblk is part of util-linux-systemd on openSUSE
377 %if 0%{?suse_version}
378 Requires: util-linux-systemd
379 %endif
380
381 %description -n kiwi-systemdeps-disk-images
382 Host setup helper to pull in all packages required/useful on
383 the build host to build disk images
384
385 %package -n kiwi-systemdeps-image-validation
386 Summary: KIWI - host requirements for handling image descriptions better
387 Group: %{sysgroup}
388 %if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?debian} || 0%{?ubuntu}
389 Recommends: jing
390 %endif
391 %if 0%{?fedora} || 0%{?rhel} >= 8 || 0%{?suse_version}
392 Requires: python%{python3_pkgversion}-solv
393 %endif
394 %if ! (0%{?rhel} && 0%{?rhel} < 8)
395 Recommends: python%{python3_pkgversion}-anymarkup-core
396 %endif
397
398 %description -n kiwi-systemdeps-image-validation
399 Host setup helper to pull in all packages required/useful on
400 the build host to handling image descriptions better. This also
401 includes reading of image descriptions for different markup
402 languages
403
404 %package -n kiwi-systemdeps-boxbuild
405 Summary: KIWI - host requirements for building in a self contained box
406 Group: %{sysgroup}
407 Requires: python%{python3_pkgversion}-kiwi = %{version}-%{release}
408 %if 0%{?ubuntu} || 0%{?debian}
409 Requires: qemu-kvm
410 %else
411 Requires: qemu
412 %endif
413 Recommends: sshfs
414 Recommends: virtiofsd >= 1.10
415 Recommends: podman
416 # The boxbuild command was provided by the kiwi_boxed_plugin
417 Provides: python%{python3_pkgversion}-kiwi_boxed_plugin = %{version}-%{release}
418 Obsoletes: python%{python3_pkgversion}-kiwi_boxed_plugin < %{version}-%{release}
419
420 %description -n kiwi-systemdeps-boxbuild
421 Host setup helper to pull in all packages required/useful on
422 the build host to build images in a self contained virtual
423 machine or container via the kiwi-ng system boxbuild command
424
425 %package -n kiwi-systemdeps-stackbuild
426 Summary: KIWI - host requirements for building based on containers
427 Group: %{sysgroup}
428 Requires: python%{python3_pkgversion}-kiwi = %{version}-%{release}
429 Requires: kiwi-systemdeps-containers = %{version}-%{release}
430 Requires: podman
431 Requires: rsync
432 # The stackbuild and stash commands were provided by the kiwi_stackbuild_plugin
433 Provides: python%{python3_pkgversion}-kiwi_stackbuild_plugin = %{version}-%{release}
434 Obsoletes: python%{python3_pkgversion}-kiwi_stackbuild_plugin < %{version}-%{release}
435
436 %description -n kiwi-systemdeps-stackbuild
437 Host setup helper to pull in all packages required/useful on
438 the build host to store image root trees as containers and
439 to build images based on containers via the kiwi-ng system
440 stash and kiwi-ng system stackbuild commands
441
442 %package -n kiwi-systemdeps
443 Summary: KIWI - Host system dependencies
444 Group: %{sysgroup}
445 Requires: kiwi-systemdeps-core = %{version}-%{release}
446 Requires: kiwi-systemdeps-bootloaders = %{version}-%{release}
447 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
448 # None of the container build tools are available in Debian/Ubuntu
449 Requires: kiwi-systemdeps-containers = %{version}-%{release}
450 Requires: kiwi-systemdeps-containers-wsl = %{version}-%{release}
451 %endif
452 Requires: kiwi-systemdeps-filesystems = %{version}-%{release}
453 Requires: kiwi-systemdeps-disk-images = %{version}-%{release}
454 Requires: kiwi-systemdeps-iso-media = %{version}-%{release}
455 %if 0%{?fedora} || 0%{?suse_version}
456 Requires: kiwi-systemdeps-image-validation = %{version}-%{release}
457 %endif
458
459 %description -n kiwi-systemdeps
460 Host setup helper to pull in all packages required/useful to
461 leverage all functionality in KIWI.
462
463 # python3-kiwi
464 %package -n python%{python3_pkgversion}-kiwi
465 Summary: KIWI - Appliance Builder Next Generation
466 Group: %{pygroup}
467 %if "%{python3_pkgversion}" == "3"
468 %if 0%{?suse_version}
469 Provides: python%{python3_version_nodots}-kiwi = %{version}-%{release}
470 %else
471 Provides: python%{python3_version}-kiwi = %{version}-%{release}
472 %endif
473 %endif
474 Obsoletes: python2-kiwi
475 Conflicts: python2-kiwi
476 Conflicts: kiwi-man-pages < %{version}
477 Requires: screen
478 Requires: file
479 Requires: sed
480 Requires: bash
481 Requires: python%{python3_pkgversion} >= 3.9
482 %if 0%{?ubuntu} || 0%{?debian}
483 Requires: python%{python3_pkgversion}-yaml
484 %else
485 Requires: python%{python3_pkgversion}-PyYAML
486 %endif
487 Requires: python%{python3_pkgversion}-simplejson
488 Requires: python%{python3_pkgversion}-typer >= 0.19.0
489 Requires: python%{python3_pkgversion}-lxml
490 Requires: python%{python3_pkgversion}-requests
491 Requires: python%{python3_pkgversion}-xmltodict
492 Requires: python%{python3_pkgversion}-progressbar2
493 %if 0%{?suse_version}
494 Requires: python%{python3_pkgversion}-Cerberus
495 %else
496 Requires: python%{python3_pkgversion}-cerberus
497 %endif
498 %if %{with selinux}
499 Requires: (kiwi-selinux = %{version}-%{release} if selinux-policy)
500 %endif
501 %if ! (0%{?rhel} && 0%{?rhel} < 8)
502 Recommends: kiwi-man-pages
503 %endif
504 %if "%{_vendor}" == "debbuild"
505 # Avoid issues with not being able to use magic Provides
506 Requires: kiwi-systemdeps = %{version}-%{release}
507 %else
508 # Only require core dependencies, and allow OBS to pull the rest through magic Provides
509 Requires: kiwi-systemdeps-core = %{version}-%{release}
510 %if ! 0%{?el7}
511 # Retain default expectation for local installations
512 Recommends: kiwi-systemdeps = %{version}-%{release}
513 %endif
514 %endif
515
516 %description -n python%{python3_pkgversion}-kiwi
517 Python 3 library of the KIWI Image System. Provides an operating system
518 image builder for Linux supported hardware platforms as well as for
519 virtualization and cloud systems like Xen, KVM, VMware, EC2 and more.
520
521 %if "%{_vendor}" != "debbuild"
522 %ifarch %{ix86} x86_64
523 %package -n kiwi-pxeboot
524 Summary: KIWI - PXE boot structure
525 Requires: syslinux
526 %if 0%{?fedora} || 0%{?rhel}
527 Requires(pre): shadow-utils
528 %else
529 Requires(pre): shadow
530 %endif
531 %if 0%{?suse_version} >= 1550
532 Requires(pre): user(tftp)
533 %endif
534 License: GPL-3.0-or-later
535 Group: %{sysgroup}
536
537 %description -n kiwi-pxeboot
538 This package contains the basic PXE directory structure which is
539 needed to serve kiwi built images via PXE.
540 %endif
541 %endif
542
543 %package -n dracut-kiwi-lib
544 Summary: KIWI - Dracut kiwi Library
545 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
546 # Ubuntu 16.04 OBS environments refuse to set up due to
547 # initramfs-tools / dracut conflict and initramfs-tools is required
548 # to set up the build environment...
549 BuildRequires: dracut
550 %endif
551 Requires: bc
552 Requires: cryptsetup
553 %if 0%{?fedora} || 0%{?rhel} || 0%{?ubuntu} >= 1804 || 0%{?debian} >= 9
554 %if 0%{?rhel} && 0%{?rhel} < 8
555 Requires: btrfs-progs
556 %else
557 Recommends: btrfs-progs
558 %endif
559 Requires: gdisk
560 Requires: dracut-network
561 %else
562 %if 0%{?debian} || 0%{?ubuntu}
563 Recommends: btrfs-tools
564 Requires: gdisk
565 %else
566 Requires: btrfsprogs
567 Requires: gptfdisk
568 %endif
569 %endif
570 Requires: coreutils
571 Requires: e2fsprogs
572 Requires: grep
573 Requires: lvm2
574 Requires: mdadm
575 Requires: util-linux
576 # lsblk is part of util-linux-systemd on openSUSE
577 %if 0%{?suse_version}
578 Requires: util-linux-systemd
579 %endif
580 Requires: xfsprogs
581 Requires: dialog
582 Requires: pv
583 Requires: curl
584 %if 0%{?debian} || 0%{?ubuntu}
585 Requires: xz-utils
586 Requires: dmsetup
587 %else
588 Requires: xz
589 Requires: device-mapper
590 %endif
591 %ifarch s390 s390x
592 %if 0%{?fedora} || 0%{?rhel}
593 Requires: s390utils
594 %else
595 Requires: s390-tools
596 %endif
597 Requires: parted
598 %endif
599 License: GPL-3.0-or-later
600 Group: %{sysgroup}
601
602 %description -n dracut-kiwi-lib
603 This package contains a collection of methods to provide a library
604 for tasks done in other kiwi dracut modules
605
606 %package -n dracut-kiwi-oem-repart
607 Summary: KIWI - Dracut module for oem(repart) image type
608 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
609 # Ubuntu 16.04 OBS environments refuse to set up due to
610 # initramfs-tools / dracut conflict and initramfs-tools is required
611 # to set up the build environment...
612 BuildRequires: dracut
613 %endif
614 Requires: dracut-kiwi-lib = %{version}-%{release}
615 License: GPL-3.0-or-later
616 Group: %{sysgroup}
617
618 %description -n dracut-kiwi-oem-repart
619 This package contains the kiwi-repart dracut module which is
620 used to repartition the oem disk image to the current disk
621 geometry according to the setup in the kiwi image configuration
622
623 %package -n dracut-kiwi-oem-dump
624 Summary: KIWI - Dracut module for oem(install) image type
625 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
626 # Ubuntu 16.04 OBS environments refuse to set up due to
627 # initramfs-tools / dracut conflict and initramfs-tools is required
628 # to set up the build environment...
629 BuildRequires: dracut
630 %endif
631 Requires: dracut-kiwi-lib = %{version}-%{release}
632 Requires: kexec-tools
633 Requires: gawk
634 Requires: kpartx
635 License: GPL-3.0-or-later
636 Group: %{sysgroup}
637
638 %description -n dracut-kiwi-oem-dump
639 This package contains the kiwi-dump and kiwi-dump-reboot dracut
640 modules which is used to install an oem image onto a target disk.
641 It implements a simple installer which allows for user selected
642 target disk or unattended installation to target. The source of
643 the image to install could be either from media(CD/DVD/USB) or
644 from remote
645
646 %package -n dracut-kiwi-live
647 Summary: KIWI - Dracut module for iso(live) image type
648 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
649 # Ubuntu 16.04 OBS environments refuse to set up due to
650 # initramfs-tools / dracut conflict and initramfs-tools is required
651 # to set up the build environment...
652 BuildRequires: dracut
653 %endif
654 Requires: dialog
655 Requires: xfsprogs
656 Requires: e2fsprogs
657 Requires: util-linux
658 # lsblk is part of util-linux-systemd on openSUSE
659 %if 0%{?suse_version}
660 Requires: util-linux-systemd
661 %endif
662 %if 0%{?debian} || 0%{?ubuntu}
663 Requires: dmsetup
664 Requires: dracut-network
665 %endif
666 %if 0%{?fedora} || 0%{?rhel}
667 Requires: device-mapper
668 Requires: dracut-network
669 %endif
670 %if 0%{?suse_version}
671 Requires: device-mapper
672 %endif
673 Requires: dracut
674 License: GPL-3.0-or-later
675 Group: %{sysgroup}
676
677 %description -n dracut-kiwi-live
678 This package contains the kiwi-live dracut module which is used
679 for booting iso(live) images built with KIWI
680
681 %package -n dracut-kiwi-overlay
682 Summary: KIWI - Dracut module for vmx(+overlay) image type
683 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
684 # Ubuntu 16.04 OBS environments refuse to set up due to
685 # initramfs-tools / dracut conflict and initramfs-tools is required
686 # to set up the build environment...
687 BuildRequires: dracut
688 %endif
689 Requires: dracut-kiwi-lib = %{version}-%{release}
690 Requires: dracut
691 License: GPL-3.0-or-later
692 Group: %{sysgroup}
693
694 %description -n dracut-kiwi-overlay
695 This package contains the kiwi-overlay dracut module which is used
696 for booting vmx images built with KIWI and configured to use an
697 overlay root filesystem
698
699 %package -n dracut-kiwi-verity
700 Summary: KIWI - Dracut module for disk with embedded verity metadata
701 %if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian}
702 # Ubuntu 16.04 OBS environments refuse to set up due to
703 # initramfs-tools / dracut conflict and initramfs-tools is required
704 # to set up the build environment...
705 BuildRequires: dracut
706 %endif
707 Requires: dracut-kiwi-lib = %{version}-%{release}
708 Requires: dracut
709 BuildRequires: gcc
710 License: GPL-3.0-or-later
711 Group: %{sysgroup}
712
713 %description -n dracut-kiwi-verity
714 This package contains the kiwi-verity dracut module which is used
715 for booting oem images built with KIWI and configured to use an
716 embedded verity metadata block via the embed_verity_metadata
717 type attribute
718
719 %package -n kiwi-man-pages
720 Summary: KIWI - manual pages
721 License: GPL-3.0-or-later
722 Group: %{sysgroup}
723
724 %description -n kiwi-man-pages
725 Provides manual pages to describe the kiwi commands
726
727 %package -n kiwi-bash-completion
728 Summary: Bash Completion for kiwi-ng
729 Requires: bash-completion
730 Requires: python%{python3_pkgversion}-kiwi = %{version}
731 %if ! (0%{?debian} || 0%{?ubuntu})
732 Supplements: (%{name} and bash-completion)
733 %endif
734 BuildArch: noarch
735
736 %description -n kiwi-bash-completion
737 Bash command line completion support for python-kiwi - completion
738 of subcommands, parameters and keywords for the kiwi-ng command.
739
740 %if %{with selinux}
741 %package -n kiwi-selinux
742 Summary: SELinux module for kiwi-ng
743 License: GPL-3.0-or-later
744 BuildArch: noarch
745 BuildRequires: selinux-policy
746 BuildRequires: selinux-policy-devel
747 BuildRequires: make
748 %{?selinux_requires}
749
750 %description -n kiwi-selinux
751 This package provides the SELinux policy module to ensure kiwi-ng
752 runs properly under an environment with SELinux enabled.
753 %endif
754
755 %prep
756 %setup -q -n kiwi-%{version}
757
758 # Drop shebang for kiwi/xml_parse.py, as we don't intend to use it
759 # as an independent script
760 sed -e "s|#!/usr/bin/env python||" -i kiwi/xml_parse.py
761
762 # Build documentation
763 make -C doc man
764
765 %if %{with selinux}
766 # Build SELinux module
767 make -C selinux SHARE="%{_datadir}" TARGETS="kiwi"
768 %endif
769
770 # Build application wheel
771 %{__python3} -m build --no-isolation --wheel
772
773 %install
774 # Install application
775 %{__python3} -m installer --destdir %{buildroot} %{?is_deb:--no-compile-bytecode} dist/*.whl
776
777 %if 0%{?is_deb}
778 # Fix where files were installed
779 mv %{buildroot}%{_prefix}/local/* %{buildroot}%{_prefix}
780 mv %{buildroot}%{_prefix}/lib/python3* %{buildroot}%{_prefix}/lib/python3
781 %endif
782
783 # Install man-pages, completion and kiwi default configuration
784 make buildroot=%{buildroot}/ python=%{__python3} install
785
786 # Install dracut modules
787 make buildroot=%{buildroot}/ python=%{__python3} install_dracut
788
789 # Install documentation README / LICENSE
790 make buildroot=%{buildroot}/ docdir=%{_defaultdocdir}/ python=%{__python3} install_package_docs
791
792 # Create symlinks for correct binaries
793 ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi
794 ln -sr %{buildroot}%{_bindir}/kiwi-ng %{buildroot}%{_bindir}/kiwi-ng-3
795
796 %if %{with selinux}
797 # Install SELinux module
798 install -t %{buildroot}%{_datadir}/selinux/packages -Dpm 0644 selinux/kiwi.pp.bz2
799 %endif
800
801 %if "%{_vendor}" != "debbuild"
802 # kiwi pxeboot directory structure to be packed in kiwi-pxeboot
803 %ifarch %{ix86} x86_64
804 %if 0%{?suse_version} >= 1600
805 install -D -m 755 %{SOURCE1001} %{buildroot}%{_tmpfilesdir}/kiwi-pxeboot.conf
806 %else
807 for i in KIWI pxelinux.cfg image upload boot; do \
808 mkdir -p %{buildroot}/srv/tftpboot/$i ;\
809 done
810 %endif
811 %endif
812 %endif
813
814 %if 0%{?fedora} || 0%{?suse_version}
815 %fdupes %{buildroot}/srv/tftpboot
816 %endif
817
818 %if "%{_vendor}" != "debbuild" && 0%{?suse_version} < 1550
819 %ifarch %{ix86} x86_64
820 %pre -n kiwi-pxeboot
821 #============================================================
822 # create user and group tftp if they does not exist
823 if ! /usr/bin/getent group tftp >/dev/null; then
824 %{_sbindir}/groupadd -r tftp
825 fi
826 if ! /usr/bin/getent passwd tftp >/dev/null; then
827 %{_sbindir}/useradd -c "TFTP account" -d /srv/tftpboot -G tftp -g tftp \
828 -r -s /bin/false tftp
829 fi
830 %endif
831 %endif
832
833 %if %{with selinux}
834 %pre -n kiwi-selinux
835 %selinux_relabel_pre
836
837 %post -n kiwi-selinux
838 %selinux_modules_install %{_datadir}/selinux/packages/kiwi.pp.bz2
839 %selinux_relabel_post
840
841 %posttrans -n kiwi-selinux
842 %selinux_relabel_post
843
844 %postun -n kiwi-selinux
845 %selinux_modules_uninstall kiwi
846 if [ $1 -eq 0 ]; then
847 %selinux_relabel_post
848 fi
849 %endif
850
851 %files -n kiwi-systemdeps-core
852 # Empty metapackage
853
854 %files -n kiwi-systemdeps-bootloaders
855 # Empty metapackage
856
857 %files -n kiwi-systemdeps-containers
858 # Empty metapackage
859
860 %files -n kiwi-systemdeps-containers-wsl
861 # Empty metapackage
862
863 %files -n kiwi-systemdeps-iso-media
864 # Empty metapackage
865
866 %files -n kiwi-systemdeps-filesystems
867 # Empty metapackage
868
869 %files -n kiwi-systemdeps-disk-images
870 # Empty metapackage
871
872 %files -n kiwi-systemdeps-image-validation
873 # Empty metapackage
874
875 %files -n kiwi-systemdeps-boxbuild
876 # Empty metapackage
877
878 %files -n kiwi-systemdeps-stackbuild
879 # Empty metapackage
880
881 %files -n kiwi-systemdeps
882 # Empty metapackage
883
884 %files -n python%{python3_pkgversion}-kiwi
885 %dir %{_defaultdocdir}/python-kiwi
886 %dir %{_usr}/share/kiwi
887 %dir %{_usr}/share/kiwi/kiwi.yml.d
888 %dir %_sysconfdir/kiwi.yml.d
889 %doc %{_usr}/share/kiwi/kiwi.yml.example
890 %{_bindir}/kiwi
891 %{_bindir}/kiwi-ng
892 %{_bindir}/kiwi-ng-3*
893 %{python3_sitelib}/kiwi*
894 %{_usr}/share/kiwi/xsl_to_v74/
895 %{_defaultdocdir}/python-kiwi/LICENSE
896 %{_defaultdocdir}/python-kiwi/README
897
898 %files -n kiwi-bash-completion
899 %{_usr}/share/bash-completion/completions/kiwi-ng
900
901 %files -n kiwi-man-pages
902 %doc %{_mandir}/man8/*
903
904 %files -n dracut-kiwi-lib
905 %{_usr}/lib/dracut/modules.d/59kiwi-lib
906
907 %files -n dracut-kiwi-oem-repart
908 %{_usr}/lib/dracut/modules.d/55kiwi-repart
909
910 %files -n dracut-kiwi-oem-dump
911 %{_usr}/lib/dracut/modules.d/55kiwi-dump
912 %{_usr}/lib/dracut/modules.d/59kiwi-dump-reboot
913
914 %files -n dracut-kiwi-live
915 %{_usr}/lib/dracut/modules.d/55kiwi-live
916
917 %files -n dracut-kiwi-overlay
918 %{_usr}/lib/dracut/modules.d/55kiwi-overlay
919
920 %files -n dracut-kiwi-verity
921 %{_usr}/lib/dracut/modules.d/50kiwi-verity
922 %{_bindir}/kiwi-parse-verity
923
924 %if "%{_vendor}" != "debbuild"
925 %ifarch %{ix86} x86_64
926
927 %if 0%{?suse_version} >= 1600
928 %post -n kiwi-pxeboot
929 %tmpfiles_create kiwi-pxeboot.conf
930 %endif
931
932 %files -n kiwi-pxeboot
933 %if 0%{?suse_version} >= 1600
934 %{_tmpfilesdir}/kiwi-pxeboot.conf
935 %ghost %dir %attr(0755,tftp,tftp) /srv/tftpboot
936 %ghost %dir /srv/tftpboot/KIWI
937 %ghost %dir /srv/tftpboot/pxelinux.cfg
938 %ghost %dir /srv/tftpboot/image
939 %ghost %dir /srv/tftpboot/upload
940 %ghost %dir /srv/tftpboot/boot
941 %else
942 %if 0%{?suse_version} < 1550
943 %dir %attr(0755,tftp,tftp) /srv/tftpboot
944 %endif
945 %dir /srv/tftpboot/KIWI
946 %dir /srv/tftpboot/pxelinux.cfg
947 %dir /srv/tftpboot/image
948 %dir /srv/tftpboot/upload
949 %dir /srv/tftpboot/boot
950 %endif
951 %endif
952 %endif
953
954 %if %{with selinux}
955 %files -n kiwi-selinux
956 %doc selinux/README.md
957 %license LICENSE
958 %{_datadir}/selinux/packages/kiwi.pp.bz2
959 %endif
960
961 %changelog