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