Package MySQL: Specfile

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
%def_without debug
%def_with libs
%def_with devel
%def_disable static
%define mysqld_user mysql
%define _libexecdir %_sbindir
%define ROOT %_localstatedir/mysql

Name: MySQL
Version: 5.7.28
Release: alt1

Summary: A very fast and reliable SQL database engine
Summary(ru_RU.UTF-8): Очень быстрый и надежный SQL-сервер
Group: Databases
License: GPL / LGPL
Url: http://www.mysql.com/
Packager: MySQL Development Team <mysql@packages.altlinux.org>

Source: %name-%version.tar
Source99: boost.tar
Source1: mysqld.init
Source2: mysql.logrotate
Source3: safe_mysqld
Source4: mysqld_wrapper
Source5: my.cnf
Source6: mysql.chroot.lib
Source7: mysql.chroot.conf
Source8: mysql.chroot.all
Source9: mysql_migrate
Source10: mysqld.sysconfig
Source14: README.ALT-ru_RU.UTF-8
Source15: alt-mysql_install_db.sh
Source16: mysql.control
Source17: mysqld-chroot.control

Source20: mysql.tmpfiles.d
Source21: mysqld.service
Source22: mysqld.service.d-user

Source25: client.cnf
Source26: server.cnf
Source27: mysql-clients.cnf
Source28: chroot.cnf
Source29: no-chroot.cnf

Patch0: mysql-%version.patch

# ALTLinux
Patch1: mysql-5.7.21-alt-chroot.patch
Patch2: mysql-5.0.20-alt-libdir.patch
Patch4: mysql-5.7.21-alt-client.patch
Patch5: mysql-5.7.21-alt-load_defaults.patch
Patch6: mysql-5.1.50-alt-fPIC-innodb.patch
Patch7: mysql-5.7.21-alt-mysql_config-libs.patch
Patch8: mysql-5.5.43-alt-aarch64-lib64.patch
Patch9: mysql-5.7.21-alt-disable-run-libmysql_api_test.patch

# Patches taken from boost 1.59
Patch115: boost-1.58.0-pool.patch
Patch125: boost-1.57.0-mpl-print.patch
Patch136: boost-1.57.0-spirit-unused_typedef.patch
Patch145: boost-1.54.0-locale-unused_typedef.patch
Patch170: boost-1.59.0-log.patch
Patch180: boost-1.59-python-make_setter.patch
Patch181: boost-1.59-test-fenv.patch

# Automatically added by buildreq on Wed Mar 16 2011 (-bi)
BuildRequires: chrooted gcc-c++ libncursesw-devel libreadline-devel libssl-devel perl-DBI libpam0-devel libevent-devel
BuildRequires: libaio-devel libjemalloc-devel libedit-devel perl-GD perl-threads perl-Memoize perl-devel
BuildRequires: liblz4-devel zlib-devel
BuildRequires: cmake control
BuildRequires: libsystemd-devel

%define soname 20

%package -n libmysqlclient%soname
Summary: Shared libraries for MySQL
Summary(ru_RU.UTF-8): Динамические библиотеки для MySQL
License: LGPL
Group: System/Libraries
Provides: libMySQL = %EVR
Obsoletes: libMySQL < %EVR

%package -n libmysqlclient%soname-devel
Summary: Development header files and libraries for MySQL
Summary(ru_RU.UTF-8): Интерфейс прикладного уровня для разработки программ с MySQL
License: LGPL
Group: Development/C
Requires: libmysqlclient%soname = %EVR
Provides: MySQL-devel = %EVR mysql-devel = %EVR
Obsoletes: MySQL-devel < %EVR mysql-devel < %EVR
Provides: libMySQL-devel = %EVR
Obsoletes: libMySQL-devel < %EVR
Conflicts: libmariadb-devel
Provides: libmysqlclient-devel = %EVR

%package -n libmysqlclient%soname-devel-static
Summary: Development static libraries for MySQL
Summary(ru_RU.UTF-8): Интерфейс прикладного уровня для разработки программ с MySQL
License: LGPL
Group: Development/C
Requires: libmysqlclient%soname-devel = %EVR
Provides: libMySQL-devel-static = %EVR
Obsoletes: libMySQL-devel-static < %EVR
Conflicts: libmariadb-devel-static

%package client
Summary: MySQL Client
Summary(ru_RU.UTF-8): Клиент MySQL
License: GPL
Group: Databases
Provides: mysql-client = %EVR
Obsoletes: mysql-client < %EVR

%package server
Summary: A very fast and reliable SQL database engine
Summary(ru_RU.UTF-8): Очень быстрый и надежный SQL-сервер
License: GPL
Group: Databases
PreReq: MySQL-client = %EVR
PreReq: shadow-utils, coreutils, glibc-locales
Requires(post,preun): chkconfig, chrooted, coreutils, findutils, grep, sed
Provides: mysql-server = %EVR MySQL = %EVR mysql = %EVR community-mysql = %EVR
Obsoletes: mysql-server < %EVR MySQL < %EVR mysql < %EVR
Conflicts: mariadb-server-control

%package server-perl
Summary: Perl utils for MySQL-server
Summary(ru_RU.UTF-8): Perl-утилиты для MySQL-server
License: GPL
Group: Databases
Requires: MySQL-server = %EVR, perl-DBD-mysql
BuildArch: noarch


%define see_base For a description of MySQL see the base MySQL RPM or %url
%define see_base_ru Подробное описание смотрите в пакете MySQL или на %url

%description
MySQL is a true multi-user, multi-threaded SQL (Structured Query
Language) database server. MySQL is a client/server implementation
that consists of a server daemon (mysqld) and many different client
programs/libraries.

The main goals of MySQL are speed, robustness and ease of use.  MySQL
was originally developed because we needed a SQL server that could
handle very big databases with magnitude higher speed than what any
database vendor could offer to us. And since we did not need all the
features that made their server slow we made our own. We have now been
using MySQL since 1996 in a environment with more than 40 databases,
10,000 tables, of which more than 500 have more than 7 million
rows. This is about 200G of data.

The base upon which MySQL is built is a set of routines that have been
used in a highly demanding production environment for many
years. While MySQL is still in development, it already offers a rich
and highly useful function set.

This version allows to use transactions with BDB tables and extended
character set support. See the documentation for more information

%description -l ru_RU.UTF-8
MySQL - это многопользовательский, многопоточный SQL-сервер (SQL -
структурированный язык запросов) баз данных. MySQL построен по технологии
клиент/сервер и включает в себя сервер mysqld и набор различных клиентских
программ и библиотек разработчиков.

Козыри MySQL - скорость, надежность и простота использования. Разработка
MySQL ведется на основе программного кода, который используется в
критических промышленных приложениях уже в течение многих лет. Несмотря на
то, что MySQL только разрабатывается, он уже предоставляет богатый и очень
полезный набор функций.

Данная версия MySQL собрана с поддержкой транзакций и расширенной поддержкой
различных текстовых кодировок. См. документацию для более подробной информации.

%description server
MySQL is a true multi-user, multi-threaded SQL (Structured Query
Language) database server. MySQL is a client/server implementation
that consists of a server daemon (mysqld) and many different client
programs/libraries.

The main goals of MySQL are speed, robustness and ease of use.  MySQL
was originally developed because we needed a SQL server that could
handle very big databases with magnitude higher speed than what any
database vendor could offer to us. And since we did not need all the
features that made their server slow we made our own. We have now been
using MySQL since 1996 in a environment with more than 40 databases,
10,000 tables, of which more than 500 have more than 7 million
rows. This is about 200G of data.

The base upon which MySQL is built is a set of routines that have been
used in a highly demanding production environment for many
years. While MySQL is still in development, it already offers a rich
and highly useful function set.

This version allows to use transactions with BDB tables and extended
character set support. See the documentation for more information.

By default, MySQL server runs in safe chrooted environment with own uid and gid.

%description server-perl
MySQL is a true multi-user, multi-threaded SQL (Structured Query
Language) database server. MySQL is a client/server implementation
that consists of a server daemon (mysqld) and many different client
programs/libraries.
This package contents perl utils for MySQL-server.

%description server -l ru_RU.UTF-8
MySQL - это многопользовательский, многопоточный SQL-сервер (SQL -
структурированный язык запросов) баз данных. MySQL построен по технологии
клиент/сервер и включает в себя сервер mysqld и набор различных клиентских
программ и библиотек разработчиков.

Козыри MySQL - скорость, надежность и простота использования. Разработка
MySQL ведется на основе программного кода, который используется в
критических промышленных приложениях уже в течение многих лет. Несмотря на
то, что MySQL только разрабатывается, он уже предоставляет богатый и очень
полезный набор функций.

Данная версия MySQL собрана с поддержкой транзакций и расширенной поддержкой
различных текстовых кодировок. См. документацию для более подробной информации.

%description -n libmysqlclient%soname
This package contains the shared libraries (*.so*) which certain
languages and applications need to dynamically load and use MySQL.

%description -n libmysqlclient%soname -l ru_RU.UTF-8
Этот пакет содержит динамически загружаемые библиотеки (файлы *.so*),
требуемые для работы большинства клиентских приложений, взаимодействующих
с СУБД MySQL.

%description -n libmysqlclient%soname-devel
This package contains the development header files and libraries
necessary to develop MySQL client applications.

%see_base

%description -n libmysqlclient%soname-devel -l ru_RU.UTF-8
Этот пакет содержит файлы заголовков и библиотеки интерфейса
прикладного уровня, необходимые для разработки клиентских
приложений, взаимодействующих с SQL-сервером MySQL.

%see_base_ru

%description -n libmysqlclient%soname-devel-static
This package contains the development libraries for static linking
necessary to develop MySQL client applications.

%see_base

%description -n libmysqlclient%soname-devel-static -l ru_RU.UTF-8
Этот пакет содержит статические библиотеки интерфейса прикладного уровня,
необходимые для разработки клиентских приложений,
взаимодействующих с SQL-сервером MySQL.

%see_base_ru

%description client
This package contains the standard MySQL clients.

%see_base

%description client -l ru_RU.UTF-8
Этот пакет содержит стандартные клиентские программы для SQL-сервера MySQL

%see_base_ru

%prep
%setup -a99
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch4 -p1
%patch5 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1

# Patch Boost
pushd boost/boost_1_59_0
%patch115 -p0
%patch125 -p1
%patch136 -p1
%patch145 -p1
%patch170 -p2
%patch180 -p2
%patch181 -p2
popd

# with patch4
# Prepare commands list for completion in mysql client.
sed -n 's/^\([[:space:]]*{[[:space:]]*SYM.*(\)\("[&<=>|!A-Z][^"]*"\).*/{\2,0, 0, 0, ""},/p' <sql/lex.h >client/mysql_symbols.inc

%build

%cmake \
	-DBUILD_CONFIG=mysql_release \
	-DFEATURE_SET="community" \
	-DINSTALL_LAYOUT=RPM \
	-DCMAKE_VERBOSE_MAKEFILE=ON \
	-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
	-DCMAKE_C_FLAGS:STRING="$CFLAGS" \
	-DCMAKE_CXX_FLAGS:STRING="$CXXFLAGS" \
	-DCMAKE_INSTALL_PREFIX="%_prefix" \
	-DSYSCONFDIR="%_sysconfdir" \
	-DSYSCONF2DIR="%_sysconfdir/my.cnf.d" \
	-DINSTALL_INCLUDEDIR=include/mysql \
	-DINSTALL_INFODIR=share/info \
	-DINSTALL_LIBDIR="%_lib" \
	-DINSTALL_MANDIR=share/man \
	-DINSTALL_MYSQLSHAREDIR=share/mysql \
	-DINSTALL_MYSQLTESTDIR=share/mysql-test \
	-DINSTALL_PLUGINDIR="%_lib/mysql/plugin" \
	-DINSTALL_SBINDIR=sbin \
	-DINSTALL_SCRIPTDIR=sbin \
	-DINSTALL_SUPPORTFILESDIR=share/mysql \
	-DINSTALL_MYSQLDATADIR="%ROOT" \
	-DINSTALL_MYSQLKEYRINGDIR="/var/lib/mysql-keyring" \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
	-DMYSQL_UNIX_ADDR="%ROOT/mysql.sock" \
	-DMYSQL_DATADIR="%ROOT" \
	-DMYSQL_USER=mysql \
	-DWITH_SSL=system \
	-DWITH_ZLIB=system \
	-DWITH_LZ4=system \
	-DWITH_LIBEVENT=system \
	-DWITH_EDITLINE=system \
	-DWITH_PIC=ON \
	-DWITH_EXTRA_CHARSETS=all \
	-DWITH_ARCHIVE_STORAGE_ENGINE=ON \
	-DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
	-DWITH_INNOBASE_STORAGE_ENGINE=ON \
	-DWITH_PARTITION_STORAGE_ENGINE=ON \
	-DWITH_FEDERATED_STORAGE_ENGINE=ON \
	-DWITHOUT_EXAMPLE_STORAGE_ENGINE=ON \
	-DENABLED_LOCAL_INFILE=ON \
	-DWITH_READLINE=OFF \
	-DWITH_SYSTEMD=ON \
	-DCMAKE_C_FLAGS="%optflags" \
	-DCMAKE_CXX_FLAGS="%optflags" \
	-DWITH_BOOST=../boost/boost_1_59_0 \
	-DCOMPILATION_COMMENT="(%distribution)" \
	-DMYSQL_SERVER_SUFFIX="-%release"

%cmake_build

%install
mkdir -p %buildroot{%_bindir,%_sbindir,%_includedir,%_mandir,%_datadir,/var/log/mysql}
mkdir -p %buildroot%ROOT/{etc,/%_lib,%_libdir,%_libdir/mysql/plugin/,dev,log,tmp,/var/{nis,yp/binding},db/mysql,usr/share/mysql/charsets}
touch %buildroot%ROOT{%_sysconfdir/{hosts,services,{host,nsswitch,resolv}.conf},/dev/urandom,/var/nis/NIS_COLD_START}

%cmakeinstall_std


# Install various helper scripts.
install -pD -m755 %SOURCE1 %buildroot%_initdir/mysqld
install -pD -m644 %SOURCE2 %buildroot%_sysconfdir/logrotate.d/mysql
install -pD -m755 %SOURCE3 %buildroot%_sbindir/safe_mysqld
install -pD -m755 %SOURCE4 %buildroot%_sbindir/mysqld_wrapper
install -pD -m750 %SOURCE6 %buildroot%_sysconfdir/chroot.d/mysql.lib
%if "%_libdir" == "/usr/lib64"
sed -i s,usr/lib,usr/lib64,g %buildroot%_sysconfdir/chroot.d/mysql.lib
%endif
install -pD -m750 %SOURCE7 %buildroot%_sysconfdir/chroot.d/mysql.conf
install -pD -m750 %SOURCE8 %buildroot%_sysconfdir/chroot.d/mysql.all
install -pD -m750 %SOURCE9 %buildroot%_sbindir/mysql_migrate
install -pD -m644 %SOURCE10 %buildroot%_sysconfdir/sysconfig/mysqld
install -pD -m755 %SOURCE16 %buildroot%_controldir/mysqld
install -pD -m755 %SOURCE17 %buildroot%_controldir/mysqld-chroot

# Backwards compatibility symlinks (ALT #14863)
ln -snf ../sbin/safe_mysqld %buildroot%_bindir/mysqld_safe

# delete deprecated
rm -f %buildroot%_bindir/mysql_install_db

# Install configuration files.
install -pD -m644 %SOURCE5 %buildroot%_sysconfdir/my.cnf
install -pD -m644 %SOURCE25 %buildroot%_sysconfdir/my.cnf.d/client.cnf
install -pD -m644 %SOURCE26 %buildroot%_sysconfdir/my.cnf.d/server.cnf
install -pD -m644 %SOURCE27 %buildroot%_sysconfdir/my.cnf.d/mysql-clients.cnf
install -pD -m644 %SOURCE28 %buildroot%_sysconfdir/my.cnf.server/chroot.cnf
install -pD -m644 %SOURCE29 %buildroot%_sysconfdir/my.cnf.server/no-chroot.cnf

install -pD -m644 %SOURCE20 %buildroot%_tmpfilesdir/mysql.conf
install -pD -m644 %SOURCE21 %buildroot%_unitdir/mysqld.service
install -pD -m644 %SOURCE22 %buildroot%_sysconfdir/systemd/system/mysqld.service.d/user.conf

# Fix libmysqlclient_r symlinks
(
	cd %buildroot%_libdir
	N="libmysqlclient_r.so"
	for l in $N.*; do
		if [ -h $l ]; then
			t=${l#$N}
			ln -sf libmysqlclient.so$t $N$t
		fi
	done
)

# Populate chroot with data to some extent.
install -pD -m644 %buildroot%_datadir/mysql/charsets/* \
		     %buildroot%ROOT%_datadir/mysql/charsets

(
	cd %buildroot%_datadir/mysql
	for i in */errmsg.sys; do
		install -pD -m644 $i  %buildroot%ROOT%_datadir/mysql/$i
	done
)


mkdir -p %buildroot%_docdir/MySQL-%version
install -p -m644 README %SOURCE14 %buildroot%_docdir/MySQL-%version

rm -f %buildroot%_bindir/safe_mysqld
rm -f %buildroot%_datadir/mysql/mysql{-*.spec,-log-rotate,.server}

touch %buildroot%ROOT/log/queries
touch %buildroot%_logdir/mysql/info

install -p -m 0750 -d %buildroot%_localstatedir/mysql-files
install -p -m 0700 -d %buildroot%_localstatedir/mysql-keyring

# not needed in rpm package
rm -rf %buildroot%_datadir/mysql-test
rm -f %buildroot%_libdir/mysql/plugin/*.la
rmdir %buildroot%_libdir/mysql/plugin/debug
rm -f %buildroot%_bindir/mysql_embedded
rm -f %buildroot%_libdir/mysql/*.a
rm -f %buildroot%_datadir/mysql/magic
rm -f %buildroot%_datadir/mysql/mysqld_multi.server

# broken manpages referencing missing paths
rm -f %buildroot%_man1dir/mysql{_client_,}test_embedded.1
rm -fr %buildroot/usr/share/info


%define get_datadir \
DATADIR=`/usr/bin/my_print_defaults mysqld |sed -ne 's/^--datadir=\\(.*\\)/\\1/pg' |tail -1` \
[ -n "$DATADIR" ] || { echo "Failed to read configuration"; exit 1; }

%postun server
if [ $1 = 0 ]; then
	rm -f %ROOT/lib/* %ROOT/var/yp/binding/*
fi

%preun server
%preun_service mysqld

%pre server
/usr/sbin/groupadd -r -f %mysqld_user
/usr/sbin/useradd -r -g %mysqld_user -d %ROOT -s /dev/null -c "MySQL server" -n %mysqld_user >/dev/null 2>&1 ||:

if [ ! -e %ROOT/my.cnf -a -f /etc/my.cnf -a ! -L /etc/my.cnf -a ! -e /etc/my.cnf.rename ]; then
	mv -v /etc/my.cnf /etc/my.cnf.rename &&
	chown 0:0 /etc/my.cnf.rename &&
	chmod 600 /etc/my.cnf.rename ||
	{ echo "Error moving my.cnf" >&2; exit 1; }
fi

%pre_control mysqld
%pre_control mysqld-chroot

echo "####################################################################"
echo "#   You may need database format conversion for correct operation: #"
echo "#  Please consider using: /usr/bin/mysql_upgrade according to      #"
echo "#  https://dev.mysql.com/doc/refman/5.7/en/upgrading.html          #"
echo "####################################################################"

%post server
if [ -f /etc/my.cnf.rename -a ! -L /etc/my.cnf.rename -a ! -e /etc/my.cnf ]; then
	mv -fv %ROOT/my.cnf %ROOT/my.cnf.rpmnew &&
	mv -v /etc/my.cnf.rename %ROOT/my.cnf &&
	chown 0:0 %ROOT/my.cnf &&
	chmod 600 %ROOT/my.cnf ||
	{ echo "Error moving my.cnf" >&2; mv -v /etc/my.cnf.rename /etc/my.cnf; }
fi

if grep "^[[:space:]]*skip-bdb[[:space:]]*$" /var/lib/mysql/my.cnf > /dev/null 2>&1; then
	sed -i "s/^[[:space:]]*skip-bdb[[:space:]]*$/#skip-bdb/" /var/lib/mysql/my.cnf;
fi

if grep "^[[:space:]]*bdb-logdir=" /var/lib/mysql/my.cnf > /dev/null 2>&1; then
	sed -i "s/^[[:space:]]*bdb-logdir=/#bdb-logdir=/" /var/lib/mysql/my.cnf;
fi


if grep "^[[:space:]]*skip-locking[[:space:]]*$" /var/lib/mysql/my.cnf > /dev/null 2>&1; then
	sed -i "s/^[[:space:]]*skip-locking[[:space:]]*$/skip-external-locking/" /var/lib/mysql/my.cnf;
fi

rm -rf %ROOT/dev
%_sysconfdir/chroot.d/mysql.all force

%post_control -s local mysqld
%post_control -s enabled mysqld-chroot


# see also http://dev.mysql.com/doc/refman/5.5/en/upgrading.html
%get_datadir
if [ "$DATADIR" = / ]; then
	# Have to update configuration manually.
	sed -i 's,^datadir=/$,datadir=/db,g' /etc/my.cnf &&
		DATADIR=`/usr/bin/my_print_defaults mysqld |sed -ne 's/^--datadir=\(.*\)/\1/pg' |tail -1` ||
		{ echo "Failed to update configuration"; exit 1; }
fi

NEED_RESTART=
if [ -f "%ROOT/mysql/db.frm" -a ! -f "%ROOT$DATADIR/mysql/db.frm" ]; then
	%_initdir/mysqld status &>/dev/null && %_initdir/mysqld stop && NEED_RESTART=1 ||:
	(cd %ROOT
	install -d -m750 -o %mysqld_user -g adm ".$DATADIR"
	for d in `find -mindepth 1 -maxdepth 1 -type d |grep -Ev '\./(dev|etc|lib|log|tmp|db)$'`; do
		mv -i "$d" ".$DATADIR/$d"
	done)
	echo "Database root have been moved to $DATADIR"
fi

if [ -n "$NEED_RESTART" ]; then
	%_initdir/mysqld start ||:
else
	%post_service mysqld
fi

%triggerin server -- MySQL-server < 5.7.21-alt1
#if pre 5.7.21 installation of server have never been run, we should
#remove empty /var/lib/mysql/db/mysql dir to enable --initialize sequence
%get_datadir
# look for empty dir 
if [ "$(ls -A %ROOT$DATADIR/mysql)" ]; then
#     echo "Database dir is not Empty"
     echo "%ROOT$DATADIR/mysql"
else
#    echo "Database dir is Empty, removing"
    rmdir %ROOT$DATADIR/mysql ||:
fi

echo "####################################################################"
echo "#              Attention! MySQL upgrade 5.5.xx -> %version           #"
echo "####################################################################"
echo "#  Please backup your data before you start conversion!            #"
echo "#  You may need database format conversion for correct operation:  #"
echo "# 1. run server: /usr/sbin/mysqld -C utf8 --skip-grant-tables &    #"
echo "# 2. run converter:  /usr/bin/mysql_upgrade                        #"
echo "#  To ensure the conversion succeeded:                             #"
echo "# 3. cat %ROOT$DATADIR/mysql_upgrade_info                      #"
echo "# MySQL version should be displayed as: \"%version\"                   #"
echo "####################################################################"

%triggerpostun server -- MySQL-server < 5.5.28-alt1
%get_datadir
# they've moved innodb to plugins in later 5.1 just to move it back in 5.5, sigh
if [ -f /var/lib/mysql/my.cnf -a -f "%ROOT$DATADIR/ibdata1" ]; then
	if grep "^plugin-load=innodb=ha_innodb_plugin\.so" /var/lib/mysql/my.cnf; then
		echo "  WARNING: if InnoDB is used, please examine /var/lib/mysql/my.cnf*"
		echo "  and ensure that the *builtin* innodb is in use again"
	fi
fi

%if_with libs
%files -n libmysqlclient%soname
%_libdir/*.so.*
%endif

%if_with devel
%files -n libmysqlclient%soname-devel
%_bindir/mysql_config
%_libdir/*.so
%_includedir/*
%_aclocaldir/mysql.m4
%_pkgconfigdir/*.pc
%endif

%if_enabled static
%files -n libmysqlclient%soname-devel-static
%_libdir/*.a
%_libdir/mysql
%_pkgconfigdir/*.pc
%endif

%files client
%dir %_sysconfdir/my.cnf.d
%config(noreplace) %_sysconfdir/my.cnf.d/client.cnf
%config(noreplace) %_sysconfdir/my.cnf.d/mysql-clients.cnf
%_bindir/innochecksum
%_bindir/my_print_defaults
%_bindir/mysql
%_bindir/mysql_client_test
%_bindir/mysqladmin
%_bindir/mysqlbinlog
%_bindir/mysqlcheck
%_bindir/mysqldump
%_bindir/mysqlimport
%_bindir/mysqlpump
%_bindir/mysqlshow
%_bindir/mysqltest
%_bindir/mysqlslap
%_bindir/perror
%_bindir/replace
%_bindir/resolve*
%_bindir/lz4_decompress
%_bindir/zlib_decompress
%_mandir/man?/*

%files server-perl
%_bindir/mysqldumpslow

%files server
%_initdir/*
%config(noreplace) %_sysconfdir/sysconfig/*
%config(noreplace) %_sysconfdir/logrotate.d/*
%config(noreplace) %_sysconfdir/control.d/facilities/*
%config %_sysconfdir/chroot.d/*
%config(noreplace) %_sysconfdir/my.cnf
%config(noreplace) %_sysconfdir/my.cnf.d/server.cnf
%_sysconfdir/my.cnf.server
%config(noreplace) %_sysconfdir/my.cnf.server/*.cnf
%_tmpfilesdir/mysql.conf
%_unitdir/mysqld.service
%config(noreplace) %_sysconfdir/systemd/system/mysqld.service.d/user.conf

%_bindir/*isam*
%_bindir/mysql_secure_installation
%_bindir/mysql_ssl_rsa_setup
%_bindir/mysql_tzinfo_to_sql
%_bindir/mysql_upgrade
%_bindir/mysqld_safe
%_bindir/mysql_plugin
%_sbindir/*
%_libdir/mysql/plugin
%_datadir/mysql
%attr(750,root,adm) %dir /var/log/mysql
%ghost %verify(not md5 mtime size) /var/log/mysql/*
%attr(0770,root,mysql) %dir %_localstatedir/mysql-files
%attr(0700,mysql,mysql) %dir %_localstatedir/mysql-keyring
%dir %_docdir/MySQL-%version
%_docdir/MySQL-%version/README*
%attr(3771,root,mysql) %dir %ROOT
%attr(710,root,mysql) %dir %ROOT/%_lib
%attr(710,root,mysql) %dir %ROOT/%_libdir
%attr(710,root,mysql) %dir %ROOT/%_libdir/mysql
%attr(710,root,mysql) %dir %ROOT/%_libdir/mysql/plugin
%attr(710,root,mysql) %dir %ROOT%_sysconfdir
%ghost %ROOT%_sysconfdir/hosts
%ghost %ROOT%_sysconfdir/services
%ghost %ROOT%_sysconfdir/*.conf
%dir %ROOT/dev
%ghost %ROOT/dev/urandom
%attr(710,root,mysql) %dir %ROOT/var
%dir %ROOT/var/nis
%ghost %ROOT/var/nis/NIS_COLD_START
%dir %ROOT/var/yp
%dir %ROOT/var/yp/binding
%dir %ROOT/usr
%dir %ROOT%_datadir
%ROOT%_datadir/mysql
%attr(3770,root,mysql) %dir %ROOT/db
%attr(750,mysql,mysql) %ghost %ROOT/db/*
%attr(3770,root,mysql) %dir %ROOT/log
%attr(660,mysql,mysql) %ghost %verify(not md5 mtime size) %ROOT/log/*
%attr(3770,root,mysql) %dir %ROOT/tmp

%changelog
* Mon Dec 30 2019 Nikolai Kostrigin <nickel@altlinux.org> 5.7.28-alt1
- new version
- switch to strict dependencies

* Wed Nov 21 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.24-alt1
- new version
- fix build with gcc8

* Mon Oct 15 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.23-alt3
- remove ubt
- fix build by removing libwrap dependency

* Thu Sep 13 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.23-alt2
- fix mysqld init script charset initialization sequence (closes: #35298)
- move tmpfiles to /run/mysqld (rider@)

* Mon Sep 03 2018 Anton Farygin <rider@altlinux.ru> 5.7.23-alt1
- 5.7.23
- removed old and unused trigger with execution of the mysql_upgrade

* Mon Jul 09 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.22-alt1
- 5.7.22
- new version (some bug fixes)

* Fri Jun 08 2018 Aleksei Nikiforov <darktemplar@altlinux.org> 5.7.21-alt8
- NMU: updated provides (Closes: #35004).

* Wed May 30 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt7
- fix chrooted mysqld operation under SysVinit

* Wed May 29 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt6
- modify chroot control facility (combine server and client setup)
- fix unowned dir /etc/my.cnf.server (closes: #32229) 

* Wed May 24 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt5
- fix installation with preinstalled maria-db (conflict mariadb-server-control)
- add database upgrade warning message to post install scripts
- fixed typo in initscript (thanks to rider@)

* Wed May 10 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt4
- enable backport to p8 (merge commit history)

* Wed May 09 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt3
- rebuild with ubt

* Fri Mar 23 2018 Nikolai Kostrigin <nickel@altlinux.org> 5.7.21-alt2
- 5.7.21
- update chroot patch

* Thu Feb 15 2018 Alexey Shabalin <shaba@altlinux.ru> 5.7.21-alt1
- 5.7.21
- sync patches, configs, scripts with mariadb

* Mon Jul 24 2017 Denis Medvedev <nbr@altlinux.org> 5.5.57-alt1
- 5.5.57 (Fixes: CVE-2017-3653, CVE-2017-3651, CVE-2017-3652, CVE-2017-3648, CVE-2017-3641, CVE-2017-3636, CVE-2017-3635)
- Fixes various memory and pointer mishandlings.

* Mon Apr 03 2017 Anton V. Boyarshinov <boyarsh@altlinux.org> 5.5.54-alt1
- 5.5.54 (Fixes: CVE-2017-3318, CVE-2017-3317, CVE-2017-3313, CVE-2017-3312, CVE-2017-3291, CVE-2017-3265, CVE-2017-3258, CVE-2017-3244, CVE-2017-3243, CVE-2017-3238)

* Thu Nov 17 2016 Anton Farygin <rider@altlinux.ru> 5.5.53-alt2
- disabled secure_file_priv in default cofiguration because still used
  chrooted environment (/var/lib/mysql) (closes: #32758)

* Wed Nov 02 2016 Anton V. Boyarshinov <boyarsh@altlinux.org> 5.5.53-alt1
- 5.5.53
- dh-1024 patch removed (2048 is upstream value now)

* Sat Sep 12 2015 Michael Shigorin <mike@altlinux.org> 5.5.43-alt2
- added aarch64 support (glebfm@)

* Tue Apr 07 2015 Michael Shigorin <mike@altlinux.org> 5.5.43-alt1
- 5.5.43

* Tue Feb 03 2015 Michael Shigorin <mike@altlinux.org> 5.5.42-alt1
- 5.5.42
  + dropped texinfo pages (missing now)

* Sat Jun 08 2013 Michael Shigorin <mike@altlinux.org> 5.5.32-alt1
- 5.5.32

* Mon Apr 01 2013 Michael Shigorin <mike@altlinux.org> 5.5.30-alt3
- made subpackages with client libraries and devel headers optional,
  turned these off by default since mariadb provides them and looks
  more maintainable based on current consensus (closes: #28676)
- dropped explicit library requirements (set-versions should suffice)

* Mon Mar 04 2013 Michael Shigorin <mike@altlinux.org> 5.5.30-alt2
- fixed chrooted configuration (closes: #28630)

* Tue Feb 05 2013 Michael Shigorin <mike@altlinux.org> 5.5.30-alt1
- 5.5.30

* Sun Dec 23 2012 Michael Shigorin <mike@altlinux.org> 5.5.29-alt1
- 5.5.29
- added is_prefix, scramble symbols to libmysqlclient18
  for better compatibility with the one from mariadb
  (also needed by DBD::mysql and hydra, correspondingly)
- increased DH key length from 512 to 1024 bits (thanks, fedora)

* Tue Oct 23 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt6
- applied several more fedora patches

* Tue Oct 23 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt5
- added forgotten complimentary libmysqlclient patch from fedora
- libmysqlclient18 -> libmysqlclient-devel dependency expunged

* Thu Oct 18 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt4
- added library versioning from fedora (thx ldv@ and rpmsodiff)

* Sun Oct 14 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt3
- added Conficts: libmariadb*

* Thu Oct 11 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt2
- fixed one-byte postun trigger thinko (included current version)

* Thu Oct 11 2012 Michael Shigorin <mike@altlinux.org> 5.5.28-alt1
- 5.5.28 (closes: #27016)
  + NB: innodb is builtin *again*, please pay attention to my.cnf
- use innodb_file_per_table (closes: #27072)
- fixed charset handling in initscript (closes: #26817)
- implemented extendedstatus in initscript (closes: #7719)
- implemented basic control facility (lnkvisitor@)

* Mon Jun 18 2012 Dmitriy Kulik <lnkvisitor@altlinux.org> 5.5.25-alt1
- Test build Mysql 5.5.25

* Mon May 07 2012 Michael Shigorin <mike@altlinux.org> 5.1.63-alt1
- 5.1.63

* Fri Mar 23 2012 Michael Shigorin <mike@altlinux.org> 5.1.62-alt1
- 5.1.62
- /dev/urandom tweaks
- spec cleanup

* Wed Mar 21 2012 Michael Shigorin <mike@altlinux.org> 5.1.61-alt2
- create /dev/urandom in chroot so SSL support actually works;
  thanks naf@ (closes: #27100)

* Thu Jan 12 2012 Michael Shigorin <mike@altlinux.org> 5.1.61-alt1
- 5.1.61

* Fri Dec 30 2011 Michael Shigorin <mike@altlinux.org> 5.1.60-alt2
- please note that 5.1.50-alt1 introduced modular InnoDB support
  thus the plugin must be loaded if it's supposed to be used

* Wed Nov 23 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.60-alt1
- 5.1.60

* Tue Sep 20 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.59-alt1
- 5.1.59

* Wed Jul 06 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.58-alt1
- 5.1.58

* Tue May 10 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.57-alt1
- 5.1.57

* Fri Mar 18 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.56-alt4
- make mysqld plugins usable (ALT #25248)

* Thu Mar 17 2011 Alexey Tourbin <at@altlinux.ru> 5.1.56-alt3
- hack around __cxa_pure_virtual issue

* Thu Mar 17 2011 Alexey Tourbin <at@altlinux.ru> 5.1.56-alt2
- built with OpenSSL instead of bunled yaSSL
- mysql_config: disabled dependency on libssl-devel

* Wed Mar 09 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.56-alt1
- 5.1.56

* Wed Feb 09 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.55-alt1
- 5.1.55

* Tue Nov 02 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.52-alt1
- 5.1.52

* Tue Sep 28 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.51-alt1
- 5.1.51

* Mon Sep 27 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.50-alt6
- upgrade old my.cnf more gracefully (closes #24165)

* Mon Sep 27 2010 Anton Farygin <rider@altlinux.ru> 5.1.50-alt5
- added my_compiler.h for build with my_global.h

* Thu Sep 23 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.50-alt4
- remove unsupported --skip-bdb from /usr/sbin/mysql_migrate

* Wed Sep 22 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.50-alt3
- remove unsupported options from /usr/sbin/mysql_install_db

* Wed Sep 22 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.50-alt2
- Provide/Oblosete libMySQL5.1{-devel,-devel-static} (closes #24134)

* Fri Sep 17 2010 Vitaly Kuznetsov <vitty@altlinux.ru> 5.1.50-alt1
- 5.1.50

* Mon Jan 25 2010 Anton Farygin <rider@altlinux.ru> 5.0.89-alt1
- new version (closes #18943)
- fixed CVE-2009-2446 from upstream (closes #20724)
- setup utf8 encoding instead of latin1 by default (closes #12390)
- include C99 aliasing violation patch from mythtv (closes #22452)
- removed username-length patch
- wait for mysqld shutdown (closes #22234)
- don't run initial setup mysql database if mysql.user table already exists

* Mon Jun 29 2009 L.A. Kostis <lakostis@altlinux.ru> 5.0.83-alt2
- Security fixes:
  + CVE-2008-4456: potential XSS in HTML output (closes #19843).
- Remove obsoleted macros.

* Thu Jun 25 2009 L.A. Kostis <lakostis@altlinux.ru> 5.0.83-alt1
- 5.0.83.
- Remove obsoleted macros.
- Disabled patch20,patch22, updated htmlhelp to revision 15415.

* Wed May 13 2009 L.A. Kostis <lakostis@altlinux.ru> 5.0.81-alt1
- 5.0.81.
- Update htmlhelp to revision 14892.

* Sun May 03 2009 L.A. Kostis <lakostis@altlinux.ru> 5.0.77-alt1
- 5.0.77.
- Update htmlhelp to revision 14789.
- Remove obsoleted patches.

* Sun Jan 18 2009 L.A. Kostis <lakostis@altlinux.ru> 5.0.75-alt1
- 5.0.75.
- Package some packages as noarch.
- Change htmlhelp package group to Documentation.
- Update htmlhelp to revision 13252.

* Fri Nov 21 2008 L.A. Kostis <lakostis@altlinux.ru> 5.0.67-alt2
- Bugfix build.
- Remove deprecated %%post_ldconfig/%%postun_ldconfig.
- Added patches:
  + mysql-5.0.68-BUG#37027: expire_logs_days and missing
    binlogs cause a crash !

* Tue Nov 11 2008 L.A. Kostis <lakostis@altlinux.ru> 5.0.67-alt1
- 5.0.67.
- rediffed patches.
- Applied patches from Debian unstable/Ubuntu intrepid:
  + mysqlhotcopy-invalid-dbtable.patch: fix broken security fix.
  + upstream_bug_23921: Fixes random build failures.
  + scripts__mysql_config__libs: Removes unnecessary library dependencies.
- Applied patch from Gentoo:
  + ltmain.patch: fix build with recent automake.

* Sun Sep 14 2008 Dmitry V. Levin <ldv@altlinux.org> 5.0.51-alt3.a
- Build for Sisyphus.

* Wed Sep 10 2008 Dmitry V. Levin <ldv@altlinux.org> 5.0.51-alt2.a.M40.2
- mysql_install_db: Fixed typo (closes: #15924).
- Reduced rpm macros abuse in specfile.
- Updated reference manual.

* Sat May 31 2008 Dmitry V. Levin <ldv@altlinux.org> 5.0.51-alt2.a.M40.1
- Fixed build for 4.0 branch.

* Sun Mar 16 2008 L.A. Kostis <lakostis@altlinux.ru> 5.0.51-alt2.a
- 5.0.51a.
- Security fixes:
  + CVE-2008-0226, CVE-2008-0227 (Three vulnerabilities in yaSSL versions 1.7.5
    that could lead to a server crash or execution of unauthorized code.)
  + ALTER VIEW retained the original DEFINER value, even when altered by
    another user, which could allow that user to gain the access rights of the
    view (MySQL #29908).
- Add glibc-locales to -server deps (ALT #13909 #14731).
- Make links to mysqld_safe for backwards compatibility (ALT #14863).
- Update html documentation to 10265 revsion.

* Tue Jan 01 2008 L.A. Kostis <lakostis@altlinux.ru> 5.0.51-alt1
- 5.0.51.
- Security fixes:
  + CVE-2007-5969 (RENAME TABLE System Table Overwrite Vulnerability)
  + CVE-2007-6303 CVE-2007-6304
    (Server Privilege Escalation And Denial Of Service Vulnerabilities)
- Update html documentation to 9232 revision.

* Thu Aug 09 2007 L.A. Kostis <lakostis@altlinux.ru> 5.0.46-alt2
- fix a typo in alt-mysql_install_db.patch.

* Mon Aug 06 2007 L.A. Kostis <lakostis@altlinux.ru> 5.0.46-alt1
- 5.0.46.
- Update -alt-install-db.patch.
- Update -alt-username-length patch.
- Update documentation to 7319 revision.

* Wed Jun 20 2007 L.A. Kostis <lakostis@altlinux.ru> 5.0.42-alt1
- 5.0.42.

* Mon May 28 2007 L.A. Kostis <lakostis@altlinux.ru> 5.0.41-alt1
- 5.0.41 release.
- Fix CVE-2007-2583 DoS (Failure to Handle Exceptional Conditions).
- Added patches from BK:
  + BUG#28337 (NOT EXISTS with GROUP BY behaves different in 5.0.40).
- Update ALTLinux patches:
  + install-db patch.
  + username-length patch.
- Updated html help (to 6552 revision).
- Allow custom nice setting for mysqld (fix ALT #10941).
- Added mysqld-multi (fix ALT #5715).
- Added several files for -server and client.

* Sun Feb 11 2007 L.A. Kostis <lakostis@altlinux.ru> 5.0.34-alt1
- 5.0.34 release.
- update html help (to 4891 revision).
- Fix db_install in hasher (closes #10788).
- Fix charset detection routes in init.d script.
- Update install-db patch.
- Remove obsoleted patches.

* Sat Dec 30 2006 L.A. Kostis <lakostis@altlinux.ru> 5.0.30-alt0.1
- Unofficial 5.0.30 release (use Debian sources).
- Use Docs from previous 5.0.27-GA release.
- Fix SSL docs install.

* Fri Dec 29 2006 ALT QA Team Robot <qa-robot@altlinux.org> 5.0.27-alt1.1
- Rebuilt due to libcrypto.so.4 -> libcrypto.so.6 soname change.

* Thu Nov 02 2006 L.A. Kostis <lakostis@altlinux.ru> 5.0.27-alt1
- 5.0.27 release;
- Added patches:
  + db-4.1.24-disable-pthreadsmutexes.patch: fix NPTL issues
    (found in Mandriva package);
  + mysql-5.0.15-disable-pthreadsmutexes.patch: fix NPTL issues
    (found in Mandriva package);
  + mysql-5.0.27-alt-username-length.patch: add custom username-length
    (5.0 backport of BUG#16553) and README.ALT-ru_RU.UTF-8 about incompatible
    changes introduced by this patch;
- Add html documentation from http://dev.mysql.com/docs.

* Sat Aug 26 2006 LAKostis <lakostis at altlinux.org> 5.0.24-alt2
- fix libmysqlclient ABI breakage introduced in 5.0.24 (see
  http://bugs.mysql.com/bug.php?id=21543 for details).

* Wed Aug 09 2006 LAKostis <lakostis at altlinux.org> 5.0.24-alt1
- 5.0.24 release.

* Thu Jun 01 2006 LAKostis <lakostis at altlinux.ru> 5.0.22-alt1
- 5.0.22.
- Security fix of SQL-injection multibyte encoding processing.

* Wed May 10 2006 LAKostis <lakostis at altlinux.ru> 5.0.21-alt1
- 5.0.21.
- Remove bk patches (merged to upstream).
- Update install_db patch.
- Update -no-atomic patch.
- Remove tinfo patch (http://bugs.mysql.com/bug.php?id=18912).
- Security fixes:
  + CVE-2006-1516;
  + CVE-2006-1517;
  + CVE-2006-1518.

* Fri Apr 14 2006 LAKostis <lakostis at altlinux.ru> 5.0.20-alt1
- 5.0.20.
- Add mysql_upgrade trigger/script for proper 4.x -> 5.0 upgrade.
- Added some fixing patches from upcoming 5.0.21:
  + BUG#16281 (Multi-table update failing to change matched rows).
  + BUG#18830 (incompatibility new libraries with old server).
- Removed obsoleted patches.

* Sun Apr 09 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt2
- Added patches:
  + BUG#15719 fix (see #9348 for details);
  + BUG#17667 (aka CVE-2006-0903) fix;

* Thu Feb 23 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt1.4
- fix #9135;
- fix debug switch.
- fix non-static build switch.

* Sun Feb 12 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt1.3
- fix bogus vars in init.d script.
- add skip-bdb only for x86_64.

* Tue Feb 07 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt1.2
- fix alt-chroot patch.
- fix init.d script and add /etc/sysconfig/mysqld entry.

* Sun Feb 05 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt1.1
- remove chroot patch. Need to rework!
- disable ssl support.
- fix ssl switch.

* Wed Feb 01 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt1
- release for Sisyphus;
- cleanup patches.

* Thu Jan 26 2006 LAKostis <lakostis at altlinux.ru> 5.0.18-alt0.1
- jump to 5.0.18.
- update patches from Fedora.
- update create_db patch.
- update defaults patch, add DATADIR to config_search path.
- add old_passwords=1 for compatibility with old clients.
- disable log queries by default.
- disable bdb support (for AMD64/x86 see comment in my.cnf).
- disable -static builds by default.

* Tue Jan 17 2006 LAKostis <lakostis at altlinux.ru> 4.1.16-alt0.1
- 4.1.16.

* Sun Dec 25 2005 LAKostis <lakostis at altlinux.ru> 4.1.14-alt0.5
- remove chroot build switch.

* Sun Nov 20 2005 LAKostis <lakostis at altlinux.ru> 4.1.14-alt0.4
- fix chroot config handling.

* Sat Sep 17 2005 LAKostis <lakostis at altlinux.ru> 4.1.14-alt0.3
- 4.1.14;
- FIXME - need rework chroot patch for proper charset handling;
- add isam support for old db installs.
- add x86_64 patches from RH and Annvix;
- add non-chroot build switch;
- remove doc package.

* Thu Mar 24 2005 Kachalov Anton <mouse@altlinux.ru> 4.0.24-alt1
- 4.0.24

* Wed Oct 20 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.21-alt1
- 4.0.21
- don't kill other mysqld processes on service stop (#5371)

* Mon Jun 07 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.20-alt1
- new version 4.0.20
- Added script mysqlhotcopy (#3365)
- Merge -utils package with -server-perl
- fixed mysqld.init script (3rd time :)

* Wed Apr 28 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.18-alt4
- Move mysqlaccess and mysqldumpslow scripts to new MySQL-utils package (#3964)

* Wed Mar 17 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.18-alt3
- Added requires for MySQL-client for perl-CGI (#2359)

* Fri Feb 27 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.18-alt2
- MySQL server crashes while running on systems with LDAP (#3729)

* Wed Feb 18 2004 Kachalov Anton <mouse@altlinux.ru> 4.0.18-alt1
- new version 4.0.18
- fixed mysqld.init script (Dmitry Vukolov <dav@altlinux.org>)

* Thu Dec 18 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.17-alt1
- new version 4.0.17

* Fri Nov 28 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.16-alt2
- fixed setting of default charset
- removed depreciated buildreqs

* Tue Nov 25 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.16-alt1
- new version 4.0.16
- fixed Requires(post,preun) (#3155)
- Do not package .la files.

* Tue Sep 30 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.15-alt2
- added mysql_migrate script for migration from 3.x to 4.0 version of MySQL
- mysql_install_db script fix (based on old ldv's script)

* Wed Sep 17 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.15-alt1
- new version 4.0.15
- enabled charset conversion for more charsets

* Thu Jul 10 2003 Kachalov Anton <mouse@altlinux.ru> 4.0.13-alt1
- new version 4.0.13

* Fri Mar 21 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.56-alt3
- Fixed my.cnf migration support.

* Tue Mar 18 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.56-alt2
- Fixed build in environment without /proc.
- Fixed build without libncurses-devel.
- Updated buildrequires.
- server: handle default my.cnf migration.

* Tue Mar 18 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.56-alt1
- Updated to 3.23.56, redone few patches.

* Tue Mar 11 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.55-alt3
- load_defaults: do not process untrusted files if executed by root.

* Mon Mar 10 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.55-alt2
- Packaged %%ROOT/my.cnf, owned by root and available to root only,
  to avoid mysql->root possible privilege escalation described by
  Gufino in his Bugtraq posting:
  http://www.securityfocus.com/archive/1/314391
- Changed /etc/my.cnf permissions from 0600 to 0644.
  Check your /etc/my.cnf file and move all sensitive data out there.
- Updated comment in logrotate script, thanks to discussion in
  Sisyphus mailing list:
  http://www.altlinux.ru/pipermail/sisyphus/2003-February/039434.html

* Tue Jan 28 2003 Dmitry V. Levin <ldv@altlinux.org> 3.23.55-alt1
- Updated to 3.23.55.
- Applied docs build fixes from Lenz Grimmer.

* Fri Dec 13 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.54-alt2
- mysqlbug: fixed contact email address.

* Thu Dec 12 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.54-alt1
- Updated to 3.23.54.
- Updated chroot patch to new version.
- Added reservedwords.texi (lost in new version).
- Updated interpackage dependencies.
- Adjusted perl dependencies.

* Tue Dec 03 2002 Stanislav Ievlev <inger@altlinux.ru> 3.23.53-alt2
- added server-perl subpackage, to reduce deps on perl of server

* Tue Oct 15 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.53-alt1
- 3.23.53
- Better debugging support.

* Mon Sep 16 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.52-alt1
- 3.23.52
- Ensure tzset(3) is called before chroot(2).
- Removed %%_sysconfdir/localtime from %%ROOT chroot.
- Use subst instead of perl for text substitution.
- Linked with readline-4.3.
- Built with gcc-3.2.

* Wed Jul 03 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.51-alt2
- Patched to link with libtinfo.

* Fri Jun 14 2002 Dmitry V. Levin <ldv@altlinux.org> 3.23.51-alt1
- 3.23.51
- Fixed typo in safe_mysqld.
- Removed aggressive optimization.

* Sat Apr 27 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.50-alt1
- 3.23.50

* Wed Apr 17 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.49-alt5
- Fixed recent fix.

* Tue Apr 16 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.49-alt4
- Updated chroot (fixed permissions, added NIS/NIS+ support).

* Mon Apr 08 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.49-alt3
- Added my_dir.h to libMySQL-devel (#0000701).

* Thu Feb 21 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.49-alt2
- Added %%ROOT/dev removal from existing configurations.
- Dropped mysql.chroot.log script (unneeded anymore).

* Wed Feb 20 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.49-alt1
- 3.23.49.
- Removed /dev from %ROOT.
- Fixed server %%post/%%preun scripts (#0000324).

* Fri Jan 04 2002 Dmitry V. Levin <ldv@alt-linux.org> 3.23.47-alt1
- 3.23.47.

* Thu Dec 13 2001 Dmitry V. Levin <ldv@alt-linux.org> 3.23.46-alt2
- Made gif2png conversion configurable.
- Automatically regenerated buildrequires.

* Mon Dec 03 2001 Dmitry V. Levin <ldv@alt-linux.org> 3.23.46-alt1
- 3.23.46

* Mon Nov 26 2001 Dmitry V. Levin <ldv@alt-linux.org> 3.23.45-alt1
- 3.23.45
- Fixed relocation of libmysqlclient* libraries (#0000145).
- Split html documentation (#0000179).
- Added png pictures to html documentation subpackage.

* Sun Nov 04 2001 Dmitry V. Levin <ldv@alt-linux.org> 3.23.44-alt1
- 3.23.44

* Wed Oct 10 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.43-alt1
- 3.23.43
- Patched scripts in MySQL-bench to make them functional (mdk).

* Fri Sep 21 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.42-alt1
- 3.23.42
- Updated interpackage dependencies.
- Built with internal db-3.2.9a.

* Fri Apr 27 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.33-ipl8mdk
- Fixed mysqld_wrapper to handle server shutdown correctly.
- Relocated mysql_install_db from %%_bindir to %%_sbindir/
- Updated mysql_install_db to work with chrooted environments.

* Thu Apr 26 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.33-ipl7mdk
- Fixed (finally?) server %%postin script to handle recent database move.

* Wed Apr 25 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.33-ipl6mdk
- Fixed (again) server %%postin script to handle recent database move.
- Updated PreReqs for server subpackage.

* Tue Apr 24 2001 Dmitry V. Levin <ldv@altlinux.ru> 3.23.33-ipl5mdk
- Updated %%postin script to handle recent database move.

* Sat Apr 21 2001 Alexander Bokovoy <ab@avilink.net> 3.23.33-ipl4mdk
- Fixed bug in datadir handling for chrooted environments.
- MySQL databases moved to $chrootdir/db/
- libMySQL-devel has been transformed to libMySQL-devel and libMySQL-devel-static
- mysql_config has been changed to reflect libMySQL-devel splitting:
    + it returns $libs set to shared ones only when libMySQL-devel-static not installed

* Tue Feb 27 2001 Dmitry V. Levin <ldv@fandra.org> 3.23.33-ipl3mdk
- Fixed dependencies for server subpackage (added PreReqs).
- Moved %%_bindir/my_print_defaults utility back to client subpackage.
- Moved texinfo documentation back to client subpackage.
- Fixed %%post/%%preun scripts for proper texinfo documentation (un)installation.

* Sat Feb 24 2001 Alexander Bokovoy <ab@avilink.net> 3.23.33-ipl2mdk
- Proper distribution of utilites along packages
- Fixed texinfo documentation
- Fixed dependencies

* Thu Feb 15 2001 Dmitry V. Levin <ldv@fandra.org> 3.23.33-ipl1mdk
- 3.23.33
- Rewritten startup scripts.
- Ported to new chrooted scheme.
- Changed address for bug reports to devel@alt-linux.org.

* Fri Feb 09 2001 Dmitry V. Levin <ldv@fandra.org> 3.23.32-ipl6mdk
- Libification.
- Fixed texinfo documentation.
- Client: added readline expansion for all symbols.

* Thu Feb 01 2001 Alexander Bokovoy <ab@avilink.net> 3.23.32-ipl5mdk
- New version with correct db3

* Sat Dec 30 2000 Alexander Bokovoy <ab@avilink.net> 3.23.29-ipl4mdk
- MySQL-devel depends on MySQL-shared, not MySQL-client
- Syntax error in mysql_install_db fixed

* Sun Dec 24 2000 Alexander Bokovoy <ab@avilink.net> 3.23.29-ipl3mdk
- Update to 3.23.29
- Rebuild with db3-3.2.3e

* Sun Dec 17 2000 Alexander Bokovoy <ab@avilink.net> 3.23.28-ipl2mdk
- Duplication of files in MySQL/MySQL-Client fixed
- mysql_config moved to MySQL-shared
- Various programs from MySQL package require DBI and DBD::mysql perl modules,
  dependencies fixed
- mysqlbug redirects bug reports to devel@linux.iplabs.ru mailing list
- MyISAM RAID type enabled by default

* Sat Dec 16 2000 Alexander Bokovoy <ab@avilink.net> 3.23.28-ipl1mdk
- Updated to 3.23.28
- SPEC file cleaned and uses now IPL rules
- Russian translations added
- Transactions support with BDB tables
- Bench package now requires perl-DBD-mysql instead of perl-Mysql
- Init script has new status command which displays pids of mysqld processes
- Various C++ fixes against g++ 2.96

* Tue Nov 16 2000 Mikhail Zabaluev <mookid@sigent.ru> 3.23.27-1mdk_mhz
- Updated to 3.23.27
- --with-extra-charsets=all, because we need Cyrillic
- made sure that readline is external
- macroized install-info
- mandrakized init script
- custom logrotate config to rotate *.err logs

* Sat Sep 02 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.23.23-1mdk
- Updated to 3.23.23 to correct php segfaults
- Added separate libmysql_r directory; now both a threaded
  and non-threaded library is shipped.

* Tue Aug 09 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.23.22-2mdk
- Put libmysqlclient.so in devel package

* Mon Aug 07 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.23.22-1mdk
- Updated to 3.23.22
  (this is a beta version, but starting from 3.23.19, the license is
   GPL, so we prefer the beta to the non-GPL stable tree)
- Macroize
- Merged with the spec from David Axmark <davida@mysql.com>
  :Added the support-files/my-example.cnf to the docs directory.
  :Removed devel dependency on base since it is about client
   development.
  :The --enable-assembler switch is now automatically disables on
   platforms there assembler code is unavailable. This should allow
   building this RPM on non i386 systems.

* Tue May 16 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 3.22.32-6mdk
- Recompile with egcs on alpha.

* Tue Apr 18 2000 Pixel <pixel@mandrakesoft.com> 3.22.32-5mdk
- disable starting of mysql while in install

* Thu Apr 06 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.22.32-4mdk
- fix bench perms

* Thu Apr 06 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.22.32-3mdk
- cleaned spec file

* Mon Apr 03 2000 Jean-Michel Dault <jmdault@mandrakesoft.com> 3.22.32-2mdk
- new group

* Mon Feb 27 2000 Jean-Michel Dault <jmdault@netrevolution.com> 3.22.32-1mdk
- updated to 3.22.32 - security updates

* Wed Jan 19 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- updated to 3.22.30

* Mon Jan  3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- final cleanup for Mandrake 7

* Mon Jan 3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- updated to 3.22.29

* Wed Dec 31 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- rebuilt for Mandrake 7.0

* Sat Dec 12 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- updated to 3.22.27

* Wed Sep 1 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- put the shared libs in separate package
- fixed dependancies

* Thu Aug 19 1999 Jean-Michel Dault <jmdault@netrevolution.com>
- added fr locale
- Mandrake adaptations
- Solaris adaptations

* Mon Feb 22 1999 David Axmark <david@detron.se>
- Removed unportable cc switches from the spec file. The defaults can
  now be overridden with environment variables. This feature is used
  to compile the official RPM with optimal (but compiler version
  specific) switches.
- Removed the repetitive description parts for the sub rpms. Maybe add
  again if RPM gets a multiline macro capability.
- Added support for a pt_BR translation. Translation contributed by
  Jorge Godoy <jorge@bestway.com.br>.

* Wed Nov 4 1998 David Axmark <david@detron.se>
- A lot of changes in all the rpm and install scripts. This may even
  be a working RPM :-)

* Sun Aug 16 1998 David Axmark <david@detron.se>
- A developers changelog for MySQL is available in the source RPM. And
  there is a history of major user visible changed in the Reference
  Manual.  Only RPM specific changes will be documented here.