-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
mysql.spec.in
2874 lines (2393 loc) · 114 KB
/
mysql.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
# Copyright (c) 2000, 2023, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
# change these, has to be exactly as is.
%global mysql_vendor Oracle and/or its affiliates
%global mysqldatadir /var/lib/mysql
# Pass --define 'with_cluster 1' to build with cluster support
%{?with_cluster: %global cluster 1}
%if 0%{?cluster}
%global with_meb 0
%global with_router 0
%else
%if 0%{?commercial}
%global with_meb 1
%else
%global with_meb 0
%endif
%global with_router 1
%endif
# Pass path to mecab lib
%{?with_mecab: %global mecab_option -DWITH_MECAB=%{with_mecab}}
%{?with_mecab: %global mecab 1}
# Pass path to the AWS SDK install
%{?with_aws_sdk: %global aws_sdk_option -DWITH_KEYRING_AWS=1 -DWITH_AWS_SDK=%{with_aws_sdk}}
%{?with_aws_sdk: %global aws_sdk 1}
%global ssl_default 1
# Pass alternative ssl setting if provided. Can be used for newer OpenSSL.
%{?with_ssl: %global ssl_option -DWITH_SSL=%{with_ssl}}
%{?with_ssl: %global ssl_bundled 1}
# Use OpenSSL 1.1
%{?with_openssl11: %global ssl_option -DWITH_SSL=openssl11}
%{?with_openssl11: %global ssl_default 0}
# Tell build not to use minimal debug
%{?full_debug: %global no_mini_debug 1}
# Regression tests may take a long time, override the default to skip them
%{!?runselftest:%global runselftest 0}
%{!?with_systemd: %global systemd 0}
%{?el7: %global systemd 1}
%{?el8: %global systemd 1}
%{?el9: %global systemd 1}
# Two workarounds on el6 and el7
%if 0%{?rhel} == 6 || 0%{?rhel} == 7
# - Avoid compiling Python 3 code with Python 2
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# - Ship debuginfo for community
%if 0%{?commercial}
%if 0%{?no_mini_debug}
%else
%global mini_debug_option -DMINIMAL_RELWITHDEBINFO=1
%endif # no_mini_debug
%else
%global with_debuginfo 1
%endif # commercial
%endif # rhel6|7
%{?el8: %global with_debuginfo 1}
%{?el9: %global with_debuginfo 1}
%{!?with_debuginfo: %global without_debuginfo 1}
%{!?product_suffix: %global product_suffix community}
%{!?feature_set: %global feature_set community}
%{!?compilation_comment_release: %global compilation_comment_release MySQL Community - GPL}
%{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community - GPL - Debug}
%{!?compilation_comment_server_release: %global compilation_comment_server_release MySQL Community Server - GPL}
%{!?compilation_comment_server_debug: %global compilation_comment_server_debug MySQL Community Server - GPL - Debug}
%{!?src_base: %global src_base mysql%{?cluster:-cluster-gpl}}
%if 0%{?rhel} == 6
%global compatver 5.1.73
%global compatlib 16
%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.1/mysql-%{compatver}.tar.gz
%endif
%if 0%{?rhel} == 7
%global compatver 5.6.51
%global compatlib 18
%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.6/mysql-%{compatver}.tar.gz
%endif
%global cmake3 cmake%{?el6:3}%{?el7:3}
# multiarch
%global multiarchs ppc %{power64} %{ix86} x86_64 %{sparc}
%global src_dir %{src_base}-@VERSION_SRC@
%if 0%{?without_debuginfo}
%global _enable_debug_package 0
%global debug_package %{nil}
%global __os_install_post /usr/lib/rpm/brp-compress %{nil}
%endif
%global license_files_server %{src_dir}/LICENSE %{src_dir}/README
%if 0%{?commercial}
%global license_type Commercial
%else
%global license_type GPLv2
%endif
%global min 8.0.11
Name: mysql%{?cluster:-cluster}-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Version: @MYSQL_NO_DASH_VERSION@
Release: 1@MYSQL_VERSION_EXTRA_DOT@%{?commercial:.1}%{?dist}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. Under %{?license_type} license as shown in the Description field.
Source0: https://cdn.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
URL: http://www.mysql.com/
Packager: MySQL Release Engineering <mysql-build@oss.oracle.com>
Vendor: %{mysql_vendor}
%if 0%{?compatlib}
Source7: %{compatsrc}
%endif
Source10: @BOOST_DOWNLOAD_URL@
Source90: filter-provides.sh
Source91: filter-requires.sh
%if 0%{?rhel} >= 8
BuildRequires: cmake >= 3.6.1
BuildRequires: libtirpc-devel
BuildRequires: rpcgen
%else
BuildRequires: cmake3 >= 3.6.1
%endif
%{?el6:BuildRequires: devtoolset-8-gcc}
%{?el6:BuildRequires: devtoolset-8-gcc-c++}
%{?el6:BuildRequires: devtoolset-8-binutils}
%ifarch aarch64
%{?el7:BuildRequires: devtoolset-10-gcc}
%{?el7:BuildRequires: devtoolset-10-gcc-c++}
%{?el7:BuildRequires: devtoolset-10-binutils}
%else
%{?el7:BuildRequires: devtoolset-11-gcc}
%{?el7:BuildRequires: devtoolset-11-gcc-c++}
%{?el7:BuildRequires: devtoolset-11-binutils}
%endif
%{?el8:BuildRequires: gcc-toolset-12-annobin-annocheck}
%{?el8:BuildRequires: gcc-toolset-12-annobin-plugin-gcc}
%{?el8:BuildRequires: gcc-toolset-12-binutils}
%{?el8:BuildRequires: gcc-toolset-12-gcc-c++}
%{?el8:BuildRequires: gcc-toolset-12-gcc}
%{?el9:BuildRequires: gcc-toolset-12-annobin-annocheck}
%{?el9:BuildRequires: gcc-toolset-12-annobin-plugin-gcc}
%{?el9:BuildRequires: gcc-toolset-12-binutils}
%{?el9:BuildRequires: gcc-toolset-12-gcc-c++}
%{?el9:BuildRequires: gcc-toolset-12-gcc}
BuildRequires: bison >= 2.1
BuildRequires: elfutils
BuildRequires: perl
%{?el7:BuildRequires: perl(Env)}
%{?el8:BuildRequires: perl(Env)}
%{?el9:BuildRequires: perl(Env)}
BuildRequires: perl(Carp)
BuildRequires: perl(Config)
BuildRequires: perl(Cwd)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(English)
BuildRequires: perl(Errno)
BuildRequires: perl(Exporter)
BuildRequires: perl(Fcntl)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Find)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Spec::Functions)
BuildRequires: perl(File::Temp)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(IO::File)
BuildRequires: perl(IO::Handle)
BuildRequires: perl(IO::Pipe)
BuildRequires: perl(IO::Select)
BuildRequires: perl(IO::Socket)
BuildRequires: perl(IO::Socket::INET)
BuildRequires: perl(JSON)
BuildRequires: perl(Memoize)
BuildRequires: perl(POSIX)
BuildRequires: perl(Sys::Hostname)
BuildRequires: perl(Time::HiRes)
BuildRequires: perl(Time::localtime)
BuildRequires: time
BuildRequires: libaio-devel
%if 0%{?commercial}
BuildRequires: cyrus-sasl-gssapi
%{?el7:BuildRequires: cyrus-sasl-scram}
%{?el8:BuildRequires: cyrus-sasl-scram}
%{?el9:BuildRequires: cyrus-sasl-scram}
BuildRequires: krb5-devel
BuildRequires: libcurl-devel
%endif
BuildRequires: ncurses-devel
BuildRequires: numactl-devel
BuildRequires: openssl-devel
BuildRequires: zlib-devel
%if 0%{?with_openssl11}
BuildRequires: openssl11-devel
%endif
%if 0%{?systemd}
BuildRequires: systemd
BuildRequires: pkgconfig(systemd)
%endif
BuildRequires: cyrus-sasl-devel
BuildRequires: openldap-devel
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%if 0%{?rhel} > 6
# For rpm => 4.9 only: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
%global _privatelibs libprotobuf.*|libmysqlharness\.so.*|libmysqlharness_stdx\.so.*|libmysqlharness_tls\.so.*|libmysqlrouter\.so\..*|libmysqlrouter_.*\.so\..*%{?ssl_bundled:|libssl\.so\..*|libcrypto\.so\..*}|libfido2.*
%global _privateperl perl\\((GD|hostnames|lib::mtr|lib::v1|mtr_|My::)
%global __requires_exclude ^((%{_privatelibs})|(%{_privateperl}))
%global __provides_exclude_from ^(/usr/share/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so|%{_libdir}/mysql/private/.*|%{_libdir}/mysqlrouter/.*|%{_libdir}/mysqlrouter/private/.*)$
%else
# https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6
%global __perl_provides %{SOURCE90}
%global __perl_requires %{SOURCE91}
%endif
%description
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
%{mysql_vendor}
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
documentation and the manual for more information.
%package server
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Requires: coreutils
Requires: grep
Requires: procps
Requires: shadow-utils
Requires: net-tools
Requires: %{name}-client%{?_isa} >= %{min}
Requires: %{name}-common%{?_isa} = %{version}-%{release}
Requires: %{name}-icu-data-files = %{version}-%{release}
%if 0%{?commercial}
Obsoletes: mysql-commercial-bench < 5.7.8
Obsoletes: mysql-commercial-embedded < 8.0.1
Obsoletes: mysql-commercial-embedded-devel < 8.0.1
Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
Obsoletes: mysql-community-server < %{version}-%{release}
%if 0%{?without_debuginfo}
Obsoletes: mysql-community-server-debug < %{version}-%{release}
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-server-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-server-advanced < %{version}-%{release}
Obsoletes: MySQL-Cluster-embedded-advanced < %{version}-%{release}
Obsoletes: mysql-commercial-server < %{version}-%{release}
Obsoletes: mysql-cluster-community-server < %{version}-%{release}
%if 0%{?without_debuginfo}
Obsoletes: mysql-cluster-community-server-debug < %{version}-%{release}
%endif
Obsoletes: mysql-cluster-commercial-embedded < 8.0.1
Obsoletes: mysql-cluster-commercial-embedded-devel < 8.0.1
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-server-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-server-gpl < %{version}-%{release}
Obsoletes: mysql-cluster-community-embedded < 8.0.1
Obsoletes: mysql-cluster-community-embedded-devel < 8.0.1
Obsoletes: MySQL-Cluster-embedded-gpl < %{version}-%{release}
%endif
Provides: MySQL-server%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-server < %{version}-%{release}
Obsoletes: mysql-community-bench < 5.7.8
Obsoletes: mysql-community-embedded < 8.0.1
Obsoletes: mysql-community-embedded-devel < 8.0.1
Obsoletes: mysql-embedded-devel < 8.0.1
Obsoletes: community-mysql-bench
Obsoletes: mysql-bench
Obsoletes: mysql-server < %{version}-%{release}
Obsoletes: mariadb-connector-c-config
Obsoletes: mariadb-backup
Obsoletes: mariadb-bench
Obsoletes: mariadb-server
Obsoletes: mariadb-server-galera
Obsoletes: mariadb-server-utils
Obsoletes: mariadb-galera-server
Obsoletes: mariadb-gssapi-server
Obsoletes: mariadb-oqgraph-engine
Provides: mysql-server = %{version}-%{release}
Provides: mysql-server%{?_isa} = %{version}-%{release}
Provides: mysql-compat-server = %{version}-%{release}
Provides: mysql-compat-server%{?_isa} = %{version}-%{release}
%if 0%{?systemd}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
%endif
%description server
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
%{mysql_vendor}
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
the GPL. See the chapter "Licensing and Support" in the manual for
further info.
The MySQL web site (http://www.mysql.com/) provides the latest news and
information about the MySQL software. Also please see the documentation
and the manual for more information.
This package includes the MySQL server binary as well as related utilities
to run and administer a MySQL server.
%if 0%{?with_debuginfo}
%package server-debug
Summary: The debug version of MySQL server
Requires: %{name}-server = %{version}-%{release}
%if 0%{?commercial}
Obsoletes: mysql-community-server-debug < %{version}-%{release}
%if 0%{?cluster}
Obsoletes: mysql-commercial-server-debug < %{version}-%{release}
Obsoletes: mysql-cluster-community-server-debug < %{version}-%{release}
%endif # cluster
%else
%if 0%{?cluster}
Obsoletes: mysql-community-server-debug < %{version}-%{release}
%endif # cluster
%endif # commercial
%description server-debug
This packages contains the special debug build of MySQL server.
%endif # with_debuginfo
%package client
Summary: MySQL database client applications and tools
Group: Applications/Databases
Requires: %{name}-libs%{?_isa} >= %{min}
Requires: %{name}-client-plugins = %{version}-%{release}
%if 0%{?commercial}
Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: mysql-community-client < %{version}-%{release}
%if 0%{?cluster}
Provides: MySQL-Cluster-client-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-client-advanced < %{version}-%{release}
Obsoletes: mysql-commercial-client < %{version}-%{release}
Obsoletes: mysql-cluster-community-client < %{version}-%{release}
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-client-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-client-gpl < %{version}-%{release}
%endif
Provides: MySQL-client%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-client < %{version}-%{release}
Obsoletes: mariadb
Obsoletes: mysql < %{version}-%{release}
Provides: mysql = %{version}-%{release}
Provides: mysql%{?_isa} = %{version}-%{release}
%description client
This package contains the standard MySQL clients and administration
tools.
%package icu-data-files
Summary: MySQL packaging of ICU data files
%description icu-data-files
This package contains ICU data files needer by MySQL regular expressions.
%package common
Summary: MySQL database common files for server and client libs
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-common < %{version}-%{release}
%if 0%{?cluster}
Obsoletes: mysql-commercial-common < %{version}-%{release}
Obsoletes: mysql-cluster-community-common < %{version}-%{release}
%endif
%endif
Provides: mysql-common = %{version}-%{release}
Provides: mysql-common%{?_isa} = %{version}-%{release}
%description common
This packages contains common files needed by MySQL client library and
MySQL database server.
%package test
Summary: Test suite for the MySQL database server
Group: Applications/Databases
Requires: %{name}-server%{?_isa} >= %{min}
Requires: perl(Carp)
Requires: perl(Config)
Requires: perl(Cwd)
Requires: perl(Data::Dumper)
Requires: perl(English)
Requires: perl(Errno)
Requires: perl(Exporter)
Requires: perl(Fcntl)
Requires: perl(File::Basename)
Requires: perl(File::Copy)
Requires: perl(File::Find)
Requires: perl(File::Path)
Requires: perl(File::Spec)
Requires: perl(File::Spec::Functions)
Requires: perl(File::Temp)
Requires: perl(Getopt::Long)
Requires: perl(IO::File)
Requires: perl(IO::Handle)
Requires: perl(IO::Pipe)
Requires: perl(IO::Select)
Requires: perl(IO::Socket)
Requires: perl(IO::Socket::INET)
Requires: perl(JSON)
Requires: perl(Memoize)
Requires: perl(POSIX)
Requires: perl(Sys::Hostname)
Requires: perl(Time::HiRes)
Requires: perl(Time::localtime)
%if 0%{?cluster}
Requires: %{name}-data-node%{?_isa} >= %{min}
Requires: %{name}-management-server%{?_isa} >= %{min}
%endif
%if 0%{?commercial}
Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: mysql-community-test < %{version}-%{release}
%if 0%{?cluster}
Provides: MySQL-Cluster-test-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-test-advanced < %{version}-%{release}
Obsoletes: mysql-commercial-test < %{version}-%{release}
Obsoletes: mysql-cluster-community-test < %{version}-%{release}
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-test-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-test-gpl < %{version}-%{release}
%endif
Provides: MySQL-test%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: mysql-test < %{version}-%{release}
Obsoletes: mariadb-test
Provides: mysql-test = %{version}-%{release}
Provides: mysql-test%{?_isa} = %{version}-%{release}
%description test
This package contains the MySQL regression test suite for MySQL
database server.
%package devel
Summary: Development header files and libraries for MySQL database client applications
Group: Applications/Databases
Requires: %{name}-libs%{?_isa} >= %{min}
%if 0%{?commercial}
Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: mysql-community-devel < %{version}-%{release}
%if 0%{?cluster}
Provides: MySQL-Cluster-devel-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-devel-advanced < %{version}-%{release}
Obsoletes: mysql-commercial-devel < %{version}-%{release}
Obsoletes: mysql-cluster-community-devel < %{version}-%{release}
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-devel-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-devel-gpl < %{version}-%{release}
%endif
Provides: MySQL-devel = %{version}-%{release}
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: mysql-devel < %{version}-%{release}
%{?el8:Obsoletes: mariadb-embedded-devel}
%{?el9:Obsoletes: mariadb-embedded-devel}
Obsoletes: mariadb-devel
Obsoletes: mariadb-connector-c-devel
Obsoletes: mysql-connector-c-devel < 6.2
Provides: mysql-devel = %{version}-%{release}
Provides: mysql-devel%{?_isa} = %{version}-%{release}
%description devel
This package contains the development header files and libraries necessary
to develop MySQL client applications.
%package libs
Summary: Shared libraries for MySQL database client applications
Group: Applications/Databases
Requires: %{name}-common%{?_isa} >= %{min}
Requires: %{name}-client-plugins = %{version}-%{release}
%if 0%{?commercial}
Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs < %{version}-%{release}
%if 0%{?cluster}
Provides: MySQL-Cluster-shared-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-shared-advanced < %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-cluster-community-libs < %{version}-%{release}
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-shared-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-shared-gpl < %{version}-%{release}
%endif
Provides: MySQL-shared%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Obsoletes: mariadb-libs
Obsoletes: mysql-connector-c-shared < 6.2
Provides: mysql-libs = %{version}-%{release}
Provides: mysql-libs%{?_isa} = %{version}-%{release}
%description libs
This package contains the shared libraries for MySQL client
applications.
%package client-plugins
Summary: Shared plugins for MySQL client applications
Group: Applications/Databases
Provides: mysql-client-plugins = %{version}-%{release}
%if 0%{?commercial}
Conflicts: mysql-commercial-server < 8.0.21
Conflicts: mysql-commercial-client < 8.0.22
Obsoletes: mysql-community-client-plugins < %{version}-%{release}
%if 0%{?cluster}
Obsoletes: mysql-commercial-client-plugins < %{version}-%{release}
Conflicts: mysql-cluster-commercial-server < 8.0.21
Conflicts: mysql-cluster-commercial-client < 8.0.22
Obsoletes: mysql-community-client-plugins < %{version}-%{release}
Obsoletes: mysql-commercial-client-plugins < %{version}-%{release}
%endif
%else
Conflicts: mysql-community-server < 8.0.21
Conflicts: mysql-community-client < 8.0.22
%if 0%{?cluster}
Conflicts: mysql-cluster-community-server < 8.0.21
Conflicts: mysql-cluster-community-client < 8.0.22
Obsoletes: mysql-community-client-plugins < %{version}-%{release}
%endif
%endif
%description client-plugins
This package contains the client-plugins libraries used by MySQL client applications.
%if 0%{?compatlib}
%package libs-compat
Summary: Shared compat libraries for MySQL %{compatver} database client applications
Group: Applications/Databases
Obsoletes: mysql-libs-compat < %{version}-%{release}
Provides: mysql-libs-compat = %{version}-%{release}
Provides: mysql-libs-compat%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} >= %{min}
%if 0%{?commercial}
Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs-compat < %{version}-%{release}
%if 0%{?cluster}
Provides: MySQL-Cluster-shared-compat-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-shared-compat-advanced < %{version}-%{release}
Obsoletes: mysql-commercial-libs-compat < %{version}-%{release}
Obsoletes: mysql-cluster-community-libs-compat < %{version}-%{release}
%endif
%endif
%if 0%{?cluster}
Provides: MySQL-Cluster-shared-compat-gpl%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-Cluster-shared-compat-gpl < %{version}-%{release}
%endif
Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-compat < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Obsoletes: mariadb-libs
%description libs-compat
This package contains the shared compat libraries for MySQL %{compatver} client
applications.
%endif
%if 0%{?rhel} == 7
%package embedded-compat
Summary: MySQL embedded compat library
Group: Applications/Databases
Requires: %{name}-common%{?_isa} >= %{min}
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-compat < %{version}-%{release}
%if 0%{?cluster}
Obsoletes: mysql-commercial-embedded-compat < %{version}-%{release}
Obsoletes: mysql-cluster-community-embedded-compat < %{version}-%{release}
%endif
%endif
Obsoletes: MySQL-embedded < %{version}-%{release}
Obsoletes: mysql-embedded < %{version}-%{release}
Obsoletes: mysql-embedded-devel < %{version}-%{release}
Obsoletes: mariadb-embedded
Obsoletes: mariadb-embedded-devel
%description embedded-compat
This package contains the MySQL server as an embedded library with
compatibility for applications using version %{compatlib} of the library.
%endif
%if 0%{?with_router}
%package -n mysql-router-%{product_suffix}
Summary: MySQL Router
Group: Applications/Databases
Provides: mysql-router = %{version}-%{release}
Obsoletes: mysql-router < %{version}-%{release}
%{?el7:Requires: openssl-libs >= 1.0.2j}
%if 0%{?commercial}
Obsoletes: mysql-router-community < %{version}-%{release}
%endif
%description -n mysql-router-%{product_suffix}
The MySQL(TM) Router software delivers a fast, multi-threaded way of
routing connections from MySQL Clients to MySQL Servers. MySQL is a
trademark of Oracle.
The MySQL software has Dual Licensing, which means you can use the
MySQL software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from Oracle and/or its affiliates if you do not wish to be
bound by the terms of the GPL. See the chapter "Licensing and Support"
in the manual for further info.
The MySQL web site (http://www.mysql.com/) provides the latest news
and information about the MySQL software. Also please see the
documentation and the manual for more information.
%package -n mysql-router-%{product_suffix}-devel
Summary: Development header files and libraries for MySQL Router
Group: Applications/Databases
Provides: mysql-router-devel = %{version}-%{release}
Obsoletes: mysql-router-devel < %{version}-%{release}
%if 0%{?commercial}
Obsoletes: mysql-router-community-devel < %{version}-%{release}
Requires: mysql-router-commercial = %{version}-%{release}
%else
Requires: mysql-router-community = %{version}-%{release}
%endif
%description -n mysql-router-%{product_suffix}-devel
This package contains the development header files and libraries
necessary to develop MySQL Router applications.
%endif # with_router
%if 0%{?cluster}
%package management-server
Summary: MySQL Cluster Management Server Daemon
Group: Applications/Databases
%description management-server
This package contains the MySQL Cluster Management Server Daemon,
which reads the cluster configuration file and distributes this
information to all nodes in the cluster.
%package data-node
Summary: MySQL Cluster Data Node Daemon
Group: Applications/Databases
%description data-node
This package contains MySQL Cluster Data Node Daemon, it is the process
that is used to handle all the data in tables using the NDB Cluster
storage engine. It comes in two variants: ndbd and ndbmtd, the former
is single threaded while the latter is multi-threaded.
%package ndbclient
Summary: Shared libraries for MySQL NDB storage engine client applications
Group: Applications/Databases
%description ndbclient
This package contains the shared libraries for MySQL MySQL NDB storage
engine client applications.
%package ndbclient-devel
Summary: Development files for MySQL NDB storage engine client applications
Group: Applications/Databases
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-ndbclient%{?_isa} = %{version}-%{release}
%description ndbclient-devel
This package contains the development header files and libraries
necessary to develop client applications for MySQL NDB storage engine.
%if 0%{?ndb_nodejs_extras_path:1}
%package nodejs
Summary: Set of Node.js adapters for MySQL Cluster
Group: Applications/Databases
%description nodejs
This package contains MySQL NoSQL Connector for JavaScript, a set of
Node.js adapters for MySQL Cluster and MySQL Server, which make it
possible to write JavaScript applications for Node.js using MySQL
data.
%endif
%package java
Summary: MySQL Cluster Connector for Java
Group: Applications/Databases
%description java
This package contains MySQL Cluster Connector for Java, which includes
ClusterJ and ClusterJPA, a plugin for use with OpenJPA.
ClusterJ is a high level database API that is similar in style and
concept to object-relational mapping persistence frameworks such as
Hibernate and JPA.
ClusterJPA is an OpenJPA implementation for MySQL Cluster that
attempts to offer the best possible performance by leveraging the
strengths of both ClusterJ and JDBC.
%endif # cluster
%if 0%{?with_meb}
%package backup
Summary: MySQL Enterprise Backup
Group: Applications/Databases
Provides: meb = %{version}-%{release}
Provides: meb%{?_isa} = %{version}-%{release}
Obsoletes: meb < %{version}-%{release}
%description backup
Implementing proper database backup and disaster recovery plans to
protect against accidental loss of data, database corruption,
hardware/operating system crashes orany natural disasters has become
one of the most important responsibilities of the Database
Administrator (DBAs).
MySQL Enterprise Backup provides DBAs with a high-performance, online
"hot" backup solution with data compression technology to ensure your
data is protected in case of downtime or an outage. MySQL is a
trademark of %{mysql_vendor}
%endif # with_meb
%prep
%if 0%{?compatlib}
%setup -q -T -a 0 -a 7 -a 10 -c -n %{src_dir}
%else
%setup -q -T -a 0 -a 10 -c -n %{src_dir}
%endif # 0%{?compatlib}
%build
# Fail quickly and obviously if user tries to build as root
%if 0%{?runselftest}
if [ "x$(id -u)" = "x0" ] ; then
echo "The MySQL regression tests may fail if run as root."
echo "If you really need to build the RPM as root, use"
echo "--define='runselftest 0' to skip the regression tests."
exit 1
fi
%endif
# Build compat libs
%if 0%{?compatlib}
%if 0%{?rhel} < 7
(
export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv"
export CXXFLAGS="$CFLAGS %{?el6:-felide-constructors} -fno-rtti -fno-exceptions"
pushd mysql-%{compatver}
%configure \
--with-readline \
--without-debug \
--enable-shared \
--localstatedir=/var/lib/mysql \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-mysqld-user="mysql" \
--with-extra-charsets=all \
--enable-local-infile \
--enable-largefile \
--enable-thread-safe-client \
--with-ssl=%{_prefix} \
--with-embedded-server \
--with-big-tables \
--with-pic \
--with-plugin-innobase \
--with-plugin-innodb_plugin \
--with-plugin-partition \
--disable-dependency-tracking
make %{?_smp_mflags}
popd
)
%else # 0%{?rhel} < 7
(
pushd mysql-%{compatver}
mkdir build && pushd build
%{cmake3} .. \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS="%{optflags}" \
-DCMAKE_CXX_FLAGS="%{optflags}" \
-DWITH_INNODB_MEMCACHED=0 \
-DINSTALL_LIBDIR="%{_lib}/mysql" \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
-DINSTALL_SQLBENCHDIR=share \
-DWITH_SYMVER16=1 \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DCOMPILATION_COMMENT_SERVER="%{compilation_comment_server_release}" \
-DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
make %{?_smp_mflags} VERBOSE=1
popd && popd
)
%endif # 0%{?rhel} < 7
%endif # 0%{?compatlib}
# Build debug versions of mysqld
mkdir debug
(
cd debug
# Attempt to remove any optimisation flags from the debug build
optflags=$(echo "%{optflags}" | sed -e 's/-O2 / /' -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' -e 's/%{_lto_cflags}/ /')
%{cmake3} ../%{src_dir} \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=Debug \
-DWITH_BOOST=.. \
-DCMAKE_C_FLAGS="$optflags" \
-DCMAKE_CXX_FLAGS="$optflags" \
-DUSE_LD_LLD=0 \
%if 0%{?ssl_default}
-DWITH_AUTHENTICATION_CLIENT_PLUGINS=1 \
%else
-DWITH_AUTHENTICATION_CLIENT_PLUGINS=0 \
-DWITH_AUTHENTICATION_FIDO=0 \
-DWITH_AUTHENTICATION_KERBEROS=0 \
-DWITH_AUTHENTICATION_LDAP=0 \
-DWITH_AUTHENTICATION_OCI=0 \
-DWITH_COMPONENT_KEYRING_OCI=0 \
-DWITH_CURL=0 \
-DWITH_KEYRING_HASHICORP=0 \
-DWITH_KEYRING_OCI=0 \
%endif # ssl_default
-DWITH_CURL=system \
%if 0%{?systemd}
-DWITH_SYSTEMD=1 \
%endif
-DWITH_ROUTER=%{with_router} \
%if 0%{?cluster}
-DWITH_NDB=1 \
%endif
%if 0%{?ndb_nodejs_path:1}
-DNDB_NODEJS_PATH=%{ndb_nodejs_path} \
%endif
%if 0%{?ndb_nodejs_extras_path:1}
-DNDB_NODEJS_EXTRAS_PATH=%{ndb_nodejs_extras_path} \
%endif
%if 0%{?commercial}
-DWITH_MEB=%{with_meb} \
%{?aws_sdk_option} \
%endif
%{?ssl_option} \
%{?mini_debug_option} \
-DWITH_INNODB_MEMCACHED=1 \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DMYSQLX_UNIX_ADDR="/var/run/mysqld/mysqlx.sock" \
-DWITH_NUMA=1 \
%{?mecab_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-DCOMPILATION_COMMENT_SERVER="%{compilation_comment_server_debug}" \
-DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
make %{?_smp_mflags} VERBOSE=1
)
# Build full release
mkdir release
(
cd release
%{cmake3} ../%{src_dir} \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWITH_BOOST=.. \
-DCMAKE_C_FLAGS="%{optflags}" \
-DCMAKE_CXX_FLAGS="%{optflags}" \
-DUSE_LD_LLD=0 \
%if 0%{?ssl_default}
-DWITH_AUTHENTICATION_CLIENT_PLUGINS=1 \
%else
-DWITH_AUTHENTICATION_CLIENT_PLUGINS=0 \
-DWITH_AUTHENTICATION_FIDO=0 \
-DWITH_AUTHENTICATION_KERBEROS=0 \
-DWITH_AUTHENTICATION_LDAP=0 \
-DWITH_AUTHENTICATION_OCI=0 \
-DWITH_COMPONENT_KEYRING_OCI=0 \
-DWITH_CURL=0 \
-DWITH_KEYRING_HASHICORP=0 \
-DWITH_KEYRING_OCI=0 \
%endif # ssl_default
-DWITH_CURL=system \
%if 0%{?systemd}
-DWITH_SYSTEMD=1 \
%endif
-DWITH_ROUTER=%{with_router} \
%if 0%{?cluster}
-DWITH_NDB=1 \
%endif
%if 0%{?ndb_nodejs_path:1}
-DNDB_NODEJS_PATH=%{ndb_nodejs_path} \
%endif
%if 0%{?ndb_nodejs_extras_path:1}
-DNDB_NODEJS_EXTRAS_PATH=%{ndb_nodejs_extras_path} \
%endif
%if 0%{?commercial}
-DWITH_MEB=%{with_meb} \
%{?aws_sdk_option} \
%endif
%{?ssl_option} \
%{?mini_debug_option} \
-DWITH_INNODB_MEMCACHED=1 \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DMYSQLX_UNIX_ADDR="/var/run/mysqld/mysqlx.sock" \
-DWITH_NUMA=1 \
%{?mecab_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DCOMPILATION_COMMENT_SERVER="%{compilation_comment_server_release}" \
-DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
make %{?_smp_mflags} VERBOSE=1
)
%install
# /usr/bin/strip is too old on el6
%if 0%{?rhel} == 6
export STRIP=/opt/rh/devtoolset-8/root/usr/bin/strip
%endif
%if 0%{?compatlib}
# Install compat libs
dirs="libmysql libmysql_r"
%{?el7:dirs="build/libmysql build/libmysqld build/sql/share"}
for dir in $dirs ; do
pushd mysql-%{compatver}/$dir
make DESTDIR=%{buildroot} install
popd
done
rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so}
%{?el7:rm -f %{buildroot}%{_libdir}/mysql/libmysqld.{a,la,so}}
%endif # 0%{?compatlib}
MBD=$RPM_BUILD_DIR/%{src_dir}
# Ensure that needed directories exists
install -d -m 0751 %{buildroot}/var/lib/mysql
install -d -m 0755 %{buildroot}/var/run/mysqld
install -d -m 0750 %{buildroot}/var/lib/mysql-files
install -d -m 0750 %{buildroot}/var/lib/mysql-keyring
%if 0%{?with_router}
# Router directories
install -d -m 0755 %{buildroot}/var/log/mysqlrouter
install -d -m 0755 %{buildroot}/var/run/mysqlrouter
%endif