~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to support-files/mysql.spec.sh

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
2
2
#
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
155
155
%{mysql_vendor}
156
156
 
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.
159
158
 
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.
171
170
%package server
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
177
178
 
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
183
184
%{mysql_vendor}
184
185
 
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.
187
187
 
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
# ------------------------------------------------------------------------------
205
205
 
206
206
%package client
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
211
213
 
212
214
%description client
213
215
This package contains the standard MySQL clients and administration tools.
268
270
# ------------------------------------------------------------------------------
269
271
 
270
272
%package test
271
 
Requires: %{name}-client perl
272
 
Summary: MySQL - Test suite
273
 
Group: Applications/Databases
274
 
Provides: mysql-test
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
276
281
AutoReqProv: no
277
282
 
278
283
%description test
283
288
# ------------------------------------------------------------------------------
284
289
 
285
290
%package devel
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
290
297
 
291
298
%description devel
292
299
This package contains the development header files and libraries
297
304
# ------------------------------------------------------------------------------
298
305
 
299
306
%package shared
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
302
315
 
303
316
%description shared
304
317
This package contains the shared libraries (*.so*) which certain
309
322
%if %{EMBEDDED_BUILD}
310
323
 
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
316
333
 
317
334
%description embedded
318
335
This package contains the MySQL server as an embedded library.
384
401
            --enable-local-infile \
385
402
            --with-fast-mutexes \
386
403
            --with-mysqld-user=%{mysqld_user} \
387
 
            --with-unix-socket-path=/var/lib/mysql/mysql.sock \
 
404
            --with-unix-socket-path=%{mysqldatadir}/mysql.sock \
388
405
            --with-pic \
389
406
            --prefix=/ \
390
407
%if %{CLUSTER_BUILD}
610
627
##############################################################################
611
628
 
612
629
%pre server
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.
 
632
 
 
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 ]
 
636
then
 
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'`
 
639
fi
 
640
if [ -z "$mysql_datadir" ]
 
641
then
 
642
  mysql_datadir=%{mysqldatadir}
 
643
fi
 
644
if [ -z "$PID_FILE_PATT" ]
 
645
then
 
646
  PID_FILE_PATT="$mysql_datadir/*.pid"
 
647
fi
 
648
 
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.
616
651
 
681
716
 
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."
704
739
        exit 1
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."
710
745
        exit 1
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
739
774
        else
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
743
778
        fi
744
779
fi
745
780
 
754
789
fi
755
790
 
756
791
%post server
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.
 
794
 
 
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 ]
 
798
then
 
799
  mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
 
800
fi
 
801
if [ -z "$mysql_datadir" ]
 
802
then
 
803
  mysql_datadir=%{mysqldatadir}
 
804
fi
 
805
 
758
806
NEW_VERSION=%{mysql_version}-%{release}
759
807
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
760
808
 
769
817
fi
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
774
822
else
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
777
825
fi
778
 
if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
779
826
 
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}
 
863
fi
812
864
 
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
827
879
 
 
880
# ----------------------------------------------------------------------
 
881
# Deal with SELinux, if it is installed / used
 
882
# ----------------------------------------------------------------------
 
883
if [ -x /sbin/restorecon ] ; then
 
884
        /sbin/restorecon -R %{mysqldatadir}
 
885
fi
 
886
 
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
##############################################################################
1134
1193
%changelog
 
1194
* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
 
1195
 
 
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:"
 
1203
 
 
1204
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
 
1205
 
 
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}.
 
1212
 
 
1213
* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
 
1214
 
 
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".
 
1219
 
 
1220
* Thu Feb 03 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
 
1221
 
 
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.
1135
1226
 
1136
1227
* Wed Nov 24 2010 Alexander Nozdrin <alexander.nozdrin@oracle.com>
1137
1228