1
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
1
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
133
133
Group: Applications/Databases
134
134
Version: @MYSQL_U_SCORE_VERSION@
135
135
Release: %{release}
136
License: Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved. Use is subject to license terms. Under %{mysql_license} license as shown in the Description field.
136
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{mysql_license} license as shown in the Description field.
137
137
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
138
138
URL: http://www.mysql.com/
139
139
Packager: %{mysql_vendor} Product Engineering Team <build@mysql.com>
154
154
as for embedding into mass-deployed software. MySQL is a trademark of
157
Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved.
158
Use is subject to license terms.
157
Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved.
160
159
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
161
160
and you are welcome to modify and redistribute it under the GPL license.
172
171
Summary: MySQL: a very fast and reliable SQL database server
173
172
Group: Applications/Databases
174
Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig
175
Provides: msqlormysql mysql-server mysql MySQL
176
Obsoletes: MySQL mysql mysql-server
173
Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig
174
Provides: msqlormysql mysql MySQL mysql-server MySQL-server
175
Obsoletes: mysql MySQL mysql-server MySQL-server
176
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
177
Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
178
179
%description server
179
180
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
182
183
as for embedding into mass-deployed software. MySQL is a trademark of
185
Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved.
186
Use is subject to license terms.
186
Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved.
188
188
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
189
189
and you are welcome to modify and redistribute it under the GPL license.
204
204
# ------------------------------------------------------------------------------
207
Summary: MySQL - Client
208
Group: Applications/Databases
209
Obsoletes: mysql-client
210
Provides: mysql-client
207
Summary: MySQL - Client
208
Group: Applications/Databases
209
Provides: mysql-client MySQL-client
210
Obsoletes: mysql-client MySQL-client
211
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
212
Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
212
214
%description client
213
215
This package contains the standard MySQL clients and administration tools.
268
270
# ------------------------------------------------------------------------------
271
Requires: %{name}-client perl
272
Summary: MySQL - Test suite
273
Group: Applications/Databases
275
Obsoletes: mysql-bench mysql-test
273
Summary: MySQL - Test suite
274
Group: Applications/Databases
275
Requires: %{name}-client perl
276
Provides: mysql-test MySQL-test
277
Obsoletes: mysql-test MySQL-test
278
Obsoletes: mysql-bench MySQL-bench
279
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
280
Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
278
283
%description test
283
288
# ------------------------------------------------------------------------------
286
Summary: MySQL - Development header files and libraries
287
Group: Applications/Databases
288
Provides: mysql-devel
289
Obsoletes: mysql-devel
291
Summary: MySQL - Development header files and libraries
292
Group: Applications/Databases
293
Provides: mysql-devel MySQL-devel
294
Obsoletes: mysql-devel MySQL-devel
295
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
296
Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
291
298
%description devel
292
299
This package contains the development header files and libraries
297
304
# ------------------------------------------------------------------------------
300
Summary: MySQL - Shared libraries
301
Group: Applications/Databases
307
Summary: MySQL - Shared libraries
308
Group: Applications/Databases
309
Provides: mysql-shared MySQL-shared
310
Obsoletes: mysql-shared MySQL-shared-standard MySQL-shared-pro
311
Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
312
Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
313
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
314
Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
303
316
%description shared
304
317
This package contains the shared libraries (*.so*) which certain
309
322
%if %{EMBEDDED_BUILD}
311
324
%package embedded
312
Requires: %{name}-devel
313
Summary: MySQL - embedded library
314
Group: Applications/Databases
315
Obsoletes: mysql-embedded
325
Summary: MySQL - Embedded library
326
Group: Applications/Databases
327
Requires: %{name}-devel
328
Provides: mysql-embedded MySQL-embedded
329
Obsoletes: mysql-embedded MySQL-embedded
330
Obsoletes: MySQL-embedded-pro
331
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
332
Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
317
334
%description embedded
318
335
This package contains the MySQL server as an embedded library.
610
627
##############################################################################
613
mysql_datadir=%{mysqldatadir}
630
# This is the code running at the beginning of a RPM upgrade action,
631
# before replacing the old files with the new ones.
633
# There are users who deviate from the default file system layout.
634
# Check local settings to support them.
635
if [ -x %{_bindir}/my_print_defaults ]
637
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
638
PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
640
if [ -z "$mysql_datadir" ]
642
mysql_datadir=%{mysqldatadir}
644
if [ -z "$PID_FILE_PATT" ]
646
PID_FILE_PATT="$mysql_datadir/*.pid"
614
649
# Check if we can safely upgrade. An upgrade is only safe if it's from one
615
650
# of our RPMs in the same version family.
682
717
# We assume that if there is exactly one ".pid" file,
683
718
# it contains the valid PID of a running MySQL server.
684
NR_PID_FILES=`ls $mysql_datadir/*.pid 2>/dev/null | wc -l`
719
NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l`
685
720
case $NR_PID_FILES in
686
721
0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server
687
722
1 ) SERVER_TO_START='true' ;;
703
738
echo "before repeating the MySQL upgrade."
705
740
elif [ -n "$SEVERAL_PID_FILES" ] ; then
706
echo "Your MySQL directory '$mysql_datadir' has more than one PID file:"
707
ls -ld $mysql_datadir/*.pid
741
echo "You have more than one PID file:"
742
ls -ld $PID_FILE_PATT
708
743
echo "Please check which one (if any) corresponds to a running server"
709
744
echo "and delete all others before repeating the MySQL upgrade."
729
764
if [ -n "$SERVER_TO_START" ] ; then
730
765
# There is only one PID file, race possibility ignored
731
766
echo "PID file:" >> $STATUS_FILE
732
ls -l $mysql_datadir/*.pid >> $STATUS_FILE
733
cat $mysql_datadir/*.pid >> $STATUS_FILE
767
ls -l $PID_FILE_PATT >> $STATUS_FILE
768
cat $PID_FILE_PATT >> $STATUS_FILE
734
769
echo >> $STATUS_FILE
735
770
echo "Server process:" >> $STATUS_FILE
736
ps -fp `cat $mysql_datadir/*.pid` >> $STATUS_FILE
771
ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE
737
772
echo >> $STATUS_FILE
738
773
echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE
740
775
# Take a note we checked it ...
741
776
echo "PID file:" >> $STATUS_FILE
742
ls -l $mysql_datadir/*.pid >> $STATUS_FILE 2>&1
777
ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1
757
mysql_datadir=%{mysqldatadir}
792
# This is the code running at the end of a RPM install or upgrade action,
793
# after the (new) files have been written.
795
# There are users who deviate from the default file system layout.
796
# Check local settings to support them.
797
if [ -x %{_bindir}/my_print_defaults ]
799
mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
801
if [ -z "$mysql_datadir" ]
803
mysql_datadir=%{mysqldatadir}
758
806
NEW_VERSION=%{mysql_version}-%{release}
759
807
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
770
818
# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
771
819
if [ ! -d $mysql_datadir/mysql ] ; then
772
mkdir $mysql_datadir/mysql;
820
mkdir $mysql_datadir/mysql $mysql_datadir/test
773
821
echo "MySQL RPM installation of version $NEW_VERSION" >> $STATUS_FILE
775
823
# If the directory exists, we may assume it is an upgrade.
776
824
echo "MySQL RPM upgrade to version $NEW_VERSION" >> $STATUS_FILE
778
if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
780
827
# ----------------------------------------------------------------------
781
828
# Make MySQL start/shutdown automatically when the machine does it.
808
855
# ----------------------------------------------------------------------
809
856
# Initiate databases if needed
810
857
# ----------------------------------------------------------------------
811
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
858
if ! grep '^MySQL RPM upgrade' $STATUS_FILE >/dev/null 2>&1 ; then
859
# Fix bug#45415: no "mysql_install_db" on an upgrade
860
# Do this as a negative to err towards more "install" runs
861
# rather than to miss one.
862
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
813
865
# ----------------------------------------------------------------------
814
866
# Upgrade databases if needed would go here - but it cannot be automated yet
825
877
# ----------------------------------------------------------------------
826
878
chmod -R og-rw $mysql_datadir/mysql
880
# ----------------------------------------------------------------------
881
# Deal with SELinux, if it is installed / used
882
# ----------------------------------------------------------------------
883
if [ -x /sbin/restorecon ] ; then
884
/sbin/restorecon -R %{mysqldatadir}
828
887
# Was the server running before the upgrade? If so, restart the new one.
829
888
if [ "$SERVER_TO_START" = "true" ] ; then
830
889
# Restart in the same way that mysqld will be started normally.
1132
1191
# merging BK trees)
1133
1192
##############################################################################
1194
* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1196
- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
1197
the RPMs of any configuration (of the current or the preceding release series)
1198
by the new ones. This is done by not using the implicitly generated capabilities
1199
(which include the configuration name) and relying on more generic ones which
1200
just list the function ("server", "client", ...).
1201
The implicit generation cannot be prevented, so all these capabilities must be
1202
explicitly listed in "Obsoletes:"
1204
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1206
- Fix bug#37165 "((Generic rpm)) fail to install on Fedora 9 x86_64"
1207
On Fedora, certain accesses to "/var/lib/mysql/HOSTNAME.err" were blocked
1208
by SELinux policy, this made the server start fail with the message
1209
Manager of pid-file quit without updating file
1210
Calling "/sbin/restorecon -R /var/lib/mysql" fixes this.
1211
- Replace occurrences of that path name by the spec file variable %{mysqldatadir}.
1213
* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1215
- Fix bug#45415: "rpm upgrade recreates test database"
1216
Let the creation of the "test" database happen only during a new installation,
1217
not in an RPM upgrade.
1218
This affects both the "mkdir" and the call of "mysql_install_db".
1220
* Thu Feb 03 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
1222
- Fix bug#56581: If an installation deviates from the default file locations
1223
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
1224
should still work, and use these locations.
1225
The problem was that the fix for bug#27072 did not check for local settings.
1136
1227
* Wed Nov 24 2010 Alexander Nozdrin <alexander.nozdrin@oracle.com>