forked from oVirt/ovirt-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ovirt-engine.spec.in
1273 lines (1107 loc) · 41.5 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 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=gecko1_8
%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=gecko1_8 -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
#
# CUSTOMIZATION-END
#
# Do not repack .jar files, as it takes a long time and doesn't have a
# real benefit:
%global __jar_repack 0
#
# rpm does not support override
# nor modify of variables
#
%if %{?_ovirt_build_extra_flags:1}%{?ovirt_build_extra_flags:1}0
%global EXTRA_BUILD_FLAGS %{?_ovirt_build_extra_flags:%{_ovirt_build_extra_flags}}%{?ovirt_build_extra_flags: %{ovirt_build_extra_flags}}
%endif
#
# Supported distributions:
# Fedora >= 28
# EL >= 7
#
%global ovirt_install_poms 1
%global ovirt_provides_jboss 1
%global jboss ovirt-engine-wildfly-overlay
%if 0%{?fedora}
%global ovirt_rh_postgresql95 0
%global postgresql_systemd_service postgresql.service
%else
%global ovirt_rh_postgresql95 1
%global postgresql_systemd_service rh-postgresql95-postgresql.service
%endif
%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
%if 0%{?fedora}
%global policycoreutils_python_utils policycoreutils-python-utils
%else
%global policycoreutils_python_utils policycoreutils-python
%endif
%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_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
%global openstack_java_version 3.1.2
# 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 %{ovirt_provides_jboss}
%global wildfly_overlay_modules "/usr/share/ovirt-engine-wildfly-overlay/modules"
%else
%global wildfly_overlay_modules ""
%endif
%if 0%{?fedora}
%global with_python3 1
%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 \\\
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=%{__python2} \\\
PYTHON_DIR=%{python2_sitelib} \\\
%{?with_python3: PYTHON3=%{__python3}} \\\
%{?with_python3: PYTHON3_DIR=%{python3_sitelib}} \\\
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_TMP_DIR=%{engine_tmp} \\\
PKG_STATE_DIR=%{engine_state} \\\
PKG_USER=%{engine_user} \\\
PKG_GROUP=%{engine_group} \\\
POSTGRESQL_SYSTEMD_SERVICE=%{postgresql_systemd_service} \\\
WILDFLY_OVERLAY_MODULES=%{wildfly_overlay_modules} \\\
%{?EXTRA_BUILD_FLAGS:EXTRA_BUILD_FLAGS="%{EXTRA_BUILD_FLAGS}"}
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
URL: http://www.ovirt.org
Source0: http://resources.ovirt.org/pub/ovirt-master-snapshot/src/@PACKAGE_NAME@/@PACKAGE_NAME@-@[email protected]
BuildArch: noarch
BuildRequires: assertj-core >= 2.2.0
BuildRequires: archaius-core
BuildRequires: hystrix-core
BuildRequires: hystrix-metrics-event-stream
BuildRequires: rxjava
BuildRequires: java-1.8.0-openjdk-devel >= 1:1.8.0
BuildRequires: jpackage-utils
BuildRequires: make
BuildRequires: maven
BuildRequires: python
BuildRequires: python2-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
%endif
BuildRequires: systemd
BuildRequires: unzip
# TODO Replace add_maven_depmap and then remove. See also:
# https://lists.fedoraproject.org/archives/list/[email protected]/message/R3KZ7VI5DPCMCELFIVJQ4AXB2WQED35C/
%if 0%{?fedora} >= 27
BuildRequires: javapackages-local
%endif
Requires(pre): shadow-utils
Requires: %{jboss} >= 11.0.1
Requires: %{name}-backend = %{version}-%{release}
Requires: %{name}-cli >= 3.6.2.0
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}-dashboard >= 1.2.0
Requires: ansible >= 2.5
Requires: apache-commons-compress
Requires: apache-commons-configuration
Requires: apache-commons-jxpath
Requires: archaius-core
Requires: hystrix-core
Requires: hystrix-metrics-event-stream
Requires: jakarta-commons-httpclient
Requires: java-openjdk-headless >= 1:1.8.0
Requires: jpackage-utils
Requires: objectweb-asm
Requires: ovirt-iso-uploader >= 4.1.0
Requires: rxjava
Requires: slf4j >= 1.7.0
Requires: ws-commons-util
Requires: xmlrpc-client
Requires: ovirt-ansible-roles >= 1.1.2
Requires: ovirt-imageio-proxy
Requires: ovirt-web-ui
Requires: ovirt-cockpit-sso
Requires: ovirt-js-dependencies
Requires: ovirt-engine-api-explorer
# Metrics stuff
Requires: collectd
Requires: collectd-postgresql
Requires: collectd-disk
Requires: collectd-write_http
%if 0%{?rhel}
#Keeping fluentd on el7 until we remove ansible code requiring it in ovirt-engine-metrics
Requires: fluentd
Requires: rubygem-fluent-plugin-rewrite-tag-filter
Requires: rubygem-fluent-plugin-secure-forward
Requires: rubygem-fluent-plugin-collectd-nest
Requires: rubygem-fluent-plugin-viaq_data_model
Requires: rubygem-fluent-plugin-elasticsearch
%endif
%if 0%{?fedora}
# On Fedora we need newer JDBC drivers to be able to connect to PostgreSQL 10.
# Unfortunately this package is not available on EL7, so we are going to
# bundle it within engine until available.
Requires: postgresql-jdbc >= 42.2.2
%endif
%if 0%{?rhel}
Requires: yum-plugin-versionlock
%endif
%if %{ovirt_rh_postgresql95}
Requires: rh-postgresql95-postgresql-server
Requires: rh-postgresql95-postgresql-contrib
%else
Requires: postgresql-server >= 9.5
Requires: postgresql-contrib >= 9.5
%endif
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}
%if 0%{?fedora}
Requires: (yum-plugin-versionlock if yum)
Requires: apache-sshd
Requires: python2-dnf-plugins-extras-versionlock
Requires: python3-dnf-plugins-extras-versionlock
Requires: quartz
# On Fedora slf4j package is split and we need also jdk14 and jcl-over-slf4j
# parts
Requires: slf4j-jdk14 >= 1.7.0
Requires: jcl-over-slf4j >= 1.7.0
Requires: snmp4j >= 2.4.1
%endif
# 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
# Userportal is retired
Obsoletes: %{name}-userportal
# OVS/OVN stuff
Requires: pyOpenSSL
Requires: openvswitch
Requires: openvswitch-ovn-common
Requires: openvswitch-ovn-central
Requires: python-openvswitch
Requires: ovirt-provider-ovn >= 1.2.1
%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.
%package extensions-api-impl
Summary: %{ovirt_product_name_short} extensions api
Group: %{ovirt_product_group}
Provides: ovirt-engine-extensions-api = 0
%description extensions-api-impl
%{ovirt_product_name_short} extensions api
%package extensions-api-impl-javadoc
Summary: %{ovirt_product_name_short} extensions api documentation
Group: %{ovirt_product_group}
Provides: ovirt-engine-extensions-api-javadoc = 0
%description extensions-api-impl-javadoc
%{ovirt_product_name_short} extensions api documentation
%package lib
Summary: %{ovirt_product_name_short} library
Group: %{ovirt_product_group}
Requires: m2crypto
Requires: python-dateutil
Requires: python-daemon
Conflicts: python-daemon = 2.1.0
%description lib
%{ovirt_product_name_short} library
%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-impl >= %{version}-%{release}
Requires: %{name}-lib >= %{version}-%{release}
Requires: aopalliance >= 1.0
Requires: curl
Requires: ebay-cors-filter
Requires: httpd
Requires: java-headless
Requires: logrotate
Requires: mailcap
Requires: mod_ssl
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires: novnc
%else
Requires: novnc >= 0.5.0, novnc < 0.6.0
%endif
Requires: openssh
Requires: vdsm-jsonrpc-java >= 1.4.13
Requires: openssl
Requires: ovirt-engine-extension-aaa-jdbc
Requires: ovirt-host-deploy-java >= 1.7.3
Requires: python-jinja2
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: %{name}-lib >= %{version}-%{release}
Requires: ovirt-setup-lib >= 1.1.1
Requires: bind-utils
Requires: iproute
Requires: libxml2-python
Requires: logrotate
Requires: otopi >= 1.7.8
Requires: python-paramiko
Requires(pre): shadow-utils
Conflicts: %{name}-dwh < 3.6.0
Conflicts: %{name}-reports < 3.6.0
Conflicts: %{name}-dwh-setup < 4.0.0
Conflicts: %{name}-reports-setup < 4.0.0
%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}
%description setup
Setup and upgrade scripts for %{ovirt_product_name_short}
%package setup-plugin-ovirt-engine
Summary: Setup and upgrade specific plugins for %{ovirt_product_name_short}
Group: %{ovirt_product_group}
Requires: %{name} >= 3.6.0
Requires: %{name}-setup-plugin-ovirt-engine-common = %{version}-%{release}
Requires: %{name}-setup-plugin-vmconsole-proxy-helper = %{version}-%{release}
Requires: %{name}-dwh-setup >= 4.2
Requires: ovirt-engine-extension-aaa-jdbc
Requires: ovirt-imageio-proxy-setup
Requires: openssh
%if %{ovirt_rh_postgresql95}
Requires: rh-postgresql95-postgresql-server
Requires: rh-postgresql95-postgresql-contrib
%else
Requires: postgresql-server >= 9.5
Requires: postgresql-contrib >= 9.5
%endif
Conflicts: %{name} < 4.1.7
# OVS/OVN stuff, for firewalld service files
Requires: openvswitch-ovn-central >= 0:2.7
Conflicts: openvswitch-ovn-central = 1:2.6.1
Requires: ovirt-provider-ovn >= 1.2.1
%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: cracklib-python
Requires: libselinux-python
Requires: m2crypto
Requires: nfs-utils
Requires: %{policycoreutils_python_utils}
Requires: python-psycopg2
Requires(pre): shadow-utils
Requires: java-openjdk-headless >= 1:1.8.0
%if 0%{?fedora}
Requires: python2-dnf
%if 0%{?with_python3}
Requires: python3-dnf
%endif
%else
Requires: yum
%endif
# 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}
License: ASL 2.0 and GPLv2+ with exceptions
%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: %{name}-lib >= %{version}-%{release}
Requires: %{name}-tools-backup = %{version}-%{release}
Requires: ovirt-engine-metrics >= 1.1.2
Requires: java-headless
Requires: logrotate
Requires: python-dateutil
Requires: python-psycopg2
Requires: python-six
Requires: gdeploy
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: otopi >= 1.7.8
%if %{ovirt_rh_postgresql95}
Requires: rh-postgresql95-postgresql
%else
Requires: postgresql >= 9.5
%endif
%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: %{name}-lib >= %{version}-%{release}
Requires: numpy
Requires: python-dateutil
Requires: python-websockify >= 0.6.0
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: python-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: %{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
Requires: otopi-devtools >= 1.7.8
%description health-check-bundler
A utility for creating a bundle script that runs a health check.
%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-1.8.0}"
make %{make_common_opts}
%install
rm -fr "%{buildroot}"
make %{make_common_opts} install DESTDIR="%{buildroot}"
# Remove files that relies on unavailable dependencies on python3
# FIXME: port these files to python3! they rely on python2-only modules right now.
%if 0%{?with_python3}
rm -f "%{buildroot}%{python3_sitelib}"/ovirt_engine/{service,ticket}.py
%endif
# Compile python files
%{__python2} -m compileall -f -q -d "%{python2_sitelib}" "%{buildroot}%{python2_sitelib}"
%{__python2} -O -m compileall -f -q -d "%{python2_sitelib}" "%{buildroot}%{python2_sitelib}"
%if 0%{?with_python3}
%{__python3} -m compileall -f -q -d "%{python3_sitelib}" "%{buildroot}%{python3_sitelib}"
%{__python3} -O -m compileall -f -q -d "%{python3_sitelib}" "%{buildroot}%{python3_sitelib}"
%endif
#
# /var creation
#
install -dm 700 "%{buildroot}/%{engine_state}/.ssh"
install -dm 755 "%{buildroot}/%{engine_state}"/{content,setup/answers}
# 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}
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/ovirt-engine-extensions-api/main/ovirt-engine-extensions-api.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/extensions/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
#
# Register poms
#
while read package pom; do
pomdir="$(dirname "%{_mavenpomdir}/${pom}")"
pom="$(basename "${pom}")"
jpppom="JPP.${pom}"
mv "%{buildroot}${pomdir}/${pom}" "%{buildroot}${pomdir}/${jpppom}"
artifact_id="$(echo "${pom}" | sed -e 's/^%{name}-//' -e 's/\.pom//')"
if [ -f "%{buildroot}%{engine_java}/${artifact_id}.jar" ]; then
%add_maven_depmap -f "${package}" "${jpppom}" "%{name}/${artifact_id}.jar"
else
%add_maven_depmap -f "${package}" "${jpppom}"
fi
done << __EOF__
backend %{name}-aaa.pom
backend %{name}-backend.pom
backend %{name}-bll.pom
backend %{name}-builtin.pom
backend %{name}-dal.pom
backend %{name}-manager-modules.pom
backend %{name}-manager.pom
backend %{name}-scheduler.pom
backend %{name}-searchbackend.pom
backend %{name}-vdsbroker.pom
base %{name}-branding.pom
base %{name}-common.pom
base %{name}-compat.pom
base %{name}-extensions-manager.pom
base %{name}-logutils.pom
base %{name}-root.pom
base %{name}-utils.pom
base %{name}-uutils.pom
extensions-api %{name}-ovirt-engine-extensions-api-root.pom
extensions-api %{name}-ovirt-engine-extensions-api.pom
restapi %{name}-interface-common-jaxrs.pom
restapi %{name}-restapi-definition.pom
restapi %{name}-restapi-jaxrs.pom
restapi %{name}-restapi-parent.pom
restapi %{name}-restapi-types.pom
tools %{name}-extensions-tool.pom
tools %{name}-sso-client-registration-tool.pom
tools %{name}-tools.pom
__EOF__
%if "%{name}" != "%{engine_name}"
sed -i 's#%{_javadir}/%{name}#%{engine_java}#' .mfiles*
%endif
%if !%{ovirt_install_poms}
rm -fr "%{buildroot}%{_mavenpomdir}"
%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/com/netflix/config/main/archaius-core.jar archaius/archaius-core.jar
common/com/netflix/hystrix/main/hystrix-core.jar hystrix/hystrix-core.jar
common/com/netflix/hystrix/contrib/main/hystrix-metrics-event-stream.jar hystrix/hystrix-metrics-event-stream.jar
common/io/reactivex/rxjava/main/rxjava.jar
common/org/aopalliance/main/aopalliance.jar
common/org/apache/commons/compress/main/commons-compress.jar
common/org/apache/commons/configuration/main/commons-configuration.jar
common/org/apache/commons/httpclient/main/commons-httpclient.jar
common/org/apache/commons/jxpath/main/commons-jxpath.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/otopi/main/otopi.jar otopi/otopi.jar
common/org/ovirt/ovirt-host-deploy/main/ovirt-host-deploy.jar ovirt-host-deploy/ovirt-host-deploy.jar
common/org/ovirt/vdsm-jsonrpc-java/main/vdsm-jsonrpc-java-client.jar vdsm-jsonrpc-java/vdsm-jsonrpc-java-client.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
%if 0%{?fedora}
# On Fedora we need newer JDBC drivers to be able to connect to PostgreSQL 10.
# Unfortunately this package is not available on EL7, so we are going to
# bundle it within engine until available.
common/org/postgresql/main/postgresql.jar postgresql-jdbc.jar
%endif
%if 0%{?fedora}
common/org/apache/sshd/main/sshd-core.jar apache-sshd/sshd-core.jar
common/org/quartz/main/quartz.jar
common/org/snmp4j/main/snmp4j.jar snmp4j.jar
%endif
__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
__EOF__
%if %{ovirt_rh_postgresql95}
install -d "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.env.d"
cat > "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.env.d/10-setup-scl-postgres-95.env" << __EOF__
RHPOSTGRESQL95BASE="/opt/rh/rh-postgresql95/root"
RHPOSTGRESQL95DATA="/var/opt/rh/rh-postgresql95/lib/pgsql/data"
if [ -e \${RHPOSTGRESQL95BASE}/usr/bin/postgresql-setup ]
then
export sclenv="rh-postgresql95"
export POSTGRESQLENV="COMMAND/pg_dump=str:\${RHPOSTGRESQL95BASE}/usr/bin/pg_dump \
COMMAND/psql=str:\${RHPOSTGRESQL95BASE}/usr/bin/psql \
COMMAND/pg_restore=str:\${RHPOSTGRESQL95BASE}/usr/bin/pg_restore \
COMMAND/postgresql-setup=str:\${RHPOSTGRESQL95BASE}/usr/bin/postgresql-setup \
OVESETUP_PROVISIONING/postgresService=str:rh-postgresql95-postgresql \
OVESETUP_PROVISIONING/postgresConf=str:\${RHPOSTGRESQL95DATA}/postgresql.conf \
OVESETUP_PROVISIONING/postgresPgHba=str:\${RHPOSTGRESQL95DATA}/pg_hba.conf \
OVESETUP_PROVISIONING/postgresPgVersion=str:\${RHPOSTGRESQL95DATA}/PG_VERSION"
fi
__EOF__
cat > "%{buildroot}%{engine_etc}/engine.conf.d/10-scl-postgres-95.conf" << __EOF__
sclenv="rh-postgresql95"
__EOF__
%endif
%if %{ovirt_provides_jboss}
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
%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 -f .mfiles-base
%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}/engine.ear
%dir %{engine_data}/extensions.d
%dir %{engine_data}/services
%dir %{engine_data}/playbooks
%dir %{engine_etc}
%dir %{engine_etc}/ansible
%dir %{engine_etc}/branding
%dir %{engine_etc}/extensions.d
%dir %{engine_java}
%license LICENSE
%{engine_data}/brands/ovirt.brand/
%{engine_etc}/branding/00-ovirt.brand
%{engine_etc}/engine.conf.d/
#
# ATTENTION:
# Needed for compatibility if package is different
# than the directory structure
#
%if "%{name}" != "%{engine_name}"
%{_javadir}/%{name}
%endif
%files extensions-api-impl -f .mfiles-extensions-api
%license LICENSE
%files extensions-api-impl-javadoc
%{engine_doc}/ovirt-engine-extensions-api/
%license LICENSE
%files lib
%license LICENSE
%{engine_data}/bin/java-home
%{python2_sitelib}/ovirt_engine/
%if 0%{?with_python3}
%{python3_sitelib}/ovirt_engine/
%endif
%files backend -f .mfiles-backend
%license LICENSE
%license backend/manager/modules/services/src/main/webapp/gpl-3.0.txt
%license backend/manager/modules/services/src/main/webapp/lgpl-3.0.txt
%attr(-, %{engine_user}, %{engine_group}) %{engine_log}/brick-setup
%attr(-, %{engine_user}, %{engine_group}) %{engine_log}/host-deploy
%attr(-, %{engine_user}, %{engine_group}) %{engine_log}/ansible
%attr(-, %{engine_user}, %{engine_group}) %{engine_log}/db-manual
%attr(-, %{engine_user}, %{engine_group}) %{engine_log}/ova
%attr(-, %{engine_user}, %{engine_group}) %{engine_state}/content
%attr(700, %{engine_user}, %{engine_group}) %{engine_state}/.ssh/
%attr(600, %{engine_user}, %{engine_group}) %{engine_state}/.ssh/config
%config %{_sysconfdir}/logrotate.d/ovirt-engine
%dir %attr(-, %{engine_user}, %{engine_group}) %{engine_state}
%dir %{engine_data}/bin
%dir %{engine_data}/gwt-symbols