1# Copyright (c) 2000, 2020, Oracle and/or its affiliates.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License, version 2.0,
5# as published by the Free Software Foundation.
6#
7# This program is also distributed with certain software (including
8# but not limited to OpenSSL) that is licensed under separate terms,
9# as designated in a particular file or component or in included license
10# documentation.  The authors of MySQL hereby grant you an additional
11# permission to link the program and your derivative works with the
12# separately licensed software that they have included with MySQL.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License, version 2.0, for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; see the file COPYING. If not, write to the
21# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
22# MA  02110-1301  USA.
23
24##############################################################################
25# Some common macro definitions
26##############################################################################
27
28# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
29# change these, has to be exactly as is.
30%global mysql_old_vendor        MySQL AB
31%global mysql_vendor_2          Sun Microsystems, Inc.
32%global mysql_vendor            Oracle and/or its affiliates
33
34%global mysql_version   @VERSION@
35
36%global mysqld_user     mysql
37%global mysqld_group    mysql
38%global mysqldatadir    /var/lib/mysql
39
40%global release         1
41
42
43#
44# Macros we use which are not available in all supported versions of RPM
45#
46# - defined/undefined are missing on RHEL4
47#
48%if %{expand:%{?defined:0}%{!?defined:1}}
49%define defined()       %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
50%endif
51%if %{expand:%{?undefined:0}%{!?undefined:1}}
52%define undefined()     %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
53%endif
54
55# ----------------------------------------------------------------------------
56# RPM build tools now automatically detect Perl module dependencies.  This
57# detection causes problems as it is broken in some versions, and it also
58# provides unwanted dependencies from mandatory scripts in our package.
59# It might not be possible to disable this in all versions of RPM, but here we
60# try anyway.  We keep the "AutoReqProv: no" for the "test" sub package, as
61# disabling here might fail, and that package has the most problems.
62# See:
63#  http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides
64#  http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html
65# ----------------------------------------------------------------------------
66%undefine __perl_provides
67%undefine __perl_requires
68
69##############################################################################
70# Command line handling
71##############################################################################
72#
73# To set options:
74#
75#   $ rpmbuild --define="option <x>" ...
76#
77
78# ----------------------------------------------------------------------------
79# Commercial builds
80# ----------------------------------------------------------------------------
81%if %{undefined commercial}
82%define commercial 0
83%endif
84
85# ----------------------------------------------------------------------------
86# Source name
87# ----------------------------------------------------------------------------
88%if %{undefined src_base}
89%define src_base mysql
90%endif
91%define src_dir %{src_base}-%{mysql_version}
92
93# ----------------------------------------------------------------------------
94# Feature set (storage engines, options).  Default to community (everything)
95# ----------------------------------------------------------------------------
96%if %{undefined feature_set}
97%define feature_set community
98%endif
99
100# ----------------------------------------------------------------------------
101# Server comment strings
102# ----------------------------------------------------------------------------
103%if %{undefined compilation_comment_debug}
104%define compilation_comment_debug       MySQL Community Server - Debug (GPL)
105%endif
106%if %{undefined compilation_comment_release}
107%define compilation_comment_release     MySQL Community Server (GPL)
108%endif
109
110# ----------------------------------------------------------------------------
111# Product and server suffixes
112# ----------------------------------------------------------------------------
113%if %{undefined product_suffix}
114  %if %{defined short_product_tag}
115    %define product_suffix      -%{short_product_tag}
116  %else
117    %define product_suffix      %{nil}
118  %endif
119%endif
120
121%if %{undefined server_suffix}
122%define server_suffix   %{nil}
123%endif
124
125# ----------------------------------------------------------------------------
126# Distribution support
127# ----------------------------------------------------------------------------
128%if %{undefined distro_specific}
129%define distro_specific 0
130%endif
131%if %{distro_specific}
132  %if %(test -f /etc/enterprise-release && echo 1 || echo 0)
133    %define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
134    %if "%oelver" == "4"
135      %define distro_description        Oracle Enterprise Linux 4
136      %define distro_releasetag         oel4
137      %define distro_buildreq           gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel
138      %define distro_requires           chkconfig coreutils grep procps shadow-utils net-tools
139    %else
140      %if "%oelver" == "5"
141        %define distro_description      Oracle Enterprise Linux 5
142        %define distro_releasetag       oel5
143        %define distro_buildreq         gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel
144        %define distro_requires         chkconfig coreutils grep procps shadow-utils net-tools
145      %else
146        %{error:Oracle Enterprise Linux %{oelver} is unsupported}
147      %endif
148    %endif
149  %else
150    %if %(test -f /etc/oracle-release && echo 1 || echo 0)
151      %define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
152      %if "%elver" == "6" || "%elver" == "7"
153        %define distro_description      Oracle Linux %elver
154        %define distro_releasetag       el%elver
155        %define distro_buildreq         gcc-c++ ncurses-devel perl perl(Data::Dumper) time zlib-devel cmake libaio-devel numactl-devel
156        %define distro_requires         chkconfig coreutils grep perl(Data::Dumper) procps shadow-utils net-tools
157      %else
158        %{error:Oracle Linux %{elver} is unsupported}
159      %endif
160    %else
161      %if %(test -f /etc/redhat-release && echo 1 || echo 0)
162        %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
163        %if "%rhelver" == "4"
164          %define distro_description      Red Hat Enterprise Linux 4
165          %define distro_releasetag       rhel4
166          %define distro_buildreq         gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel
167          %define distro_requires         chkconfig coreutils grep procps shadow-utils net-tools
168        %else
169          %if "%rhelver" == "5"
170            %define distro_description    Red Hat Enterprise Linux 5
171            %define distro_releasetag     rhel5
172            %define distro_buildreq       gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel
173            %define distro_requires       chkconfig coreutils grep procps shadow-utils net-tools
174          %else
175            %if "%rhelver" == "6"
176              %define distro_description    Red Hat Enterprise Linux 6
177              %define distro_releasetag     rhel6
178              %define distro_buildreq       gcc-c++ ncurses-devel perl perl(Data::Dumper) time zlib-devel cmake libaio-devel numactl-devel
179              %define distro_requires       chkconfig coreutils grep perl(Data::Dumper) procps shadow-utils net-tools
180            %else
181              %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
182            %endif
183          %endif
184        %endif
185      %else
186        %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
187          %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1)
188          %if "%susever" == "10"
189            %define distro_description    SUSE Linux Enterprise Server 10
190            %define distro_releasetag     sles10
191            %define distro_buildreq       gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client zlib-devel cmake libaio-devel
192            %define distro_requires       aaa_base coreutils grep procps pwdutils
193          %else
194            %if "%susever" == "11"
195              %define distro_description  SUSE Linux Enterprise Server 11
196              %define distro_releasetag   sles11
197              %define distro_buildreq     gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils zlib-devel cmake libaio-devel libnuma-devel
198              %define distro_requires     aaa_base coreutils grep procps pwdutils
199            %else
200              %{error:SuSE %{susever} is unsupported}
201            %endif
202          %endif
203        %else
204          %{error:Unsupported distribution}
205        %endif
206      %endif
207    %endif
208  %endif
209%else
210  %define glibc_version %(/lib/libc.so.6 | grep stable | cut -d, -f1 | cut -c38-)
211  %define distro_description            Generic Linux (glibc %{glibc_version})
212  %define distro_releasetag             linux_glibc%{glibc_version}
213  %define distro_buildreq               gcc-c++ gperf ncurses-devel perl perl(Data::Dumper) time zlib-devel
214  %define distro_requires               coreutils grep perl(Data::Dumper) procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
215%endif
216
217# Avoid debuginfo RPMs, leaves binaries unstripped
218%define debug_package   %{nil}
219
220# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
221# test for __debug_package
222%define __strip         /bin/true
223
224##############################################################################
225# Configuration based upon above user input, not to be set directly
226##############################################################################
227
228%define license_files_server    %{src_dir}/LICENSE %{src_dir}/README
229%if 0%{?commercial}
230%define license_type            Commercial
231%else
232%define license_type            GPL
233%endif
234
235##############################################################################
236# Main spec file section
237##############################################################################
238
239Name:           MySQL%{product_suffix}
240Summary:        MySQL: a very fast and reliable SQL database server
241Group:          Applications/Databases
242Version:        @MYSQL_RPM_VERSION@
243Release:        %{release}%{?distro_releasetag:.%{distro_releasetag}}
244Distribution:   %{distro_description}
245License:        Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field.
246Source:         http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
247URL:            http://www.mysql.com/
248Packager:       MySQL Release Engineering <mysql-build@oss.oracle.com>
249Vendor:         %{mysql_vendor}
250BuildRequires:  %{distro_buildreq}
251
252# Regression tests may take a long time, override the default to skip them
253%{!?runselftest:%global runselftest 1}
254
255# Think about what you use here since the first step is to
256# run a rm -rf
257BuildRoot:    %{_tmppath}/%{name}-%{version}-build
258
259# From the manual
260%description
261The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
262and robust SQL (Structured Query Language) database server. MySQL Server
263is intended for mission-critical, heavy-load production systems as well
264as for embedding into mass-deployed software. MySQL is a trademark of
265%{mysql_vendor}
266
267The MySQL software has Dual Licensing, which means you can use the MySQL
268software free of charge under the GNU General Public License
269(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
270licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
271the GPL. See the chapter "Licensing and Support" in the manual for
272further info.
273
274The MySQL web site (http://www.mysql.com/) provides the latest
275news and information about the MySQL software. Also please see the
276documentation and the manual for more information.
277
278##############################################################################
279# Sub package definition
280##############################################################################
281
282%package -n MySQL-server%{product_suffix}
283Summary:        MySQL: a very fast and reliable SQL database server
284Group:          Applications/Databases
285Requires:       %{distro_requires}
286%if 0%{?commercial}
287Obsoletes:      MySQL-server
288%else
289Obsoletes:      MySQL-server-advanced
290%endif
291Obsoletes:      mysql-server < %{version}-%{release}
292Obsoletes:      mysql-server-advanced
293Obsoletes:      MySQL-server-classic MySQL-server-community MySQL-server-enterprise
294Obsoletes:      MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
295Provides:       mysql-server = %{version}-%{release}
296Provides:       mysql-server%{?_isa} = %{version}-%{release}
297
298%description -n MySQL-server%{product_suffix}
299The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
300and robust SQL (Structured Query Language) database server. MySQL Server
301is intended for mission-critical, heavy-load production systems as well
302as for embedding into mass-deployed software. MySQL is a trademark of
303%{mysql_vendor}
304
305The MySQL software has Dual Licensing, which means you can use the MySQL
306software free of charge under the GNU General Public License
307(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
308licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
309the GPL. See the chapter "Licensing and Support" in the manual for
310further info.
311
312The MySQL web site (http://www.mysql.com/) provides the latest news and
313information about the MySQL software.  Also please see the documentation
314and the manual for more information.
315
316This package includes the MySQL server binary as well as related utilities
317to run and administer a MySQL server.
318
319If you want to access and work with the database, you have to install
320package "MySQL-client%{product_suffix}" as well!
321
322# ----------------------------------------------------------------------------
323%package -n MySQL-client%{product_suffix}
324Summary:        MySQL - Client
325Group:          Applications/Databases
326%if 0%{?commercial}
327Obsoletes:      MySQL-client
328%else
329Obsoletes:      MySQL-client-advanced
330%endif
331Obsoletes:      mysql < %{version}-%{release}
332Obsoletes:      mysql-advanced < %{version}-%{release}
333Obsoletes:      MySQL-client-classic MySQL-client-community MySQL-client-enterprise
334Obsoletes:      MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
335Provides:       mysql = %{version}-%{release}
336Provides:       mysql%{?_isa} = %{version}-%{release}
337
338%description -n MySQL-client%{product_suffix}
339This package contains the standard MySQL clients and administration tools.
340
341For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
342
343# ----------------------------------------------------------------------------
344%package -n MySQL-test%{product_suffix}
345Summary:        MySQL - Test suite
346Group:          Applications/Databases
347%if 0%{?commercial}
348Requires:       MySQL-client-advanced perl
349Obsoletes:      MySQL-test
350%else
351Requires:       MySQL-client perl
352Obsoletes:      MySQL-test-advanced
353%endif
354Obsoletes:      mysql-test < %{version}-%{release}
355Obsoletes:      mysql-test-advanced
356Obsoletes:      MySQL-test-classic MySQL-test-community MySQL-test-enterprise
357Obsoletes:      MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
358Provides:       mysql-test = %{version}-%{release}
359Provides:       mysql-test%{?_isa} = %{version}-%{release}
360Requires:       perl(Data::Dumper)
361AutoReqProv:    no
362
363%description -n MySQL-test%{product_suffix}
364This package contains the MySQL regression test suite.
365
366For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
367
368# ----------------------------------------------------------------------------
369%package -n MySQL-devel%{product_suffix}
370Summary:        MySQL - Development header files and libraries
371Group:          Applications/Databases
372%if 0%{?commercial}
373Obsoletes:      MySQL-devel
374%else
375Obsoletes:      MySQL-devel-advanced
376%endif
377Obsoletes:      mysql-devel < %{version}-%{release}
378Obsoletes:      mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
379Obsoletes:      MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
380Obsoletes:      MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
381Provides:       mysql-devel = %{version}-%{release}
382Provides:       mysql-devel%{?_isa} = %{version}-%{release}
383
384%description -n MySQL-devel%{product_suffix}
385This package contains the development header files and libraries necessary
386to develop MySQL client applications.
387
388For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
389
390# ----------------------------------------------------------------------------
391%package -n MySQL-shared%{product_suffix}
392Summary:        MySQL - Shared libraries
393Group:          Applications/Databases
394%if 0%{?commercial}
395Obsoletes:      MySQL-shared
396%else
397Obsoletes:      MySQL-shared-advanced
398%endif
399Obsoletes:      MySQL-shared-standard MySQL-shared-pro
400Obsoletes:      MySQL-shared-pro-cert MySQL-shared-pro-gpl
401Obsoletes:      MySQL-shared-pro-gpl-cert
402Obsoletes:      MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
403Obsoletes:      MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
404
405%description -n MySQL-shared%{product_suffix}
406This package contains the shared libraries (*.so*) which certain languages
407and applications need to dynamically load and use MySQL.
408
409# ----------------------------------------------------------------------------
410%package -n MySQL-embedded%{product_suffix}
411Summary:        MySQL - Embedded library
412Group:          Applications/Databases
413%if 0%{?commercial}
414Requires:       MySQL-devel-advanced
415Obsoletes:      MySQL-embedded
416%else
417Requires:       MySQL-devel
418Obsoletes:      MySQL-embedded-advanced
419%endif
420Obsoletes:      mysql-embedded < %{version}-%{release}
421Obsoletes:      mysql-embedded-advanced
422Obsoletes:      MySQL-embedded-pro
423Obsoletes:      MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
424Obsoletes:      MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
425Provides:       mysql-embedded = %{version}-%{release}
426Provides:       mysql-embedded%{?_isa} = %{version}-%{release}
427
428%description -n MySQL-embedded%{product_suffix}
429This package contains the MySQL server as an embedded library.
430
431The embedded MySQL server library makes it possible to run a full-featured
432MySQL server inside the client application. The main benefits are increased
433speed and more simple management for embedded applications.
434
435The API is identical for the embedded MySQL version and the
436client/server version.
437
438For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
439
440##############################################################################
441%prep
442%setup -T -a 0 -c -n %{src_dir}
443##############################################################################
444%build
445
446# Fail quickly and obviously if user tries to build as root
447%if %runselftest
448    if [ x"`id -u`" = x0 ]; then
449        echo "The MySQL regression tests may fail if run as root."
450        echo "If you really need to build the RPM as root, use"
451        echo "--define='runselftest 0' to skip the regression tests."
452        exit 1
453    fi
454%endif
455
456# Be strict about variables, bail at earliest opportunity, etc.
457set -eu
458
459# Optional package files
460touch optional-files-devel
461
462#
463# Set environment in order of preference, MYSQL_BUILD_* first, then variable
464# name, finally a default.  RPM_OPT_FLAGS is assumed to be a part of the
465# default RPM build environment.
466#
467
468# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
469# the compile in cmd-line-utils/libedit - needs investigation, but for now
470# we simply unset it and use those specified directly in cmake.
471%if "%{_arch}" == "ia64"
472RPM_OPT_FLAGS=
473%endif
474
475export PATH=${MYSQL_BUILD_PATH:-$PATH}
476export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
477export CXX=${MYSQL_BUILD_CXX:-${CXX:-g++}}
478export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
479export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors}}
480export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}}
481export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}}
482export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-}
483
484# By default, a build will include the system library for SSL.
485# However, there may be a need to override.
486# Protect against undefined variables if there is no override option.
487%if %{undefined with_ssl}
488%define ssl_option   %{nil}
489%else
490%define ssl_option   -DWITH_SSL=%{with_ssl}
491%endif
492
493# Build debug mysqld and libmysqld.a
494mkdir debug
495(
496  cd debug
497  # Attempt to remove any optimisation flags from the debug build
498  CFLAGS=`echo " ${CFLAGS} " | \
499            sed -e 's/ -O[0-9]* / /' \
500                -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \
501                -e 's/ -unroll2 / /' \
502                -e 's/ -ip / /' \
503                -e 's/^ //' \
504                -e 's/ $//'`
505  CXXFLAGS=`echo " ${CXXFLAGS} " | \
506              sed -e 's/ -O[0-9]* / /' \
507                  -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \
508                  -e 's/ -unroll2 / /' \
509                  -e 's/ -ip / /' \
510                  -e 's/^ //' \
511                  -e 's/ $//'`
512  # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
513  # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
514  ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
515           -DCMAKE_BUILD_TYPE=Debug \
516           -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
517           -DFEATURE_SET="%{feature_set}" \
518           %{ssl_option} \
519           -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
520           -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
521  echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
522  make ${MAKE_JFLAG} VERBOSE=1
523)
524# Build full release
525mkdir release
526(
527  cd release
528  # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
529  # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
530  ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
531           -DCMAKE_BUILD_TYPE=RelWithDebInfo \
532           -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
533           -DFEATURE_SET="%{feature_set}" \
534           %{ssl_option} \
535           -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
536           -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
537  echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
538  make ${MAKE_JFLAG} VERBOSE=1
539)
540
541%if %runselftest
542  MTR_BUILD_THREAD=auto
543  export MTR_BUILD_THREAD
544
545  (cd release && make test-bt-fast || true)
546%endif
547
548##############################################################################
549%install
550
551RBR=$RPM_BUILD_ROOT
552MBD=$RPM_BUILD_DIR/%{src_dir}
553
554# Ensure that needed directories exists
555install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
556install -d $RBR%{mysqldatadir}/mysql
557install -d $RBR%{_datadir}/mysql-test
558install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
559install -d $RBR%{_includedir}
560install -d $RBR%{_libdir}
561install -d $RBR%{_mandir}
562install -d $RBR%{_sbindir}
563install -d $RBR/var/lib/mysql-files
564
565mkdir -p $RBR%{_sysconfdir}/my.cnf.d
566
567# Install all binaries
568(
569  cd $MBD/release
570  make DESTDIR=$RBR install
571)
572
573# FIXME: at some point we should stop doing this and just install everything
574# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
575# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
576mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/
577
578# Install logrotate and autostart
579install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
580install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
581
582# Create a symlink "rcmysql", pointing to the init.script. SuSE users
583# will appreciate that, as all services usually offer this.
584ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql
585
586# Touch the place where the my.cnf config file might be located
587# Just to make sure it's in the file list and marked as a config file
588touch $RBR%{_sysconfdir}/my.cnf
589
590# Install SELinux files in datadir
591install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \
592  $RBR%{_datadir}/mysql/SELinux/RHEL4
593
594# Remove man pages we explicitly do not want to package, avoids 'unpackaged
595# files' warning.
596# This has become obsolete:  rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
597
598##############################################################################
599#  Post processing actions, i.e. when installed
600##############################################################################
601
602%pre -n MySQL-server%{product_suffix}
603# This is the code running at the beginning of a RPM upgrade action,
604# before replacing the old files with the new ones.
605
606# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
607
608# There are users who deviate from the default file system layout.
609# Check local settings to support them.
610if [ -x %{_bindir}/my_print_defaults ]
611then
612  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
613  PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
614fi
615if [ -z "$mysql_datadir" ]
616then
617  mysql_datadir=%{mysqldatadir}
618fi
619if [ -z "$PID_FILE_PATT" ]
620then
621  PID_FILE_PATT="$mysql_datadir/*.pid"
622fi
623
624# Check if we can safely upgrade.  An upgrade is only safe if it's from one
625# of our RPMs in the same version family.
626
627# Handle both ways of spelling the capability.
628installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
629if [ $? -ne 0 -o -z "$installed" ]; then
630  installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
631fi
632if [ $? -eq 0 -a -n "$installed" ]; then
633  installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
634  vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
635  version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
636  myoldvendor='%{mysql_old_vendor}'
637  myvendor_2='%{mysql_vendor_2}'
638  myvendor='%{mysql_vendor}'
639  myversion='%{mysql_version}'
640
641  old_family=`echo $version \
642    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
643  new_family=`echo $myversion \
644    | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
645
646  [ -z "$vendor" ] && vendor='<unknown>'
647  [ -z "$old_family" ] && old_family="<unrecognized version $version>"
648  [ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
649
650  error_text=
651  if [ "$vendor" != "$myoldvendor" \
652    -a "$vendor" != "$myvendor_2" \
653    -a "$vendor" != "$myvendor" ]; then
654    error_text="$error_text
655The current MySQL server package is provided by a different
656vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor.
657Some files may be installed to different locations, including log
658files and the service startup script in %{_sysconfdir}/init.d/.
659"
660  fi
661
662  if [ "$old_family" != "$new_family" ]; then
663    error_text="$error_text
664Upgrading directly from MySQL $old_family to MySQL $new_family may not
665be safe in all cases.  A manual dump and restore using mysqldump is
666recommended.  It is important to review the MySQL manual's Upgrading
667section for version-specific incompatibilities.
668"
669  fi
670
671  if [ -n "$error_text" ]; then
672    cat <<HERE >&2
673
674******************************************************************
675A MySQL server package ($installed) is installed.
676$error_text
677A manual upgrade is required.
678
679- Ensure that you have a complete, working backup of your data and my.cnf
680  files
681- Shut down the MySQL server cleanly
682- Remove the existing MySQL packages.  Usually this command will
683  list the packages you should remove:
684  rpm -qa | grep -i '^mysql-'
685
686  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
687  the package which contains the perconaserverclient shared library.  The
688  library will be reinstalled by the MySQL-shared-compat package.
689- Install the new MySQL packages supplied by $myvendor
690- Ensure that the MySQL server is started
691- Run the 'mysql_upgrade' program
692
693This is a brief description of the upgrade process.  Important details
694can be found in the MySQL manual, in the Upgrading section.
695******************************************************************
696HERE
697    exit 1
698  fi
699fi
700
701# We assume that if there is exactly one ".pid" file,
702# it contains the valid PID of a running MySQL server.
703NR_PID_FILES=`ls -1 $PID_FILE_PATT 2>/dev/null | wc -l`
704case $NR_PID_FILES in
705	0 ) SERVER_TO_START=''  ;;  # No "*.pid" file == no running server
706	1 ) SERVER_TO_START='true' ;;
707	* ) SERVER_TO_START=''      # Situation not clear
708	    SEVERAL_PID_FILES=true ;;
709esac
710# That logic may be debated: We might check whether it is non-empty,
711# contains exactly one number (possibly a PID), and whether "ps" finds it.
712# OTOH, if there is no such process, it means a crash without a cleanup -
713# is that a reason not to start a new server after upgrade?
714
715STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
716
717if [ -f "$STATUS_FILE" ]; then
718	echo "Some previous upgrade was not finished:"
719	ls -ld $STATUS_FILE
720	echo "Please check its status, then do"
721	echo "    rm $STATUS_FILE"
722	echo "before repeating the MySQL upgrade."
723	exit 1
724elif [ -n "$SEVERAL_PID_FILES" ] ; then
725	echo "You have more than one PID file:"
726	ls -ld $PID_FILE_PATT
727	echo "Please check which one (if any) corresponds to a running server"
728	echo "and delete all others before repeating the MySQL upgrade."
729	exit 1
730fi
731
732NEW_VERSION=%{mysql_version}-%{release}
733
734# The "pre" section code is also run on a first installation,
735# when there  is no data directory yet. Protect against error messages.
736# Check for the existence of subdirectory "mysql/", the database of system
737# tables like "mysql.user".
738if [ -d $mysql_datadir/mysql ] ; then
739        echo "MySQL RPM upgrade to version $NEW_VERSION"  > $STATUS_FILE
740        echo "'pre' step running at `date`"          >> $STATUS_FILE
741        echo                                         >> $STATUS_FILE
742        fcount=`ls -ltr $mysql_datadir/*.err 2>/dev/null | wc -l`
743        if [ $fcount -gt 0 ] ; then
744             echo "ERR file(s):"                          >> $STATUS_FILE
745             ls -ltr $mysql_datadir/*.err                 >> $STATUS_FILE
746             echo                                         >> $STATUS_FILE
747             echo "Latest 'Version' line in latest file:" >> $STATUS_FILE
748             grep '^Version' `ls -tr $mysql_datadir/*.err | tail -1` | \
749                tail -1                              >> $STATUS_FILE
750             echo                                         >> $STATUS_FILE
751        fi
752
753	if [ -n "$SERVER_TO_START" ] ; then
754		# There is only one PID file, race possibility ignored
755		echo "PID file:"                           >> $STATUS_FILE
756		ls -l   $PID_FILE_PATT                     >> $STATUS_FILE
757		cat     $PID_FILE_PATT                     >> $STATUS_FILE
758		echo                                       >> $STATUS_FILE
759		echo "Server process:"                     >> $STATUS_FILE
760		ps -fp `cat $PID_FILE_PATT`                >> $STATUS_FILE
761		echo                                       >> $STATUS_FILE
762		echo "SERVER_TO_START=$SERVER_TO_START"    >> $STATUS_FILE
763	else
764		# Take a note we checked it ...
765		echo "PID file:"                           >> $STATUS_FILE
766		ls -l   $PID_FILE_PATT                     >> $STATUS_FILE 2>&1
767	fi
768fi
769
770# Shut down a previously installed server first
771# Note we *could* make that depend on $SERVER_TO_START, but we rather don't,
772# so a "stop" is attempted even if there is no PID file.
773# (Maybe the "stop" doesn't work then, but we might fix that in itself.)
774if [ -x %{_sysconfdir}/init.d/mysql ] ; then
775        %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
776        echo "Giving mysqld 5 seconds to exit nicely"
777        sleep 5
778fi
779
780%post -n MySQL-server%{product_suffix}
781# This is the code running at the end of a RPM install or upgrade action,
782# after the (new) files have been written.
783
784# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
785
786# There are users who deviate from the default file system layout.
787# Check local settings to support them.
788if [ -x %{_bindir}/my_print_defaults ]
789then
790  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
791fi
792if [ -z "$mysql_datadir" ]
793then
794  mysql_datadir=%{mysqldatadir}
795fi
796
797NEW_VERSION=%{mysql_version}-%{release}
798STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
799
800# ----------------------------------------------------------------------
801# Create data directory if needed, check whether upgrade or install
802# ----------------------------------------------------------------------
803if [ ! -d "$mysql_datadir" ] ; then mkdir -m 755 "$mysql_datadir" ; fi
804if [ -f "$STATUS_FILE" ] ; then
805	SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
806else
807	SERVER_TO_START=''
808fi
809# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
810if [ ! -d $mysql_datadir/mysql ] ; then
811	mkdir $mysql_datadir/mysql $mysql_datadir/test
812	echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
813else
814	# If the directory exists, we may assume it is an upgrade.
815	echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
816fi
817
818# ----------------------------------------------------------------------
819# Make MySQL start/shutdown automatically when the machine does it.
820# ----------------------------------------------------------------------
821# NOTE: This still needs to be debated. Should we check whether these links
822# for the other run levels exist(ed) before the upgrade?
823# use chkconfig on Enterprise Linux and newer SuSE releases
824if [ -x /sbin/chkconfig ] ; then
825        /sbin/chkconfig --add mysql
826# use insserv for older SuSE Linux versions
827elif [ -x /sbin/insserv ] ; then
828        /sbin/insserv %{_sysconfdir}/init.d/mysql
829fi
830
831# ----------------------------------------------------------------------
832# Create a MySQL user and group. Do not report any problems if it already
833# exists.
834# ----------------------------------------------------------------------
835groupadd -r %{mysqld_group} 2> /dev/null || true
836useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" \
837  -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
838# The user may already exist, make sure it has the proper group nevertheless
839# (BUG#12823)
840usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
841
842# ----------------------------------------------------------------------
843# Change permissions so that the user that will run the MySQL daemon
844# owns all database files.
845# ----------------------------------------------------------------------
846chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
847
848# ----------------------------------------------------------------------
849# Initiate databases if needed
850# ----------------------------------------------------------------------
851if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
852	# Fix bug#45415: no "mysql_install_db" on an upgrade
853	# Do this as a negative to err towards more "install" runs
854	# rather than to miss one.
855	%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user} --random-passwords
856
857	# Attention: Now 'root' is the only database user,
858	# its password is a random value found in ~/.mysql_secret,
859	# and the "password expired" flag is set:
860	# Any client needs that password, and the first command
861	# executed must be a new "set password"!
862fi
863
864# ----------------------------------------------------------------------
865# Upgrade databases if needed would go here - but it cannot be automated yet
866# ----------------------------------------------------------------------
867
868# ----------------------------------------------------------------------
869# Change permissions again to fix any new files.
870# ----------------------------------------------------------------------
871chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
872
873# ----------------------------------------------------------------------
874# Fix permissions for the permission database so that only the user
875# can read them.
876# ----------------------------------------------------------------------
877chmod -R og-rw $mysql_datadir/mysql
878
879# ----------------------------------------------------------------------
880# install SELinux files - but don't override existing ones
881# ----------------------------------------------------------------------
882SETARGETDIR=/etc/selinux/targeted/src/policy
883SEDOMPROG=$SETARGETDIR/domains/program
884SECONPROG=$SETARGETDIR/file_contexts/program
885if [ -f /etc/redhat-release ] \
886 && (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \
887 || grep -q "CentOS release 4" /etc/redhat-release) ; then
888  echo
889  echo
890  echo 'Notes regarding SELinux on this platform:'
891  echo '========================================='
892  echo
893  echo 'The default policy might cause server startup to fail because it is'
894  echo 'not allowed to access critical files.  In this case, please update'
895  echo 'your installation.'
896  echo
897  echo 'The default policy might also cause inavailability of SSL related'
898  echo 'features because the server is not allowed to access /dev/random'
899  echo 'and /dev/urandom. If this is a problem, please do the following:'
900  echo
901  echo '  1) install selinux-policy-targeted-sources from your OS vendor'
902  echo '  2) add the following two lines to '$SEDOMPROG/mysqld.te':'
903  echo '       allow mysqld_t random_device_t:chr_file read;'
904  echo '       allow mysqld_t urandom_device_t:chr_file read;'
905  echo '  3) cd to '$SETARGETDIR' and issue the following command:'
906  echo '       make load'
907  echo
908  echo
909fi
910
911if [ -x sbin/restorecon ] ; then
912  sbin/restorecon -R var/lib/mysql
913fi
914
915# Was the server running before the upgrade? If so, restart the new one.
916if [ "$SERVER_TO_START" = "true" ] ; then
917	# Restart in the same way that mysqld will be started normally.
918	if [ -x %{_sysconfdir}/init.d/mysql ] ; then
919		%{_sysconfdir}/init.d/mysql start
920		echo "Giving mysqld 5 seconds to start"
921		sleep 5
922	fi
923fi
924
925# Collect an upgrade history ...
926echo "Upgrade/install finished at `date`"        >> $STATUS_FILE
927echo                                             >> $STATUS_FILE
928echo "====="                                     >> $STATUS_FILE
929STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
930cat $STATUS_FILE >> $STATUS_HISTORY
931mv -f  $STATUS_FILE ${STATUS_FILE}-LAST  # for "triggerpostun"
932
933
934#echo "Thank you for installing the MySQL Community Server! For Production
935#systems, we recommend MySQL Enterprise, which contains enterprise-ready
936#software, intelligent advisory services, and full production support with
937#scheduled service packs and more.  Visit www.mysql.com/enterprise for more
938#information."
939
940%preun -n MySQL-server%{product_suffix}
941
942# Which '$1' does this refer to?  Fedora docs have info:
943# " ... a count of the number of versions of the package that are installed.
944#   Action                           Count
945#   Install the first time           1
946#   Upgrade                          2 or higher (depending on the number of versions installed)
947#   Remove last version of package   0 "
948#
949#  http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
950
951if [ $1 = 0 ] ; then
952        # Stop MySQL before uninstalling it
953        if [ -x %{_sysconfdir}/init.d/mysql ] ; then
954                %{_sysconfdir}/init.d/mysql stop > /dev/null
955                # Remove autostart of MySQL
956                # use chkconfig on Enterprise Linux and newer SuSE releases
957                if [ -x /sbin/chkconfig ] ; then
958                        /sbin/chkconfig --del mysql
959                # For older SuSE Linux versions
960                elif [ -x /sbin/insserv ] ; then
961                        /sbin/insserv -r %{_sysconfdir}/init.d/mysql
962                fi
963        fi
964fi
965
966# We do not remove the mysql user since it may still own a lot of
967# database files.
968
969%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community
970
971# Setup: We renamed this package, so any existing "server-community"
972#   package will be removed when this "server" is installed.
973# Problem: RPM will first run the "pre" and "post" sections of this script,
974#   and only then the "preun" of that old community server.
975#   But this "preun" includes stopping the server and uninstalling the service,
976#   "chkconfig --del mysql" which removes the symlinks to the start script.
977# Solution: *After* the community server got removed, restart this server
978#   and re-install the service.
979#
980# For information about triggers in spec files, see the Fedora docs:
981#   http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
982# For all details of this code, see the "pre" and "post" sections.
983
984# There are users who deviate from the default file system layout.
985# Check local settings to support them.
986if [ -x %{_bindir}/my_print_defaults ]
987then
988  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | tail -1 | sed -n 's/--datadir=//p'`
989fi
990if [ -z "$mysql_datadir" ]
991then
992  mysql_datadir=%{mysqldatadir}
993fi
994
995NEW_VERSION=%{mysql_version}-%{release}
996STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST  # Note the difference!
997STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
998
999if [ -f "$STATUS_FILE" ] ; then
1000	SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
1001else
1002	# This should never happen, but let's be prepared
1003	SERVER_TO_START=''
1004fi
1005echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
1006
1007if [ -x /sbin/chkconfig ] ; then
1008        /sbin/chkconfig --add mysql
1009# use insserv for older SuSE Linux versions
1010elif [ -x /sbin/insserv ] ; then
1011        /sbin/insserv %{_sysconfdir}/init.d/mysql
1012fi
1013
1014# Was the server running before the upgrade? If so, restart the new one.
1015if [ "$SERVER_TO_START" = "true" ] ; then
1016	# Restart in the same way that mysqld will be started normally.
1017	if [ -x %{_sysconfdir}/init.d/mysql ] ; then
1018		%{_sysconfdir}/init.d/mysql start
1019		echo "Giving mysqld 5 seconds to start"
1020		sleep 5
1021	fi
1022fi
1023
1024echo "Trigger 'postun --community' finished at `date`"        >> $STATUS_HISTORY
1025echo                                             >> $STATUS_HISTORY
1026echo "====="                                     >> $STATUS_HISTORY
1027
1028
1029# ----------------------------------------------------------------------
1030# Clean up the BuildRoot after build is done
1031# ----------------------------------------------------------------------
1032%clean
1033[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
1034  && rm -rf $RPM_BUILD_ROOT;
1035
1036##############################################################################
1037#  Files section
1038##############################################################################
1039
1040%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
1041%defattr(-,root,root,0755)
1042%if %{defined license_files_server}
1043%doc %{license_files_server}
1044%endif
1045%doc %{src_dir}/Docs/ChangeLog
1046%doc %{src_dir}/Docs/INFO_SRC*
1047%doc release/Docs/INFO_BIN*
1048%doc release/support-files/my-default.cnf
1049
1050%if 0%{?commercial}
1051%doc %attr(644, root, root) %{_infodir}/mysql.info*
1052%endif
1053
1054%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
1055%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
1056%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
1057%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
1058%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1*
1059%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1*
1060%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1*
1061%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1*
1062%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8*
1063%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
1064%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
1065%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
1066%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
1067%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
1068%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
1069%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
1070%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
1071%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
1072%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1*
1073%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1*
1074%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
1075%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
1076%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
1077%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
1078%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
1079%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
1080%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
1081
1082%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
1083%dir %{_sysconfdir}/my.cnf.d
1084
1085%attr(755, root, root) %{_bindir}/innochecksum
1086%attr(755, root, root) %{_bindir}/my_print_defaults
1087%attr(755, root, root) %{_bindir}/myisam_ftdump
1088%attr(755, root, root) %{_bindir}/myisamchk
1089%attr(755, root, root) %{_bindir}/myisamlog
1090%attr(755, root, root) %{_bindir}/myisampack
1091%attr(755, root, root) %{_bindir}/mysql_convert_table_format
1092%attr(755, root, root) %{_bindir}/mysql_fix_extensions
1093%attr(755, root, root) %{_bindir}/mysql_install_db
1094%attr(755, root, root) %{_bindir}/mysql_plugin
1095%attr(755, root, root) %{_bindir}/mysql_secure_installation
1096%attr(755, root, root) %{_bindir}/mysql_setpermission
1097%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
1098%attr(755, root, root) %{_bindir}/mysql_upgrade
1099%attr(755, root, root) %{_bindir}/mysql_zap
1100%attr(755, root, root) %{_bindir}/mysqlbug
1101%attr(755, root, root) %{_bindir}/mysqld_multi
1102%attr(755, root, root) %{_bindir}/mysqld_safe
1103%attr(755, root, root) %{_bindir}/mysqldumpslow
1104%attr(755, root, root) %{_bindir}/mysqlhotcopy
1105%attr(755, root, root) %{_bindir}/mysqltest
1106%attr(755, root, root) %{_bindir}/perror
1107%attr(755, root, root) %{_bindir}/replace
1108%attr(755, root, root) %{_bindir}/resolve_stack_dump
1109%attr(755, root, root) %{_bindir}/resolveip
1110
1111%attr(755, root, root) %{_sbindir}/mysqld
1112%attr(755, root, root) %{_sbindir}/mysqld-debug
1113%attr(755, root, root) %{_sbindir}/rcmysql
1114%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
1115
1116%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
1117%attr(755, root, root) %{_sysconfdir}/init.d/mysql
1118%attr(755, root, root) %{_datadir}/mysql/
1119%dir %attr(755, mysql, mysql) /var/lib/mysql
1120%dir %attr(750, mysql, mysql) /var/lib/mysql-files
1121
1122# ----------------------------------------------------------------------------
1123%files -n MySQL-client%{product_suffix}
1124%defattr(-, root, root, 0755)
1125%if %{defined license_files_server}
1126%doc %{license_files_server}
1127%endif
1128%attr(755, root, root) %{_bindir}/msql2mysql
1129%attr(755, root, root) %{_bindir}/mysql
1130%attr(755, root, root) %{_bindir}/mysql_find_rows
1131%attr(755, root, root) %{_bindir}/mysql_waitpid
1132%attr(755, root, root) %{_bindir}/mysqlaccess
1133# XXX: This should be moved to %{_sysconfdir}
1134%attr(644, root, root) %{_bindir}/mysqlaccess.conf
1135%attr(755, root, root) %{_bindir}/mysqladmin
1136%attr(755, root, root) %{_bindir}/mysqlbinlog
1137%attr(755, root, root) %{_bindir}/mysqlcheck
1138%attr(755, root, root) %{_bindir}/mysqldump
1139%attr(755, root, root) %{_bindir}/mysqlimport
1140%attr(755, root, root) %{_bindir}/mysqlshow
1141%attr(755, root, root) %{_bindir}/mysqlslap
1142%attr(755, root, root) %{_bindir}/mysql_config_editor
1143
1144%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
1145%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
1146%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
1147%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1*
1148%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
1149%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
1150%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
1151%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1*
1152%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1*
1153%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1*
1154%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
1155%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
1156%doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1*
1157
1158# ----------------------------------------------------------------------------
1159%files -n MySQL-devel%{product_suffix} -f optional-files-devel
1160%defattr(-, root, root, 0755)
1161%if %{defined license_files_server}
1162%doc %{license_files_server}
1163%endif
1164%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
1165%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
1166%attr(755, root, root) %{_bindir}/mysql_config
1167%dir %attr(755, root, root) %{_includedir}/mysql
1168%dir %attr(755, root, root) %{_libdir}/mysql
1169%{_includedir}/mysql/*
1170%{_datadir}/aclocal/mysql.m4
1171%{_libdir}/mysql/libperconaserverclient.a
1172%{_libdir}/mysql/libperconaserverclient_r.a
1173%{_libdir}/mysql/libmysqlservices.a
1174
1175# ----------------------------------------------------------------------------
1176%files -n MySQL-shared%{product_suffix}
1177%defattr(-, root, root, 0755)
1178%if %{defined license_files_server}
1179%doc %{license_files_server}
1180%endif
1181# Shared libraries (omit for architectures that don't support them)
1182%{_libdir}/libmysql*.so*
1183
1184%post -n MySQL-shared%{product_suffix}
1185/sbin/ldconfig
1186
1187%postun -n MySQL-shared%{product_suffix}
1188/sbin/ldconfig
1189
1190# ----------------------------------------------------------------------------
1191%files -n MySQL-test%{product_suffix}
1192%defattr(-, root, root, 0755)
1193%if %{defined license_files_server}
1194%doc %{license_files_server}
1195%endif
1196%attr(-, root, root) %{_datadir}/mysql-test
1197%attr(755, root, root) %{_bindir}/mysql_client_test
1198%attr(755, root, root) %{_bindir}/mysql_client_test_embedded
1199%attr(755, root, root) %{_bindir}/mysqltest_embedded
1200
1201# ----------------------------------------------------------------------------
1202%files -n MySQL-embedded%{product_suffix}
1203%defattr(-, root, root, 0755)
1204%if %{defined license_files_server}
1205%doc %{license_files_server}
1206%endif
1207%attr(755, root, root) %{_bindir}/mysql_embedded
1208%attr(644, root, root) %{_libdir}/mysql/libmysqld.a
1209%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a
1210
1211##############################################################################
1212# The spec file changelog only includes changes made to the spec file
1213# itself - note that they must be ordered by date (important when
1214# merging BK trees)
1215##############################################################################
1216%changelog
1217* Thu Sep 05 2019 Bjorn Munch <bjorn.munch@oracle.com>
1218- Add License Book, remove COPYING
1219
1220* Wed Jan 10 2018 Bjorn Munch <bjorn.munch@oracle.com>
1221- No longer need to remove obsoleted mysqltest man pages
1222
1223* Tue Oct 31 2017 Bjorn Munch <bjorn.munch@oracle.com>
1224- Remove obsoleted mysqltest man pages
1225
1226* Mon Oct 06 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1227- Add license info in each subpackage
1228
1229* Wed May 28 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1230- Updated usergroup to mysql on datadir
1231
1232* Wed Oct 30 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1233- Removed non gpl file docs/mysql.info from community packages
1234
1235* Mon Sep 09 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1236- Updated logic to get the correct count of PID files
1237
1238* Fri Aug 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1239- Added provides lowercase mysql tags
1240
1241* Wed Jun 26 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com>
1242- Cleaned up spec file to resolve rpm dependencies.
1243
1244* Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1245
1246- Allow to override the default to use the bundled yaSSL by an option like
1247      --define="with_ssl /path/to/ssl"
1248
1249* Wed Oct 10 2012 Bjorn Munch <bjorn.munch@oracle.com>
1250
1251- Replace old my-*.cnf config file examples with template my-default.cnf
1252
1253* Fri Oct 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1254
1255- Let the installation use the new option "--random-passwords" of "mysql_install_db".
1256  (Bug# 12794345 Ensure root password)
1257- Fix an inconsistency: "new install" vs "upgrade" are told from the (non)existence
1258  of "$mysql_datadir/mysql" (holding table "mysql.user" and other system stuff).
1259
1260* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1261
1262- Add a macro "runselftest":
1263  if set to 1 (default), the test suite will be run during the RPM build;
1264  this can be oveeridden via the command line by adding
1265      --define "runselftest 0"
1266  Failures of the test suite will NOT make the RPM build fail!
1267
1268* Mon Jul 16 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1269
1270- Add the man page for the "mysql_config_editor".
1271
1272* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
1273
1274- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
1275
1276* Wed Feb 29 2012 Brajmohan Saxena <brajmohan.saxena@oracle.com>
1277
1278- Removal all traces of the readline library from mysql (BUG 13738013)
1279
1280* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1281
1282- Fix duplicate mentioning of "mysql_plugin" and its manual page,
1283  it is better to keep alphabetic order in the files list (merging!).
1284
1285* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1286
1287- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
1288  the RPMs of any configuration (of the current or the preceding release series)
1289  by the new ones. This is done by not using the implicitly generated capabilities
1290  (which include the configuration name) and relying on more generic ones which
1291  just list the function ("server", "client", ...).
1292  The implicit generation cannot be prevented, so all these capabilities must be
1293  explicitly listed in "Obsoletes:"
1294
1295* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
1296
1297- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6.  Due to
1298  changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
1299  this necessitated a move of the libmygcc.a installation to the install
1300  phase, which is probably where it belonged in the first place.
1301
1302* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1303
1304- "make_win_bin_dist" and its manual are dropped, cmake does it different.
1305
1306* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
1307
1308- Add mysql_plugin man page.
1309
1310* Tue Aug 30 2011 Tor Didriksen <tor.didriksen@oracle.com>
1311
1312- Set CXX=g++ by default to add a dependency on libgcc/libstdc++.
1313  Also, remove the use of the -fno-exceptions and -fno-rtti flags.
1314  TODO: update distro_buildreq/distro_requires
1315
1316* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1317
1318- Add the manual page for "mysql_plugin" to the server package.
1319
1320* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1321
1322- Null-upmerge the fix of bug#37165: This spec file is not affected.
1323- Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}".
1324
1325* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
1326
1327- Source plugin library files list from cmake-generated file.
1328
1329* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
1330
1331- Added the mysql_plugin client - enables or disables plugins.
1332
1333* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
1334
1335- Fix bug#12561297: Added the MySQL embedded binary
1336
1337* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1338
1339- Fix bug#45415: "rpm upgrade recreates test database"
1340  Let the creation of the "test" database happen only during a new installation,
1341  not in an RPM upgrade.
1342  This affects both the "mkdir" and the call of "mysql_install_db".
1343
1344* Wed Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1345
1346- Fix bug#56581: If an installation deviates from the default file locations
1347  ("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
1348  should still work, and use these locations.
1349  The problem was that the fix for bug#27072 did not check for local settings.
1350
1351* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1352
1353- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
1354
1355* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
1356
1357- EXCEPTIONS-CLIENT has been deleted, remove it from here too
1358- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
1359  a '-j' argument to make.
1360
1361* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
1362
1363- Added test authentication (WL#1054) plugin binaries
1364
1365* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
1366
1367- Added example external authentication (WL#1054) plugin binaries
1368
1369* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
1370
1371- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
1372  Reflect that in the "Obsoletes" specifications.
1373- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM.
1374- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade".
1375
1376* Tue Jun 15 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1377
1378- Change the behaviour on installation and upgrade:
1379  On installation, do not autostart the server.
1380  *Iff* the server was stopped before the upgrade is started, this is taken as a
1381  sign the administrator is handling that manually, and so the new server will
1382  not be started automatically at the end of the upgrade.
1383  The start/stop scripts will still be installed, so the server will be started
1384  on the next machine boot.
1385  This is the 5.5 version of fixing bug#27072 (RPM autostarting the server).
1386
1387* Tue Jun 1 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
1388
1389- Implement SELinux checks from distribution-specific spec file.
1390
1391* Wed May 12 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
1392
1393- Large number of changes to build using CMake
1394- Introduce distribution-specific RPMs
1395- Drop debuginfo, build all binaries with debug/symbols
1396- Remove __os_install_post, use native macro
1397- Remove _unpackaged_files_terminate_build, make it an error to have
1398  unpackaged files
1399- Remove cluster RPMs
1400
1401* Wed Mar 24 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1402
1403- Add "--with-perfschema" to the configure options.
1404
1405* Mon Mar 22 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1406
1407- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64",
1408  mask "rmdir" return code 1.
1409- Remove "ha_example.*" files from the list, they aren't built.
1410
1411* Wed Mar 17 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1412
1413- Fix a wrong path name in handling the debug plugins.
1414
1415* Wed Mar 10 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1416
1417- Take the result of the debug plugin build and put it into the optimized tree,
1418  so that it becomes part of the final installation;
1419  include the files in the packlist. Part of the fixes for bug#49022.
1420
1421* Mon Mar 01 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1422
1423- Set "Oracle and/or its affiliates" as the vendor and copyright owner,
1424  accept upgrading from packages showing MySQL or Sun as vendor.
1425
1426* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1427
1428- Formatting changes:
1429  Have a consistent structure of separator lines and of indentation
1430  (8 leading blanks => tab).
1431- Introduce the variable "src_dir".
1432- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence
1433  over "CC" ("CXX").
1434- Drop the old "with_static" argument analysis, this is not supported
1435  in 5.1 since ages.
1436- Introduce variables to control the handlers individually, as well
1437  as other options.
1438- Use the new "--with-plugin" notation for the table handlers.
1439- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql"
1440  was done back in 2002 already.
1441- Make "--with-zlib-dir=bundled" the default, add an option to disable it.
1442- Add missing manual pages to the file list.
1443- Improve the runtime check for "libgcc.a", protect it against being tried
1444  with the Intel compiler "icc".
1445
1446* Mon Jan 11 2010 Joerg Bruehe <joerg.bruehe@sun.com>
1447
1448- Change RPM file naming:
1449  - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
1450  - Release counts from 1, not 0.
1451
1452* Wed Dec 23 2009 Joerg Bruehe <joerg.bruehe@sun.com>
1453
1454- The "semisync" plugin file name has lost its introductory "lib",
1455  adapt the file lists for the subpackages.
1456  This is a part missing from the fix for bug#48351.
1457- Remove the "fix_privilege_tables" manual, it does not exist in 5.5
1458  (and likely, the whole script will go, too).
1459
1460* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
1461
1462- remove erroneous traces of the InnoDB plugin (that is 5.1 only).
1463
1464* Tue Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
1465
1466- Removed mysql_fix_privilege_tables
1467
1468* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
1469
1470- "mysqlmanager" got removed from version 5.4, all references deleted.
1471
1472* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
1473
1474- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
1475
1476* Thu Aug 27 2009 Joerg Bruehe <joerg.bruehe@sun.com>
1477
1478- This version does not contain the "Instance manager", "mysqlmanager":
1479  Remove it from the spec file so that packaging succeeds.
1480
1481* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
1482
1483- Add conditionals for bundled zlib and innodb plugin
1484
1485* Fri Aug 21 2009 Jonathan Perkin <jperkin@sun.com>
1486
1487- Install plugin libraries in appropriate packages.
1488- Disable libdaemon_example and ftexample plugins.
1489
1490* Thu Aug 20 2009 Jonathan Perkin <jperkin@sun.com>
1491
1492- Update variable used for mysql-test suite location to match source.
1493
1494* Fri Nov 07 2008 Joerg Bruehe <joerg@mysql.com>
1495
1496- Correct yesterday's fix, so that it also works for the last flag,
1497  and fix a wrong quoting: un-quoted quote marks must not be escaped.
1498
1499* Thu Nov 06 2008 Kent Boortz <kent.boortz@sun.com>
1500
1501- Removed "mysql_upgrade_shell"
1502- Removed some copy/paste between debug and normal build
1503
1504* Thu Nov 06 2008 Joerg Bruehe <joerg@mysql.com>
1505
1506- Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
1507  This should cover both gcc and icc flags.  Fixes bug#40546.
1508
1509* Fri Aug 29 2008 Kent Boortz <kent@mysql.com>
1510
1511- Removed the "Federated" storage engine option, and enabled in all
1512
1513* Tue Aug 26 2008 Joerg Bruehe <joerg@mysql.com>
1514
1515- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
1516  Some generated files aren't needed in RPMs:
1517  - the "sql-bench/" subdirectory
1518  Some files were missing:
1519  - /usr/share/aclocal/mysql.m4  ("devel" subpackage)
1520  - Manual "mysqlbug" ("server" subpackage)
1521  - Program "innochecksum" and its manual ("server" subpackage)
1522  - Manual "mysql_find_rows" ("client" subpackage)
1523  - Script "mysql_upgrade_shell" ("client" subpackage)
1524  - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
1525  - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
1526
1527* Mon Mar 31 2008 Kent Boortz <kent@mysql.com>
1528
1529- Made the "Federated" storage engine an option
1530- Made the "Cluster" storage engine and sub packages an option
1531
1532* Wed Mar 19 2008 Joerg Bruehe <joerg@mysql.com>
1533
1534- Add the man pages for "ndbd" and "ndb_mgmd".
1535
1536* Mon Feb 18 2008 Timothy Smith <tim@mysql.com>
1537
1538- Require a manual upgrade if the alread-installed mysql-server is
1539  from another vendor, or is of a different major version.
1540
1541* Wed May 02 2007 Joerg Bruehe <joerg@mysql.com>
1542
1543- "ndb_size.tmpl" is not needed any more,
1544  "man1/mysql_install_db.1" lacked the trailing '*'.
1545
1546* Sat Apr 07 2007 Kent Boortz <kent@mysql.com>
1547
1548- Removed man page for "mysql_create_system_tables"
1549
1550* Wed Mar 21 2007 Daniel Fischer <df@mysql.com>
1551
1552- Add debug server.
1553
1554* Mon Mar 19 2007 Daniel Fischer <df@mysql.com>
1555
1556- Remove Max RPMs; the server RPMs contain a mysqld compiled with all
1557  features that previously only were built into Max.
1558
1559* Fri Mar 02 2007 Joerg Bruehe <joerg@mysql.com>
1560
1561- Add several man pages for NDB which are now created.
1562
1563* Fri Jan 05 2007 Kent Boortz <kent@mysql.com>
1564
1565- Put back "libmygcc.a", found no real reason it was removed.
1566
1567- Add CFLAGS to gcc call with --print-libgcc-file, to make sure the
1568  correct "libgcc.a" path is returned for the 32/64 bit architecture.
1569
1570* Mon Dec 18 2006 Joerg Bruehe <joerg@mysql.com>
1571
1572- Fix the move of "mysqlmanager" to section 8: Directory name was wrong.
1573
1574* Thu Dec 14 2006 Joerg Bruehe <joerg@mysql.com>
1575
1576- Include the new man pages for "my_print_defaults" and "mysql_tzinfo_to_sql"
1577  in the server RPM.
1578- The "mysqlmanager" man page got moved from section 1 to 8.
1579
1580* Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com>
1581
1582- Call "make install" using "benchdir_root=%%{_datadir}",
1583  because that is affecting the regression test suite as well.
1584
1585* Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com>
1586
1587- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
1588  replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
1589  (bug#22081).
1590
1591* Mon Nov 13 2006 Joerg Bruehe <joerg@mysql.com>
1592
1593- Add "--with-partition" to all server builds.
1594
1595- Use "--report-features" in one test run per server build.
1596
1597* Tue Aug 15 2006 Joerg Bruehe <joerg@mysql.com>
1598
1599- The "max" server is removed from packages, effective from 5.1.12-beta.
1600  Delete all steps to build, package, or install it.
1601
1602* Mon Jul 10 2006 Joerg Bruehe <joerg@mysql.com>
1603
1604- Fix a typing error in the "make" target for the Perl script to run the tests.
1605
1606* Tue Jul 04 2006 Joerg Bruehe <joerg@mysql.com>
1607
1608- Use the Perl script to run the tests, because it will automatically check
1609  whether the server is configured with SSL.
1610
1611* Tue Jun 27 2006 Joerg Bruehe <joerg@mysql.com>
1612
1613- move "mysqldumpslow" from the client RPM to the server RPM (bug#20216)
1614
1615- Revert all previous attempts to call "mysql_upgrade" during RPM upgrade,
1616  there are some more aspects which need to be solved before this is possible.
1617  For now, just ensure the binary "mysql_upgrade" is delivered and installed.
1618
1619* Thu Jun 22 2006 Joerg Bruehe <joerg@mysql.com>
1620
1621- Close a gap of the previous version by explicitly using
1622  a newly created temporary directory for the socket to be used
1623  in the "mysql_upgrade" operation, overriding any local setting.
1624
1625* Tue Jun 20 2006 Joerg Bruehe <joerg@mysql.com>
1626
1627- To run "mysql_upgrade", we need a running server;
1628  start it in isolation and skip password checks.
1629
1630* Sat May 20 2006 Kent Boortz <kent@mysql.com>
1631
1632- Always compile for PIC, position independent code.
1633
1634* Wed May 10 2006 Kent Boortz <kent@mysql.com>
1635
1636- Use character set "all" when compiling with Cluster, to make Cluster
1637  nodes independent on the character set directory, and the problem
1638  that two RPM sub packages both wants to install this directory.
1639
1640* Mon May 01 2006 Kent Boortz <kent@mysql.com>
1641
1642- Use "./libtool --mode=execute" instead of searching for the
1643  executable in current directory and ".libs".
1644
1645* Fri Apr 28 2006 Kent Boortz <kent@mysql.com>
1646
1647- Install and run "mysql_upgrade"
1648
1649* Wed Apr 12 2006 Jim Winstead <jimw@mysql.com>
1650
1651- Remove sql-bench, and MySQL-bench RPM (will be built as an independent
1652  project from the mysql-bench repository)
1653
1654* Tue Apr 11 2006 Jim Winstead <jimw@mysql.com>
1655
1656- Remove old mysqltestmanager and related programs
1657* Sat Apr 01 2006 Kent Boortz <kent@mysql.com>
1658
1659- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
1660
1661* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
1662
1663- Changed product name from "Community Edition" to "Community Server"
1664
1665* Mon Mar 06 2006 Kent Boortz <kent@mysql.com>
1666
1667- Fast mutexes is now disabled by default, but should be
1668  used in Linux builds.
1669
1670* Mon Feb 20 2006 Kent Boortz <kent@mysql.com>
1671
1672- Reintroduced a max build
1673- Limited testing of 'debug' and 'max' servers
1674- Berkeley DB only in 'max'
1675
1676* Mon Feb 13 2006 Joerg Bruehe <joerg@mysql.com>
1677
1678- Use "-i" on "make test-force";
1679  this is essential for later evaluation of this log file.
1680
1681* Thu Feb 09 2006 Kent Boortz <kent@mysql.com>
1682
1683- Pass '-static' to libtool, link static with our own libraries, dynamic
1684  with system libraries.  Link with the bundled zlib.
1685
1686* Wed Feb 08 2006 Kristian Nielsen <knielsen@mysql.com>
1687
1688- Modified RPM spec to match new 5.1 debug+max combined community packaging.
1689
1690* Sun Dec 18 2005 Kent Boortz <kent@mysql.com>
1691
1692- Added "client/mysqlslap"
1693
1694* Mon Dec 12 2005 Rodrigo Novo <rodrigo@mysql.com>
1695
1696- Added zlib to the list of (static) libraries installed
1697- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld)
1698- Compile MySQL with bundled zlib
1699- Fixed %%packager name to "MySQL Production Engineering Team"
1700
1701* Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com>
1702
1703- Avoid using the "bundled" zlib on "shared" builds:
1704  As it is not installed (on the build system), this gives dependency
1705  problems with "libtool" causing the build to fail.
1706  (Change was done on Nov 11, but left uncommented.)
1707
1708* Tue Nov 22 2005 Joerg Bruehe <joerg@mysql.com>
1709
1710- Extend the file existence check for "init.d/mysql" on un-install
1711  to also guard the call to "insserv"/"chkconfig".
1712
1713* Thu Oct 27 2005 Lenz Grimmer <lenz@grimmer.com>
1714
1715- added more man pages
1716
1717* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
1718
1719- Made yaSSL support an option (off by default)
1720
1721* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
1722
1723- Enabled yaSSL support
1724
1725* Sat Oct 15 2005 Kent Boortz <kent@mysql.com>
1726
1727- Give mode arguments the same way in all places
1728- Moved copy of mysqld.a to "standard" build, but
1729  disabled it as we don't do embedded yet in 5.0
1730
1731* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
1732
1733- For 5.x, always compile with --with-big-tables
1734- Copy the config.log file to location outside
1735  the build tree
1736
1737* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
1738
1739- Removed unneeded/obsolete configure options
1740- Added archive engine to standard server
1741- Removed the embedded server from experimental server
1742- Changed suffix "-Max" => "-max"
1743- Changed comment string "Max" => "Experimental"
1744
1745* Thu Oct 13 2005 Lenz Grimmer <lenz@mysql.com>
1746
1747- added a usermod call to assign a potential existing mysql user to the
1748  correct user group (BUG#12823)
1749- Save the perror binary built during Max build so it supports the NDB
1750  error codes (BUG#13740)
1751- added a separate macro "mysqld_group" to be able to define the
1752  user group of the mysql user seperately, if desired.
1753
1754* Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
1755
1756- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the
1757  $RBR variable did not get expanded, thus leaving old build roots behind)
1758
1759* Thu Aug 04 2005 Lenz Grimmer <lenz@mysql.com>
1760
1761- Fixed the creation of the mysql user group account in the postinstall
1762  section (BUG 12348)
1763- Fixed enabling the Archive storage engine in the Max binary
1764
1765* Tue Aug 02 2005 Lenz Grimmer <lenz@mysql.com>
1766
1767- Fixed the Requires: tag for the server RPM (BUG 12233)
1768
1769* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
1770
1771- create a "mysql" user group and assign the mysql user account to that group
1772  in the server postinstall section. (BUG 10984)
1773
1774* Tue Jun 14 2005 Lenz Grimmer <lenz@mysql.com>
1775
1776- Do not build statically on i386 by default, only when adding either "--with
1777  static" or "--define '_with_static 1'" to the RPM build options. Static
1778  linking really only makes sense when linking against the specially patched
1779  glibc 2.2.5.
1780
1781* Mon Jun 06 2005 Lenz Grimmer <lenz@mysql.com>
1782
1783- added mysql_client_test to the "bench" subpackage (BUG 10676)
1784- added the libndbclient static and shared libraries (BUG 10676)
1785
1786* Wed Jun 01 2005 Lenz Grimmer <lenz@mysql.com>
1787
1788- use "mysqldatadir" variable instead of hard-coding the path multiple times
1789- use the "mysqld_user" variable on all occasions a user name is referenced
1790- removed (incomplete) Brazilian translations
1791- removed redundant release tags from the subpackage descriptions
1792
1793* Wed May 25 2005 Joerg Bruehe <joerg@mysql.com>
1794
1795- Added a "make clean" between separate calls to "BuildMySQL".
1796
1797* Thu May 12 2005 Guilhem Bichot <guilhem@mysql.com>
1798
1799- Removed the mysql_tableinfo script made obsolete by the information schema
1800
1801* Wed Apr 20 2005 Lenz Grimmer <lenz@mysql.com>
1802
1803- Enabled the "blackhole" storage engine for the Max RPM
1804
1805* Wed Apr 13 2005 Lenz Grimmer <lenz@mysql.com>
1806
1807- removed the MySQL manual files (html/ps/texi) - they have been removed
1808  from the MySQL sources and are now available seperately.
1809
1810* Mon Apr 4 2005 Petr Chardin <petr@mysql.com>
1811
1812- old mysqlmanager, mysqlmanagerc and mysqlmanager-pwger renamed into
1813  mysqltestmanager, mysqltestmanager and mysqltestmanager-pwgen respectively
1814
1815* Fri Mar 18 2005 Lenz Grimmer <lenz@mysql.com>
1816
1817- Disabled RAID in the Max binaries once and for all (it has finally been
1818  removed from the source tree)
1819
1820* Sun Feb 20 2005 Petr Chardin <petr@mysql.com>
1821
1822- Install MySQL Instance Manager together with mysqld, touch mysqlmanager
1823  password file
1824
1825* Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com>
1826
1827- Fixed the compilation comments and moved them into the separate build sections
1828  for Max and Standard
1829
1830* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
1831
1832- enabled the "Ndbcluster" storage engine for the max binary
1833- added extra make install in ndb subdir after Max build to get ndb binaries
1834- added packages for ndbcluster storage engine
1835
1836* Fri Jan 14 2005 Lenz Grimmer <lenz@mysql.com>
1837
1838- replaced obsoleted "BuildPrereq" with "BuildRequires" instead
1839
1840* Thu Jan 13 2005 Lenz Grimmer <lenz@mysql.com>
1841
1842- enabled the "Federated" storage engine for the max binary
1843
1844* Tue Jan 04 2005 Petr Chardin <petr@mysql.com>
1845
1846- ISAM and merge storage engines were purged. As well as appropriate
1847  tools and manpages (isamchk and isamlog)
1848
1849* Fri Dec 31 2004 Lenz Grimmer <lenz@mysql.com>
1850
1851- enabled the "Archive" storage engine for the max binary
1852- enabled the "CSV" storage engine for the max binary
1853- enabled the "Example" storage engine for the max binary
1854
1855* Thu Aug 26 2004 Lenz Grimmer <lenz@mysql.com>
1856
1857- MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860)
1858
1859* Fri Aug 20 2004 Lenz Grimmer <lenz@mysql.com>
1860
1861- do not link statically on IA64/AMD64 as these systems do not have
1862  a patched glibc installed
1863
1864* Tue Aug 10 2004 Lenz Grimmer <lenz@mysql.com>
1865
1866- Added libmygcc.a to the devel subpackage (required to link applications
1867  against the the embedded server libmysqld.a) (BUG 4921)
1868
1869* Mon Aug 09 2004 Lenz Grimmer <lenz@mysql.com>
1870
1871- Added EXCEPTIONS-CLIENT to the "devel" package
1872
1873* Thu Jul 29 2004 Lenz Grimmer <lenz@mysql.com>
1874
1875- disabled OpenSSL in the Max binaries again (the RPM packages were the
1876  only exception to this anyway) (BUG 1043)
1877
1878* Wed Jun 30 2004 Lenz Grimmer <lenz@mysql.com>
1879
1880- fixed server postinstall (mysql_install_db was called with the wrong
1881  parameter)
1882
1883* Thu Jun 24 2004 Lenz Grimmer <lenz@mysql.com>
1884
1885- added mysql_tzinfo_to_sql to the server subpackage
1886- run "make clean" instead of "make distclean"
1887
1888* Mon Apr 05 2004 Lenz Grimmer <lenz@mysql.com>
1889
1890- added ncurses-devel to the build prerequisites (BUG 3377)
1891
1892* Thu Feb 12 2004 Lenz Grimmer <lenz@mysql.com>
1893
1894- when using gcc, _always_ use CXX=gcc
1895- replaced Copyright with License field (Copyright is obsolete)
1896
1897* Tue Feb 03 2004 Lenz Grimmer <lenz@mysql.com>
1898
1899- added myisam_ftdump to the Server package
1900
1901* Tue Jan 13 2004 Lenz Grimmer <lenz@mysql.com>
1902
1903- link the mysql client against libreadline instead of libedit (BUG 2289)
1904
1905* Mon Dec 22 2003 Lenz Grimmer <lenz@mysql.com>
1906
1907- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
1908
1909* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
1910
1911- fixed file permissions (BUG 1672)
1912
1913* Thu Dec 11 2003 Lenz Grimmer <lenz@mysql.com>
1914
1915- made testing for gcc3 a bit more robust
1916
1917* Fri Dec 05 2003 Lenz Grimmer <lenz@mysql.com>
1918
1919- added missing file mysql_create_system_tables to the server subpackage
1920
1921* Fri Nov 21 2003 Lenz Grimmer <lenz@mysql.com>
1922
1923- removed dependency on MySQL-client from the MySQL-devel subpackage
1924  as it is not really required. (BUG 1610)
1925
1926* Fri Aug 29 2003 Lenz Grimmer <lenz@mysql.com>
1927
1928- Fixed BUG 1162 (removed macro names from the changelog)
1929- Really fixed BUG 998 (disable the checking for installed but
1930  unpackaged files)
1931
1932* Tue Aug 05 2003 Lenz Grimmer <lenz@mysql.com>
1933
1934- Fixed BUG 959 (libmysqld not being compiled properly)
1935- Fixed BUG 998 (RPM build errors): added missing files to the
1936  distribution (mysql_fix_extensions, mysql_tableinfo, mysqldumpslow,
1937  mysql_fix_privilege_tables.1), removed "-n" from install section.
1938
1939* Wed Jul 09 2003 Lenz Grimmer <lenz@mysql.com>
1940
1941- removed the GIF Icon (file was not included in the sources anyway)
1942- removed unused variable shared_lib_version
1943- do not run automake before building the standard binary
1944  (should not be necessary)
1945- add server suffix '-standard' to standard binary (to be in line
1946  with the binary tarball distributions)
1947- Use more RPM macros (_exec_prefix, _sbindir, _libdir, _sysconfdir,
1948  _datadir, _includedir) throughout the spec file.
1949- allow overriding CC and CXX (required when building with other compilers)
1950
1951* Fri May 16 2003 Lenz Grimmer <lenz@mysql.com>
1952
1953- re-enabled RAID again
1954
1955* Wed Apr 30 2003 Lenz Grimmer <lenz@mysql.com>
1956
1957- disabled MyISAM RAID (--with-raid) - it throws an assertion which
1958  needs to be investigated first.
1959
1960* Mon Mar 10 2003 Lenz Grimmer <lenz@mysql.com>
1961
1962- added missing file mysql_secure_installation to server subpackage
1963  (BUG 141)
1964
1965* Tue Feb 11 2003 Lenz Grimmer <lenz@mysql.com>
1966
1967- re-added missing pre- and post(un)install scripts to server subpackage
1968- added config file /etc/my.cnf to the file list (just for completeness)
1969- make sure to create the datadir with 755 permissions
1970
1971* Mon Jan 27 2003 Lenz Grimmer <lenz@mysql.com>
1972
1973- removed unused CC and CXX variables
1974- CFLAGS and CXXFLAGS should honor RPM_OPT_FLAGS
1975
1976* Fri Jan 24 2003 Lenz Grimmer <lenz@mysql.com>
1977
1978- renamed package "MySQL" to "MySQL-server"
1979- fixed Copyright tag
1980- added mysql_waitpid to client subpackage (required for mysql-test-run)
1981
1982* Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com>
1983
1984- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
1985  Linux distributions now support this scheme as proposed by the LSB either
1986  directly or via a compatibility symlink)
1987- Use new "restart" init script action instead of starting and stopping
1988  separately
1989- Be more flexible in activating the automatic bootup - use insserv (on
1990  older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and
1991  others) to create the respective symlinks
1992
1993* Wed Sep 25 2002 Lenz Grimmer <lenz@mysql.com>
1994
1995- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches
1996  (mixing 3.23 and 4.0 packages)
1997
1998* Fri Aug 09 2002 Lenz Grimmer <lenz@mysql.com>
1999
2000- Turn off OpenSSL in MySQL-Max for now until it works properly again
2001- enable RAID for the Max binary instead
2002- added compatibility link: safe_mysqld -> mysqld_safe to ease the
2003  transition from 3.23
2004
2005* Thu Jul 18 2002 Lenz Grimmer <lenz@mysql.com>
2006
2007- Reworked the build steps a little bit: the Max binary is supposed
2008  to include OpenSSL, which cannot be linked statically, thus trying
2009  to statically link against a special glibc is futile anyway
2010- because of this, it is not required to make yet another build run
2011  just to compile the shared libs (saves a lot of time)
2012- updated package description of the Max subpackage
2013- clean up the BuildRoot directory afterwards
2014
2015* Mon Jul 15 2002 Lenz Grimmer <lenz@mysql.com>
2016
2017- Updated Packager information
2018- Fixed the build options: the regular package is supposed to
2019  include InnoDB and linked statically, while the Max package
2020  should include BDB and SSL support
2021
2022* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>
2023
2024- Use more RPM macros (e.g. infodir, mandir) to make the spec
2025  file more portable
2026- reorganized the installation of documentation files: let RPM
2027  take care of this
2028- reorganized the file list: actually install man pages along
2029  with the binaries of the respective subpackage
2030- do not include libmysqld.a in the devel subpackage as well, if we
2031  have a special "embedded" subpackage
2032- reworked the package descriptions
2033
2034* Mon Oct  8 2001 Monty
2035
2036- Added embedded server as a separate RPM
2037
2038* Fri Apr 13 2001 Monty
2039
2040- Added mysqld-max to the distribution
2041
2042* Tue Jan 2  2001  Monty
2043
2044- Added mysql-test to the bench package
2045
2046* Fri Aug 18 2000 Tim Smith <tim@mysql.com>
2047
2048- Added separate libmysql_r directory; now both a threaded
2049  and non-threaded library is shipped.
2050
2051* Tue Sep 28 1999 David Axmark <davida@mysql.com>
2052
2053- Added the support-files/my-example.cnf to the docs directory.
2054
2055- Removed devel dependency on base since it is about client
2056  development.
2057
2058* Wed Sep 8 1999 David Axmark <davida@mysql.com>
2059
2060- Cleaned up some for 3.23.
2061
2062* Thu Jul 1 1999 David Axmark <davida@mysql.com>
2063
2064- Added support for shared libraries in a separate sub
2065  package. Original fix by David Fox (dsfox@cogsci.ucsd.edu)
2066
2067- The --enable-assembler switch is now automatically disables on
2068  platforms there assembler code is unavailable. This should allow
2069  building this RPM on non i386 systems.
2070
2071* Mon Feb 22 1999 David Axmark <david@detron.se>
2072
2073- Removed unportable cc switches from the spec file. The defaults can
2074  now be overridden with environment variables. This feature is used
2075  to compile the official RPM with optimal (but compiler version
2076  specific) switches.
2077
2078- Removed the repetitive description parts for the sub rpms. Maybe add
2079  again if RPM gets a multiline macro capability.
2080
2081- Added support for a pt_BR translation. Translation contributed by
2082  Jorge Godoy <jorge@bestway.com.br>.
2083
2084* Wed Nov 4 1998 David Axmark <david@detron.se>
2085
2086- A lot of changes in all the rpm and install scripts. This may even
2087  be a working RPM :-)
2088
2089* Sun Aug 16 1998 David Axmark <david@detron.se>
2090
2091- A developers changelog for MySQL is available in the source RPM. And
2092  there is a history of major user visible changed in the Reference
2093  Manual.  Only RPM specific changes will be documented here.
2094