forked from oVirt/ovirt-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ovirt-engine.spec.in
1768 lines (1457 loc) · 58.9 KB
/
ovirt-engine.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# CUSTOMIZATION-BEGIN
#
# ovirt_build_extra_flags
# ovirt_build_ut
%if "@MILESTONE@"!="" && 0%{!?ovirt_build_minimal:1}
%global ovirt_build_minimal 1
%endif
%if 0%{?ovirt_build_user_agent:1}
%global _ovirt_build_user_agent %{ovirt_build_user_agent}
%else
%global _ovirt_build_user_agent gecko1_8,safari
%endif
%if 0%{?ovirt_build_quick}
%global _ovirt_build_ut 0
%global ovirt_build_gwt 0
%endif
%if 0%{?ovirt_build_minimal}
%global _ovirt_build_ut 0
%global ovirt_build_all_user_agents 0
%global ovirt_build_locales 0
%global _ovirt_build_extra_flags -D gwt.userAgent=%{_ovirt_build_user_agent}
%endif
%if 0%{?ovirt_build_draft}
%global _ovirt_build_ut 0
%global ovirt_build_all_user_agents 0
%global ovirt_build_locales 0
%global _ovirt_build_extra_flags -D gwt.userAgent=%{_ovirt_build_user_agent} -P gwtdraft
%endif
%if 0%{!?ovirt_build_ut:1}
%if 0%{?_ovirt_build_ut:1}
%global ovirt_build_ut %{_ovirt_build_ut}
%else
%global ovirt_build_ut 1
%endif
%endif
%if 0%{!?ovirt_build_gwt:1}
%global ovirt_build_gwt 1
%endif
%if 0%{!?ovirt_build_locales:1}
%global ovirt_build_locales 1
%endif
%if 0%{!?ovirt_build_all_user_agents:1}
%global ovirt_build_all_user_agents 1
%endif
# Limit GWT resources to pass the build in CBS
%global ovirt_build_extra_flags_rpm -Dgwt.compiler.localWorkers=2
# Set "rhv_build 1" to perform RHV Manager build
%global rhv_build 0
#
# CUSTOMIZATION-END
#
# Do not repack .jar files, as it takes a long time and doesn't have a
# real benefit:
%global __jar_repack 0
%if %{rhv_build}
#
# unsign all provided jars
# see rhbz#1019637
#
%global _jarsign_opts --unsign=/usr/share/ovirt-engine
%endif
#
# rpm does not support override
# nor modify of variables
#
%if %{?ovirt_build_extra_flags_rpm:1}%{?_ovirt_build_extra_flags:1}%{?ovirt_build_extra_flags:1}0
%global EXTRA_BUILD_FLAGS %{ovirt_build_extra_flags_rpm} %{?_ovirt_build_extra_flags:%{_ovirt_build_extra_flags}}%{?ovirt_build_extra_flags: %{ovirt_build_extra_flags}}
%endif
#
# Supported distributions:
# Fedora >= 30
# EL >= 7
#
%global ovirt_product_name oVirt Engine
%global ovirt_product_name_short oVirt Engine
%global ovirt_product_group Virtualization/Management
%global ovirt_user_description oVirt Manager
%global engine_cache %{_localstatedir}/cache/%{engine_name}
%global engine_data %{_datadir}/%{engine_name}
%global engine_doc %{_docdir}/%{engine_name}
%global engine_ear %{engine_data}/engine.ear
%global engine_etc %{_sysconfdir}/%{engine_name}
%global engine_java %{_javadir}/%{engine_name}
%global engine_jboss_modules %{engine_data}/modules
%global engine_log %{_localstatedir}/log/%{engine_name}
%global engine_name ovirt-engine
%global engine_pki %{_sysconfdir}/pki/%{engine_name}
%global engine_restapi_war %{engine_data}/restapi.war
%global engine_apidoc_war %{engine_data}/apidoc.war
%global engine_run %{_localstatedir}/run/%{engine_name}
%global engine_state %{_localstatedir}/lib/%{engine_name}
%global engine_tmp %{_localstatedir}/tmp/%{engine_name}
%global engine_backup_default_dir %{_localstatedir}/lib/%{engine_name}-backup
%global engine_backup_log_default_dir %{_localstatedir}/log/%{engine_name}-backup
%global engine_rpm_state_dir %{_localstatedir}/lib/rpm-state/%{name}
%global engine_setup_rpm_state_flag_file %{engine_rpm_state_dir}/need-engine-setup
%global engine_gid 108
%global engine_group ovirt
%global engine_uid 108
%global engine_user ovirt
%global vdsm_description Node Virtualization Manager
%global vdsm_gid 36
%global vdsm_group kvm
%global vdsm_uid 36
%global vdsm_user vdsm
# Minimal required OpenJDK version
%global openjdk_version 11.0.11
%if 0%{?rhel} || 0%{?fedora} >= 31
%global openstack_java_version 3.2.9
%else
# Needed only until we build for Fedora 30
%global openstack_java_version 3.2.7
%endif
# Macro to create an user:
#
# %1 user name
# %2 user id
# %3 primary group name
# %4 primary group id
# %5 description
# %6 home directory
#
%global _ovirt_create_user() \
getent group %3 >/dev/null || groupadd -r -g %4 %3; \
getent passwd %1 >/dev/null || useradd -r -u %2 -g %3 -c %5 -s /sbin/nologin -d %6 %1
%global ovirt_create_user_engine \
%_ovirt_create_user %{engine_user} %{engine_uid} %{engine_group} %{engine_gid} "%%{ovirt_user_description}" %{engine_state}
%global ovirt_create_user_vdsm \
%_ovirt_create_user %{vdsm_user} %{vdsm_uid} %{vdsm_group} %{vdsm_gid} "%%{vdsm_description}" /var/lib/vdsm
%if %{rhv_build}
%global wildfly_overlay_modules ""
%define extra_common_opts \\\
JBOSS_HOME=/opt/rh/eap7/root/usr/share/wildfly
%else
%global wildfly_overlay_modules "/usr/share/ovirt-engine-wildfly-overlay/modules"
%endif
%global make_common_opts \\\
-j1 \\\
BUILD_GWT=%{ovirt_build_gwt} \\\
BUILD_ALL_USER_AGENTS=%{ovirt_build_all_user_agents} \\\
BUILD_LOCALES=%{ovirt_build_locales} \\\
BUILD_UT=%{ovirt_build_ut} \\\
BUILD_VALIDATION=0 \\\
BUILD_ENV_VALIDATION=0 \\\
PACKAGE_NAME=%{name} \\\
RPM_VERSION=%{version} \\\
RPM_RELEASE=%{release} \\\
DISPLAY_VERSION=%{version}-%{release} \\\
ENGINE_NAME=%{engine_name} \\\
LOCALSTATE_DIR=%{_localstatedir} \\\
PREFIX=%{_prefix} \\\
SYSCONF_DIR=%{_sysconfdir} \\\
BIN_DIR=%{_bindir} \\\
PID_DIR=%{_localstatedir}/run \\\
DATAROOT_DIR=%{_datadir} \\\
MAN_DIR=%{_mandir} \\\
DOC_DIR=%{_docdir} \\\
PYTHON_DIR=%{python3_sitelib} \\\
PYTHON=%{__python3} \\\
PY_VERSION=3 \\\
JAVA_DIR=%{_javadir} \\\
MAVENPOM_DIR=%{_mavenpomdir} \\\
PKG_SYSCONF_DIR=%{engine_etc} \\\
PKG_DOC_DIR=%{engine_doc} \\\
PKG_EAR_DIR=%{engine_ear} \\\
PKG_PKI_DIR=%{engine_pki} \\\
PKG_JBOSS_MODULES=%{engine_jboss_modules} \\\
PKG_CACHE_DIR=%{engine_cache} \\\
PKG_LOG_DIR=%{engine_log} \\\
PKG_BACKUP_DEFAULT_DIR=%{engine_backup_default_dir} \\\
PKG_BACKUP_LOG_DEFAULT_DIR=%{engine_backup_log_default_dir} \\\
PKG_TMP_DIR=%{engine_tmp} \\\
PKG_STATE_DIR=%{engine_state} \\\
PKG_USER=%{engine_user} \\\
PKG_GROUP=%{engine_group} \\\
POSTGRESQL_SYSTEMD_SERVICE=postgresql.service \\\
WILDFLY_OVERLAY_MODULES=%{wildfly_overlay_modules} \\\
%{?EXTRA_BUILD_FLAGS:EXTRA_BUILD_FLAGS="%{EXTRA_BUILD_FLAGS}"} \\\
%{?extra_common_opts}
%if %{rhv_build}
%global extra_backend_requires Requires: rhvm-branding-rhv >= 4.3.0
%global extra_setup_requires Requires: rhvm-setup-plugins >= 4.5.0-0.1
%global spice_version 8.0
%endif
Name: @PACKAGE_NAME@
Version: @RPM_VERSION@
Release: @RPM_RELEASE@%{?release_suffix}%{?dist}
Summary: Management server for Open Virtualization
Group: %{ovirt_product_group}
License: ASL 2.0
%if !%{rhv_build}
URL: http://www.ovirt.org
%else
URL: http://www.redhat.com/products/virtualization
%endif
Source0: http://resources.ovirt.org/pub/ovirt-master-snapshot/src/@PACKAGE_NAME@/@PACKAGE_NAME@-@[email protected]
BuildArch: noarch
ExcludeArch: s390x ppc64le
%if %{rhv_build}
BuildRequires: perl
%endif
BuildRequires: java-11-openjdk-devel >= %{openjdk_version}
BuildRequires: javapackages-tools
BuildRequires: make
BuildRequires: maven >= 3.6.0
BuildRequires: python3-devel
BuildRequires: python3-distro
BuildRequires: systemd
BuildRequires: unzip
BuildRequires: javapackages-local
BuildRequires: ovirt-engine-build-dependencies >= 4.5.3
Requires(pre): shadow-utils
%if %{rhv_build}
Requires: eap7-wildfly >= 7.4.2
Requires: rhvm = %{version}-%{release}
# RHV 4.4 SP1 requires RHEL 8.6 EUS and it's not supported on RHEL 8.7+
Requires: redhat-release >= 8.6, redhat-release < 8.7
Conflicts: redhat-release >= 8.7
%else
# There is no way how to prevent WildFly not being upgraded, so we need to
# fix engine to work with current and new WildFly version and only afterwards
# bump the requirement (otherwise we would need to pass wildfly,
# wildfly-overlay and ovirt-engine through the change queue at once)
Requires: ovirt-engine-wildfly-overlay >= 24
%endif
Requires: %{name}-backend = %{version}-%{release}
Requires: %{name}-dbscripts = %{version}-%{release}
Requires: %{name}-restapi = %{version}-%{release}
Requires: %{name}-tools = %{version}-%{release}
Requires: %{name}-webadmin-portal = %{version}-%{release}
Requires: %{name}-websocket-proxy >= %{version}-%{release}
Requires: %{name}-vmconsole-proxy-helper >= %{version}-%{release}
Requires: %{name}-ui-extensions >= 1.0.4
# From ovirt-engine-4.5.0 ansible-core and ansible-runner are required,
# ansible-runner-service is obsoleted
Requires: ansible-core >= 2.13.0
Requires: ansible-runner >= 2.1.3
%if 0%{?rhel} < 9
Obsoletes: ansible-runner-service < 1.1.0
Obsoletes: python3-ansible-runner < 2.0.0
%endif
Requires: apache-commons-compress
Requires: java-11-openjdk-headless >= %{openjdk_version}
Requires: javapackages-tools
Requires: ovirt-imageio-daemon >= 2.0.10-1
Requires: slf4j >= 1.7.0
Requires: ws-commons-util
Requires: xmlrpc-client
Requires: ovirt-ansible-collection >= 3.0.0
Requires: ovirt-web-ui
Requires: ovirt-cockpit-sso
%if 0%{?rhel} < 9
# ovirt-engine-api-explorer has never been built for el9
Obsoletes: ovirt-engine-api-explorer
%endif
%if 0%{?rhel} < 9
# fapolicyd should be installed but does not have to be running
# needed for OpenScap DISA STIG compliance
#
# TODO: remove condition when fapolicyd-1.1 is available on CS9
Requires: fapolicyd >= 1.1
%else
Requires: fapolicyd
%endif
Requires: scap-security-guide >= 0.1.60-4
# Metrics stuff
Requires: collectd >= 5.12.0-7
Requires: collectd-postgresql >= 5.12.0-7
Requires: collectd-disk >= 5.12.0-7
Requires: collectd-write_http >= 5.12.0-7
%if 0%{?rhel}
# collectd-write_syslog is available only on EL
Requires: collectd-write_syslog >= 5.12.0-7
%endif
# Requirements for ovirt-engine-metrics
Requires: rsyslog
Requires: rsyslog-elasticsearch
Requires: rsyslog-mmjsonparse
Requires: rsyslog-mmnormalize
Requires: libfastjson
Requires: liblognorm
Requires: libestr
Requires: postgresql-jdbc >= 42.2.27
Requires: postgresql-server >= 12.0
Requires: postgresql-contrib >= 12.0
Requires: openstack-java-cinder-client >= %{openstack_java_version}
Requires: openstack-java-cinder-model >= %{openstack_java_version}
Requires: openstack-java-client >= %{openstack_java_version}
Requires: openstack-java-glance-client >= %{openstack_java_version}
Requires: openstack-java-glance-model >= %{openstack_java_version}
Requires: openstack-java-keystone-client >= %{openstack_java_version}
Requires: openstack-java-keystone-model >= %{openstack_java_version}
Requires: openstack-java-quantum-client >= %{openstack_java_version}
Requires: openstack-java-quantum-model >= %{openstack_java_version}
Requires: openstack-java-resteasy-connector >= %{openstack_java_version}
Requires: python3-dnf-plugin-versionlock
Requires: apache-sshd >= 2.9.2
Requires: ed25519-java >= 0.3.0
Requires: slf4j-jdk14 >= 1.7.0
Requires: jcl-over-slf4j >= 1.7.0
Requires: snmp4j >= 3.6.4
Requires: ovirt-dependencies >= 4.5.2
# cinderlib integration
# https://bugzilla.redhat.com/1955375
Requires: ceph-common
Requires: python3-cinderlib
%{?extra_main_requires}
# We can't require exactly the same version and release of the
# setup package because it needs to be updated independently as part
# of the update process implemented in the engine-upgrade script:
Requires: %{name}-setup >= %{version}-%{release}
# We can drop these conflicts when
# we drop Requires: mod_ssl
Conflicts: freeipa-server
Conflicts: ipa-server
Conflicts: python2-ipaserver
Conflicts: python3-ipaserver
# Userportal is retired
%if 0%{?rhel} < 9
# ovirt-engine-userportal has never been built for el9
Obsoletes: %{name}-userportal
%endif
# OVS/OVN stuff
Requires: python3-pyOpenSSL
Requires: ovirt-provider-ovn >= 1.2.1
# JavaScript and CSS "private" libraries bundled in branding (for CVE scanning purposes)
# https://docs.fedoraproject.org/en-US/fesco/Bundled_Software_policy/
# https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/#_private_libraries
# https://docs.fedoraproject.org/en-US/packaging-guidelines/JavaScript/#_bundling_of_other_libraries
Provides: bundled(js-jquery) = 3.6.0
Provides: bundled(js-jquery-ui) = 1.13.1
Provides: bundled(js-bootstrap) = 3.4.1
Provides: bundled(js-patternfly) = 3.59.3
Provides: bundled(js-patternfly-next) = 2.26.1
# logger-log4j is replaced by internal ovirt-engine implementation
%if 0%{?rhel} < 9
# logger-log4j has never been built for el9
Obsoletes: ovirt-engine-extension-logger-log4j
%endif
%description
%{ovirt_product_name} is a feature-rich server virtualization management
system that provides advanced capabilities for managing the Open
virtualization infrastructure for Servers and Desktops.
%if %{rhv_build}
%package -n rhvm
Summary: Red Hat Virtualization Manager
Group: %{ovirt_product_group}
Requires: ovirt-engine = %{version}-%{release}
Requires: ovirt-log-collector >= 4.3.0
Requires: rhv-log-collector-analyzer
# misc packages
Requires: spice-client-win-x64 >= %{spice_version}
Requires: spice-client-win-x86 >= %{spice_version}
%description -n rhvm
Red Hat Virtualization is a feature-rich server virtualization management
system that provides advanced capabilities for managing Red Hat
virtualization infrastructure for Servers and Desktops.
%endif
%package -n python%{python3_pkgversion}-%{name}-lib
Summary: %{ovirt_product_name_short} library
Group: %{ovirt_product_group}
Requires: python3-cryptography
Requires: python3-dateutil
Requires: python3-daemon >= 2.1.2
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-lib}
%description -n python%{python3_pkgversion}-%{name}-lib
%{ovirt_product_name_short} library for python3
%package backend
Summary: Engine core of %{ovirt_product_name_short}
Group: %{ovirt_product_group}
License: ASL 2.0 and LGPLv3 and GPLv3
Requires: %{name} = %{version}-%{release}
Requires: %{name}-extensions-api >= 1.0.1
Requires: aopalliance >= 1.0
Requires: curl
Requires: ebay-cors-filter
Requires: httpd
Requires: java-11-openjdk-headless >= %{openjdk_version}
Requires: logrotate
Requires: mailcap
Requires: mod_ssl
Requires: novnc >= 1.0.0
Requires: python3-%{name}-lib >= %{version}-%{release}
Requires: openssh
Requires: vdsm-jsonrpc-java >= 1.7.2, vdsm-jsonrpc-java < 1.8.0
Requires: java-client-kubevirt >= 0.5.0
Requires: openssl
Requires: ovirt-engine-extension-aaa-jdbc >= 1.2.0
Requires: python3-jinja2
%{?extra_backend_requires}
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%pre backend
%ovirt_create_user_engine
%post backend
%systemd_post ovirt-engine.service
%preun backend
%systemd_preun ovirt-engine.service
%postun backend
%systemd_postun ovirt-engine.service
%description backend
The backend engine of %{ovirt_product_name_short}
%package restapi
Summary: RESTful API for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name} = %{version}-%{release}
%description restapi
The RESTful API for %{ovirt_product_name_short}
%package setup-base
Summary: %{ovirt_product_name_short} suite base setup components.
Group: %{ovirt_product_group}
Requires: python3-%{name}-lib >= %{version}-%{release}
Requires: python3-ovirt-setup-lib >= 1.1.1
Requires: bind-utils
Requires: iproute
Requires: python3-libxml2
Requires: logrotate
Requires: python3-otopi >= 1.10.3
Requires: python3-paramiko
Requires: python3-distro
Requires(pre): shadow-utils
Conflicts: %{name}-dwh < 4.4.0
Conflicts: %{name}-dwh-setup < 4.5.6
Conflicts: %{name}-keycloak-setup < 15.0.2-6
%description setup-base
%{ovirt_product_name_short} suite base setup components.
%pre setup-base
%ovirt_create_user_engine
%package setup
Summary: Setup and upgrade scripts for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name}-setup-plugin-ovirt-engine = %{version}-%{release}
%{?extra_setup_requires}
%if %{rhv_build}
# RHV 4.4 SP1 requires RHEL 8.6 EUS and it's not supported on RHEL 8.7+
Requires: redhat-release >= 8.6, redhat-release < 8.7
Conflicts: redhat-release >= 8.7
%endif
%description setup
Setup and upgrade scripts for %{ovirt_product_name_short}
%post setup
# If this is an update, tell the users they need to run engine-setup
if [ $1 -gt 1 -a -e "%{_sysconfdir}/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf" ]; then
touch %{engine_setup_rpm_state_flag_file}
echo "Updating ovirt-engine-setup. To update the engine, you need to run: engine-setup"
fi
%posttrans setup
if [ -e %{engine_setup_rpm_state_flag_file} -a -e "%{_sysconfdir}/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf" ]; then
echo "Updated ovirt-engine-setup. To update the engine, you need to run: engine-setup"
fi
rm -f %{engine_setup_rpm_state_flag_file}
%package setup-plugin-ovirt-engine
Summary: Setup and upgrade specific plugins for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name} >= 4.4.0
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
Requires: %{name}-setup-plugin-vmconsole-proxy-helper = %{version}-%{release}
Requires: %{name}-setup-plugin-cinderlib = %{version}-%{release}
Requires: %{name}-setup-plugin-imageio = %{version}-%{release}
Requires: %{name}-dwh-setup >= 4.4.1.2
%if !%{rhv_build}
Requires: ovirt-engine-keycloak-setup
%endif
Requires: ovirt-engine-extension-aaa-jdbc >= 1.2.0
Requires: openssh
Requires: postgresql-server >= 12.0
Requires: postgresql-contrib >= 12.0
Conflicts: %{name} < 4.4.0
# See rhbz# 1676461
Requires: ovirt-vmconsole >= 1.0.7
# OVS/OVN stuff, for firewalld service files
%if 0%{?rhel} >= 9
# OVS 2.17 and OVN 2022 are the lowest supported versions on EL9
Requires: ovirt-openvswitch-ovn-central >= 2.17
%else
Requires: ovirt-openvswitch-ovn-central >= 2.15
%endif
Requires: ovirt-provider-ovn >= 1.2.35
%description setup-plugin-ovirt-engine
Setup and upgrade specific plugins for %{ovirt_product_name_short}
%pre setup-plugin-ovirt-engine
%ovirt_create_user_vdsm
%package setup-plugin-ovirt-engine-common
Summary: Setup and upgrade common plugins for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name}-setup-base = %{version}-%{release}
Requires: python3-libselinux
Requires: policycoreutils-python-utils
Requires: python3-psycopg2
Requires(pre): shadow-utils
Requires: java-11-openjdk-headless >= %{openjdk_version}
Requires: python3-pwquality
Requires: python3-cryptography
Requires: python3-dnf
# We can drop these conflicts when
# we drop Requires: mod_ssl
# conflict here so we can avoid upgrade
# of setup at this environment, this
# will produce early error.
Conflicts: ipa-server
Conflicts: freeipa-server
%description setup-plugin-ovirt-engine-common
Setup and upgrade common plugins for %{ovirt_product_name_short}
%package dbscripts
Summary: Database scripts for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name} = %{version}-%{release}
%description dbscripts
Database scripts for %{ovirt_product_name_short}
%package webadmin-portal
Summary: Web Admin Portal of %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name} = %{version}-%{release}
# Bundled JavaScript and CSS libraries use MIT license.
License: ASL 2.0 and GPLv2+ with exceptions and MIT
%description webadmin-portal
The web administration interface to %{ovirt_product_name_short}
%package tools
Summary: %{ovirt_product_name_short} Tools
Group: %{ovirt_product_group}
Requires: %{name} = %{version}-%{release}
Requires: python3-%{name}-lib >= %{version}-%{release}
Requires: %{name}-tools-backup = %{version}-%{release}
Requires: ovirt-engine-metrics >= 1.3.4.1
Requires: java-11-openjdk-headless >= %{openjdk_version}
Requires: logrotate
Requires: python3-dateutil
Requires: python3-netaddr
Requires: python3-psycopg2
Requires: python3-six
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description tools
%{ovirt_product_name_short} Tools
%pre tools
%ovirt_create_user_engine
%post tools
%systemd_post ovirt-engine-notifier.service
%systemd_post ovirt-fence-kdump-listener.service
%postun tools
%systemd_postun ovirt-engine-notifier.service
%systemd_postun ovirt-fence-kdump-listener.service
%preun tools
%systemd_preun ovirt-engine-notifier.service
%systemd_preun ovirt-fence-kdump-listener.service
%package tools-backup
Summary: %{ovirt_product_name_short} Tools (engine-backup)
Group: %{ovirt_product_group}
Requires: %{name}-setup-plugin-ovirt-engine-common >= %{version}-%{release}
Requires: tar
Requires: bzip2
Requires: xz
Requires: python3-otopi >= 1.10.3
Requires: python3-distro
Requires: postgresql >= 12.0
Requires: sqlite
%description tools-backup
%{ovirt_product_name_short} Tools (engine-backup)
%package websocket-proxy
Summary: %{ovirt_product_name_short} Websocket Proxy
Group: %{ovirt_product_group}
Requires: python3-%{name}-lib >= %{version}-%{release}
Requires: python3-numpy
Requires: python3-dateutil
Requires: python3-websockify
Requires: python3-websocket-client
Requires: %{name}-setup-plugin-websocket-proxy >= %{version}-%{release}
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description websocket-proxy
%{ovirt_product_name_short} Websocket Proxy
%pre websocket-proxy
%ovirt_create_user_engine
%post websocket-proxy
%systemd_post ovirt-websocket-proxy.service
%postun websocket-proxy
%systemd_postun ovirt-websocket-proxy.service
%preun websocket-proxy
%systemd_preun ovirt-websocket-proxy.service
%package setup-plugin-websocket-proxy
Summary: Setup and upgrade specific plugins for websocket-proxy
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
Requires: python3-six
%description setup-plugin-websocket-proxy
Setup and upgrade specific plugins for websocket-proxy
%package vmconsole-proxy-helper
Summary: %{ovirt_product_name_short} VMconsole Proxy Helper
Group: %{ovirt_product_group}
Requires: python3-%{name}-lib >= %{version}-%{release}
Requires: %{name}-setup-plugin-vmconsole-proxy-helper >= %{version}-%{release}
Requires: ovirt-vmconsole-proxy
%description vmconsole-proxy-helper
%{ovirt_product_name_short} VMconsole Proxy helper, to integrate
with ovirt-vmconsole-proxy package
%package setup-plugin-vmconsole-proxy-helper
Summary: Setup and upgrade specific plugins for vmconsole-proxy-helper
Requires: %{name}-setup-plugin-ovirt-engine = %{version}-%{release}
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
Requires: openssh
%description setup-plugin-vmconsole-proxy-helper
Setup and upgrade specific plugins for vmconsole-proxy-helper
%package health-check-bundler
Summary: %{ovirt_product_name_short} health check bundler.
Group: %{ovirt_product_group}
Requires: %{name}-setup-base = %{version}-%{release}
Requires: makeself >= 2.2
%description health-check-bundler
A utility for creating a bundle script that runs a health check.
%package setup-plugin-cinderlib
Summary: Setup and upgrade specific plugins for cinderlib integration database
Requires: %{name}-setup-plugin-ovirt-engine = %{version}-%{release}
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
Requires: openssh
%description setup-plugin-cinderlib
Setup and upgrade specific plugins for cinderlib integration database
%package setup-plugin-imageio
Summary: Setup imageio service.
Requires: %{name}-setup-plugin-ovirt-engine = %{version}-%{release}
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
# For --show-config, needed during upgrade.
Requires: ovirt-imageio-daemon >= 2.0.10-1
%description setup-plugin-imageio
Setup imageio service.
%prep
%setup -c -q
%build
# Set the location of the JDK that will be used for compilation:
export JAVA_HOME="${JAVA_HOME:=/usr/lib/jvm/java-11-openjdk}"
make %{make_common_opts}
%install
rm -fr "%{buildroot}"
make %{make_common_opts} install DESTDIR="%{buildroot}"
# Compile python files
%py_byte_compile %{__python3} %{buildroot}%{_libexecdir}/
%py_byte_compile %{__python3} %{buildroot}%{engine_data}/
%{__python3} -m compileall -f -q -d "%{python3_sitelib}" "%{buildroot}%{python3_sitelib}"
%{__python3} -O -m compileall -f -q -d "%{python3_sitelib}" "%{buildroot}%{python3_sitelib}"
#
# /var creation
#
install -dm 750 "%{buildroot}/%{engine_state}"
install -dm 700 "%{buildroot}/%{engine_state}/.ssh"
install -dm 755 "%{buildroot}/%{engine_state}"/{content,setup/answers,ansible-runner}
# see also relevant %%dir line to set permissions
install -dm 700 "%{buildroot}/%{engine_log}"
install -dm 700 "%{buildroot}/%{engine_log}"/{ova,host-deploy,setup,notifier,dump,ansible,db-manual,brick-setup,cinderlib}
install -dm 755 "%{buildroot}/%{engine_cache}"
install -dm 755 "%{buildroot}/%{engine_run}/notifier"
#
# Create oVirt SSH configuration as empty file. It will be used internally by internal Ansible execution.
#
touch "%{buildroot}/%{engine_state}/.ssh/config"
#
# Force TLS/SSL for selected applications.
#
for war in \
"%{buildroot}%{engine_ear}"/{webadmin,enginesso,welcome}.war \
"%{buildroot}%{engine_restapi_war}" \
; do
sed -i \
-e 's#<transport-guarantee>NONE</transport-guarantee>#<transport-guarantee>CONFIDENTIAL</transport-guarantee>#' \
-e 's#<secure>false</secure>#<secure>true</secure>#' \
"${war}/WEB-INF/web.xml"
done
#
# Move jars to destribution location
#
install -dm 755 "%{buildroot}%{engine_java}"
while read lib_path; do
java_path="%{engine_java}/$(basename "${lib_path}")"
if ! [ -e "%{buildroot}/${java_path}" ] && [ -f "%{buildroot}/${lib_path}" ]; then
cp "%{buildroot}/${lib_path}" "%{buildroot}/${java_path}"
fi
rm -f "%{buildroot}/${lib_path}"
ln -s "${java_path}" "%{buildroot}${lib_path}"
done << __EOF__
%{engine_data}/logutils/logutils.jar
%{engine_ear}/bll.jar
%{engine_ear}/lib/vdsbroker.jar
%{engine_ear}/lib/scheduler.jar
%{engine_jboss_modules}/common/org/ovirt/engine/api/interface-common-jaxrs/main/interface-common-jaxrs.jar
%{engine_jboss_modules}/common/org/ovirt/engine/api/restapi-definition/main/restapi-definition.jar
%{engine_jboss_modules}/common/org/ovirt/engine/api/restapi-jaxrs/main/restapi-jaxrs.jar
%{engine_jboss_modules}/common/org/ovirt/engine/api/restapi-types/main/restapi-types.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/aaa/main/aaa.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/branding/main/branding.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/common/main/common.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/compat/main/compat.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/dal/main/dal.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/extensions-tool/main/extensions-tool.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/sso-client-registration-tool/main/sso-client-registration-tool.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/extensions-manager/main/extensions-manager.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/searchbackend/main/searchbackend.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/tools/main/tools.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/utils/main/utils.jar
%{engine_jboss_modules}/common/org/ovirt/engine/core/uutils/main/uutils.jar
%{engine_jboss_modules}/common/org/ovirt/engine/extension/aaa/builtin/main/builtin.jar
%{engine_ear}/docs.war/WEB-INF/lib/branding.jar
%{engine_ear}/enginesso.war/WEB-INF/lib/branding.jar
%{engine_ear}/webadmin.war/WEB-INF/lib/branding.jar
%{engine_ear}/welcome.war/WEB-INF/lib/branding.jar
__EOF__
# Needed for compatibility if package is different than the directory structure
%if "%{name}" != "%{engine_name}"
ln -s "%{engine_name}" "%{buildroot}%{engine_java}/../%{name}"
%endif
#
# Link dependencies to system provided
#
while read dst src; do
[ -z "${dst}" ] && continue
[ -z "${src}" ] && src="$(basename "${dst}")"
dst="%{engine_jboss_modules}/${dst}"
src="%{_javadir}/${src}"
rm -f "%{buildroot}${dst}"
ln -s "${src}" "%{buildroot}${dst}"
done << __EOF__
common/com/woorea/openstack/sdk/main/cinder-client.jar openstack-java-sdk/cinder-client.jar
common/com/woorea/openstack/sdk/main/cinder-model.jar openstack-java-sdk/cinder-model.jar
common/com/woorea/openstack/sdk/main/glance-client.jar openstack-java-sdk/glance-client.jar
common/com/woorea/openstack/sdk/main/glance-model.jar openstack-java-sdk/glance-model.jar
common/com/woorea/openstack/sdk/main/keystone-client.jar openstack-java-sdk/keystone-client.jar
common/com/woorea/openstack/sdk/main/keystone-model.jar openstack-java-sdk/keystone-model.jar
common/com/woorea/openstack/sdk/main/openstack-client.jar openstack-java-sdk/openstack-client.jar
common/com/woorea/openstack/sdk/main/quantum-client.jar openstack-java-sdk/quantum-client.jar
common/com/woorea/openstack/sdk/main/quantum-model.jar openstack-java-sdk/quantum-model.jar
common/com/woorea/openstack/sdk/main/resteasy-connector.jar openstack-java-sdk/resteasy-connector.jar
common/net/i2p/crypto/eddsa/main/eddsa.jar
common/org/aopalliance/main/aopalliance.jar
common/org/apache/commons/compress/main/commons-compress.jar
common/org/apache/sshd/main/sshd-core.jar apache-sshd/sshd-core.jar
common/org/apache/sshd/main/sshd-common.jar apache-sshd/sshd-common.jar
common/org/apache/ws/commons/main/ws-commons-util.jar
common/org/apache/xmlrpc/main/xmlrpc-client.jar
common/org/apache/xmlrpc/main/xmlrpc-common.jar
common/org/ebaysf/web/cors-filter/main/cors-filter.jar ebay-cors-filter/cors-filter.jar
common/org/ovirt/engine/api/ovirt-engine-extensions-api/main/ovirt-engine-extensions-api.jar ovirt-engine-extensions-api/ovirt-engine-extensions-api.jar
common/org/ovirt/java-client-kubevirt/main/java-client-kubevirt.jar java-client-kubevirt/java-client-kubevirt.jar
common/org/ovirt/vdsm-jsonrpc-java/main/vdsm-jsonrpc-java-client.jar vdsm-jsonrpc-java/vdsm-jsonrpc-java-client.jar
common/org/postgresql/main/postgresql.jar postgresql-jdbc.jar
common/org/snmp4j/main/snmp4j.jar snmp4j.jar
tools/org/slf4j/main/slf4j-api.jar slf4j/slf4j-api.jar
tools/org/slf4j/main/slf4j-jdk14.jar slf4j/slf4j-jdk14.jar
tools/org/slf4j/jcl-over-slf4j/main/jcl-over-slf4j.jar slf4j/jcl-over-slf4j.jar
common/org/springframework/main/spring-aop.jar ovirt-dependencies/spring-aop.jar
common/org/springframework/main/spring-asm.jar ovirt-dependencies/spring-asm.jar
common/org/springframework/main/spring-beans.jar ovirt-dependencies/spring-beans.jar
common/org/springframework/main/spring-context.jar ovirt-dependencies/spring-context.jar
common/org/springframework/main/spring-core.jar ovirt-dependencies/spring-core.jar
common/org/springframework/main/spring-expression.jar ovirt-dependencies/spring-expression.jar
common/org/springframework/main/spring-instrument.jar ovirt-dependencies/spring-instrument.jar
common/org/springframework/main/spring-jdbc.jar ovirt-dependencies/spring-jdbc.jar
common/org/springframework/main/spring-tx.jar ovirt-dependencies/spring-tx.jar
__EOF__
while read dst src; do
[ -z "${dst}" ] && continue
[ -z "${src}" ] && src="$(basename "${dst}")"
dst="%{engine_jboss_modules}/${dst}"
src="%{_jnidir}/${src}"
rm -f "%{buildroot}${dst}"
ln -s "${src}" "%{buildroot}${dst}"
done << __EOF__
../engine.ear/webadmin.war/WEB-INF/lib/gwt-servlet.jar ovirt-dependencies/gwt-servlet.jar
__EOF__
#
# Register services
#
install -dm 755 "%{buildroot}%{_unitdir}"
for service in ovirt-engine ovirt-engine-notifier ovirt-fence-kdump-listener ovirt-websocket-proxy; do
cp "%{buildroot}%{engine_data}/services/${service}/${service}.systemd" "%{buildroot}%{_unitdir}/${service}.service"
done
#
# Package customization
#
install -d "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d"
cat > "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging.conf" << __EOF__
[environment:default]
OVESETUP_APACHE/configureRootRedirectionDefault=bool:True
OVESETUP_CONFIG/validFirewallManagers=str:firewalld
__EOF__
%if %{rhv_build}
# just add to the list
cat >> "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging.conf" << __EOF__
OVESETUP_CONFIG/jbossHome=str:/opt/rh/eap7/root/usr/share/wildfly
OVESETUP_CONFIG/pkiRenewalDocUrl=str:https://access.redhat.com/solutions/1572983
__EOF__
# Disable automatic keycloak integration in RHV.
# Manual integration of RHV with Red Hat Single Sign On, aka RHSSO, is documented at
# "Installing and Configuring Red Hat Single Sign-On" in:
# https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.4/html/administration_guide
cat >> "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging.conf" << __EOF__
OVESETUP_CONFIG/keycloakSupported=bool:False
__EOF__
cat > "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging-wsp.conf" << __EOF__
[environment:default]
__EOF__
%else
cat > "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging-jboss.conf" << __EOF__
[environment:default]
OVESETUP_CONFIG/jbossHome=str:/usr/share/ovirt-engine-wildfly
OVESETUP_RPMDISTRO/jbossPackages=str:ovirt-engine-wildfly,ovirt-engine-wildfly-overlay
__EOF__
%endif
mkdir -p %{buildroot}/%{engine_rpm_state_dir}
%if %{rhv_build}
ln -s /usr/share/spice "%{buildroot}%{engine_data}/files/spice"
#
# unsign ear
# see rhbz#1019637
# copied from redhat-rpm-config::brp-jboss-sign-jars::unsign_jarfile
#
rm -f "%{buildroot}%{engine_ear}/META-INF"/*.{DSA,RSA,SF}
perl -i -pe 'BEGIN{undef $/;} s/Name: [^\n]+\n( [^\n]+\n)*([^\s]+-Digest: [^\n]+\n(\s)?)+(Magic: [^\n]+\n)?\n//mgs' "%{buildroot}%{engine_ear}/META-INF/MANIFEST.MF"
perl -i -pe 's/^SHA1-Digest: [^\n]+\n//g' "%{buildroot}%{engine_ear}/META-INF/MANIFEST.MF"
%endif
echo "Install complete"
%preun
if [ "$1" -eq 0 ]; then
#
# backup pki dir into the backup dir with current date
#
if [ -d "%{engine_pki}" ]; then
dest="%{engine_pki}/../%{engine_name}-backups/%{engine_name}-$(date +"%%Y%%m%%d%%H%%M%%S")"
mkdir -p "${dest}"
cp -pR "%{engine_pki}" "${dest}"
fi
fi
%postun
if [ "$1" -eq 0 ]; then
rm -rf "%{engine_cache}"
rm -rf "%{engine_pki}"
if [ -f "%{_sysconfdir}/yum/pluginconf.d/versionlock.list" ]; then
sed -i '/%{name}/d' "%{_sysconfdir}/yum/pluginconf.d/versionlock.list"
fi
if [ -f "%{_sysconfdir}/dnf/plugins/versionlock.list" ]; then
sed -i '/%{name}/d' "%{_sysconfdir}/dnf/plugins/versionlock.list"
fi
fi
%pre
%ovirt_create_user_engine
%files
%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_cache}
# see also relevant install command to set permissions
%dir %attr(700, %{engine_user}, %{engine_group}) %{engine_log}
%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_log}/dump
%dir %{engine_data}
%dir %{engine_data}/bin
%dir %{engine_data}/brands
%dir %{engine_data}/conf
%dir %{engine_data}/cinderlib
%dir %{engine_data}/engine.ear