MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:August 19 2009 11:43am
Subject:bzr commit into mysql-5.1 branch (joerg:2872)
View as plain text  
#At file:///MySQL/REPO/V54/bug33248-5.4/ based on revid:alik@stripped

 2872 Joerg Bruehe	2009-08-19 [merge]
      Merge steps 1 - 4 of the RPM spec file alignment up into 5.4,
      after that hes been re-based.
      
      Work in progress, not yet to be pushed.

    modified:
      support-files/mysql.spec.sh
=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2009-05-27 15:14:09 +0000
+++ b/support-files/mysql.spec.sh	2009-08-17 21:23:22 +0000
@@ -1,58 +1,41 @@
 # Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
-# 
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; version 2 of the License.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; see the file COPYING. If not, write to the
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
 # MA  02110-1301  USA.
 
-%define mysql_version		@VERSION@
+##############################################################################
+# Some common macro definitions
+##############################################################################
 
 # NOTE: "vendor" is used in upgrade/downgrade check, so you can't
 # change these, has to be exactly as is.
 %define mysql_old_vendor	MySQL AB
 %define mysql_vendor		Sun Microsystems, Inc.
 
-# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
-# to enable static linking (off by default)
-%{?_with_static:%define STATIC_BUILD 1}
-%{!?_with_static:%define STATIC_BUILD 0}
-
-# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x)
-# to build with yaSSL support (off by default)
-%{?_with_yassl:%define YASSL_BUILD 1}
-%{!?_with_yassl:%define YASSL_BUILD 0}
+%define mysql_version   @VERSION@
 
 # use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x)
 # to build with cluster support (off by default)
 %{?_with_cluster:%define CLUSTER_BUILD 1}
 %{!?_with_cluster:%define CLUSTER_BUILD 0}
 
-%if %{STATIC_BUILD}
-%define release 0
-%else
-%define release 0.glibc23
-%endif
-%define mysql_license	GPL
 %define mysqld_user	mysql
 %define mysqld_group	mysql
-%define server_suffix -standard
 %define mysqldatadir /var/lib/mysql
-
-# We don't package all files installed into the build root by intention -
-# See BUG#998 for details.
-%define _unpackaged_files_terminate_build 0
-
 %define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
 
+# ------------------------------------------------------------------------------
 # On SuSE 9 no separate "debuginfo" package is built. To enable basic
 # debugging on that platform, we don't strip binaries on SuSE 9. We
 # disable the strip of binaries by redefining the RPM macro
@@ -70,6 +53,39 @@
 
 %define __os_install_post /usr/lib/rpm/brp-compress
 
+# ------------------------------------------------------------------------------
+# We don't package all files installed into the build root by intention -
+# See BUG#998 for details.
+%define _unpackaged_files_terminate_build 0
+
+##############################################################################
+# Command line handling
+##############################################################################
+
+# ------------------------------------------------------------------------------
+# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x)
+# to build with yaSSL support (off by default)
+%{?_with_yassl:%define YASSL_BUILD 1}
+%{!?_with_yassl:%define YASSL_BUILD 0}
+
+# ------------------------------------------------------------------------------
+# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
+# to enable static linking (off by default)
+%{?_with_static:%define STATIC_BUILD 1}
+%{!?_with_static:%define STATIC_BUILD 0}
+
+%if %{STATIC_BUILD}
+%define release 0
+%else
+%define release 0.glibc23
+%endif
+%define mysql_license GPL
+%define server_suffix   -standard
+
+##############################################################################
+# Main spec file section
+##############################################################################
+
 Name: MySQL
 Summary:	MySQL: a very fast and reliable SQL database server
 Group:		Applications/Databases
@@ -78,7 +94,7 @@ Release:	%{release}
 License:	Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc.  All rights reserved.  Use is subject to license terms.  Under %{mysql_license} license as shown in the Description field.
 Source:		http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
 URL:		http://www.mysql.com/
-Packager:	Sun Microsystems, Inc. Product Engineering Team <build@stripped>
+Packager:	%{mysql_vendor}: MySQL Release Engineering Team <build@stripped>
 Vendor:		%{mysql_vendor}
 Provides:	msqlormysql MySQL-server mysql
 BuildRequires: ncurses-devel
@@ -94,7 +110,7 @@ The MySQL(TM) software delivers a very f
 and robust SQL (Structured Query Language) database server. MySQL Server
 is intended for mission-critical, heavy-load production systems as well
 as for embedding into mass-deployed software. MySQL is a trademark of
-Sun Microsystems, Inc.
+%{mysql_vendor}
 
 Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.
@@ -106,6 +122,10 @@ The MySQL web site (http://www.mysql.com
 news and information about the MySQL software. Also please see the
 documentation and the manual for more information.
 
+##############################################################################
+# Sub package definition
+##############################################################################
+
 %package server
 Summary:	MySQL: a very fast and reliable SQL database server
 Group:		Applications/Databases
@@ -118,7 +138,7 @@ The MySQL(TM) software delivers a very f
 and robust SQL (Structured Query Language) database server. MySQL Server
 is intended for mission-critical, heavy-load production systems as well
 as for embedding into mass-deployed software. MySQL is a trademark of
-Sun Microsystems, Inc.
+%{mysql_vendor}
 
 Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc.  All rights reserved.
 Use is subject to license terms.
@@ -130,12 +150,15 @@ The MySQL web site (http://www.mysql.com
 news and information about the MySQL software. Also please see the
 documentation and the manual for more information.
 
-This package includes the MySQL server binary (incl. InnoDB) as well
-as related utilities to run and administrate a MySQL server.
+This package includes the MySQL server binary
+(configured including InnoDB)
+as well as related utilities to run and administer a MySQL server.
 
 If you want to access and work with the database, you have to install
 package "MySQL-client" as well!
 
+# ------------------------------------------------------------------------------
+
 %package client
 Summary: MySQL - Client
 Group: Applications/Databases
@@ -143,33 +166,39 @@ Obsoletes: mysql-client
 Provides: mysql-client
 
 %description client
-This package contains the standard MySQL clients and administration tools. 
+This package contains the standard MySQL clients and administration tools.
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
 %if %{CLUSTER_BUILD}
+
 %package ndb-storage
 Summary:	MySQL - ndbcluster storage engine
 Group:		Applications/Databases
 
 %description ndb-storage
-This package contains the ndbcluster storage engine. 
-It is necessary to have this package installed on all 
+This package contains the ndbcluster storage engine.
+It is necessary to have this package installed on all
 computers that should store ndbcluster table data.
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
+
 %package ndb-management
 Summary:	MySQL - ndbcluster storage engine management
 Group:		Applications/Databases
 
 %description ndb-management
 This package contains ndbcluster storage engine management.
-It is necessary to have this package installed on at least 
+It is necessary to have this package installed on at least
 one computer in the cluster.
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
+
 %package ndb-tools
 Summary:	MySQL - ndbcluster storage engine basic tools
 Group:		Applications/Databases
@@ -179,6 +208,8 @@ This package contains ndbcluster storage
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
+
 %package ndb-extra
 Summary:	MySQL - ndbcluster storage engine extra tools
 Group:		Applications/Databases
@@ -190,7 +221,9 @@ They should be used with caution.
 %{see_base}
 %endif
 
+# ------------------------------------------------------------------------------
 %package test
+
 Requires: %{name}-client perl-DBI perl
 Summary: MySQL - Test suite
 Group: Applications/Databases
@@ -203,6 +236,8 @@ This package contains the MySQL regressi
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
+
 %package devel
 Summary: MySQL - Development header files and libraries
 Group: Applications/Databases
@@ -215,6 +250,8 @@ necessary to develop MySQL client applic
 
 %{see_base}
 
+# ------------------------------------------------------------------------------
+
 %package shared
 Summary: MySQL - Shared libraries
 Group: Applications/Databases
@@ -249,29 +286,33 @@ mv mysql-%{mysql_version} mysql-debug-%{
 %setup -D -T -a 0 -n mysql-%{mysql_version}
 mv mysql-%{mysql_version} mysql-release-%{mysql_version}
 
+##############################################################################
+# The actual build
+##############################################################################
+
 %build
 
 BuildMySQL() {
 # The --enable-assembler simply does nothing on systems that does not
 # support assembler speedups.
 sh -c  "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
-	CC=\"${CC:-$MYSQL_BUILD_CC}\" \
-	CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \
+	CC=\"${MYSQL_BUILD_CC:-$CC}\" \
+	CXX=\"${MYSQL_BUILD_CXX:-$CXX}\" \
 	CFLAGS=\"$CFLAGS\" \
 	CXXFLAGS=\"$CXXFLAGS\" \
 	LDFLAGS=\"$MYSQL_BUILD_LDFLAGS\" \
 	./configure \
- 	    $* \
+	    $* \
 	    --with-mysqld-ldflags='-static' \
 	    --with-client-ldflags='-static' \
 	    --with-zlib-dir=bundled \
 	    --enable-assembler \
 	    --enable-local-infile \
 	    --with-fast-mutexes \
-            --with-mysqld-user=%{mysqld_user} \
-            --with-unix-socket-path=/var/lib/mysql/mysql.sock \
+	    --with-mysqld-user=%{mysqld_user} \
+	    --with-unix-socket-path=/var/lib/mysql/mysql.sock \
 	    --with-pic \
-            --prefix=/ \
+	    --prefix=/ \
 %if %{CLUSTER_BUILD}
 	    --with-extra-charsets=all \
 %else
@@ -280,31 +321,31 @@ sh -c  "PATH=\"${MYSQL_BUILD_PATH:-$PATH
 %if %{YASSL_BUILD}
 	    --with-ssl \
 %endif
-            --exec-prefix=%{_exec_prefix} \
-            --libexecdir=%{_sbindir} \
-            --libdir=%{_libdir} \
-            --sysconfdir=%{_sysconfdir} \
-            --datadir=%{_datadir} \
-            --localstatedir=%{mysqldatadir} \
-            --infodir=%{_infodir} \
-            --includedir=%{_includedir} \
-            --mandir=%{_mandir} \
+	    --exec-prefix=%{_exec_prefix} \
+	    --libexecdir=%{_sbindir} \
+	    --libdir=%{_libdir} \
+	    --sysconfdir=%{_sysconfdir} \
+	    --datadir=%{_datadir} \
+	    --localstatedir=%{mysqldatadir} \
+	    --infodir=%{_infodir} \
+	    --includedir=%{_includedir} \
+	    --mandir=%{_mandir} \
 	    --enable-thread-safe-client \
 	    --with-readline \
-		--with-innodb \
+	    --with-innodb \
 %if %{CLUSTER_BUILD}
-		--with-ndbcluster \
+	    --with-ndbcluster \
 %else
-		--without-ndbcluster \
+	    --without-ndbcluster \
 %endif
-		--with-archive-storage-engine \
-		--with-csv-storage-engine \
-		--with-blackhole-storage-engine \
-		--with-federated-storage-engine \
-		--with-partition \
-		--with-big-tables \
-		--enable-shared \
-		"
+	    --with-archive-storage-engine \
+	    --with-csv-storage-engine \
+	    --with-blackhole-storage-engine \
+	    --with-federated-storage-engine \
+	    --with-partition \
+	    --with-big-tables \
+	    --enable-shared \
+	    "
  make
 }
 
@@ -425,7 +466,7 @@ install -d $RBR%{_mandir}
 install -d $RBR%{_sbindir}
 
 
-# Install all binaries 
+# Install all binaries
 (cd $MBD && make install DESTDIR=$RBR benchdir_root=%{_datadir})
 # Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do
 # the same here.
@@ -459,6 +500,11 @@ ln -s %{_sysconfdir}/init.d/mysql $RPM_B
 touch $RBR%{_sysconfdir}/my.cnf
 touch $RBR%{_sysconfdir}/mysqlmanager.passwd
 
+
+##############################################################################
+#  Post processing actions, i.e. when installed
+##############################################################################
+
 %pre server
 # Check if we can safely upgrade.  An upgrade is only safe if it's from one
 # of our RPMs in the same version family.
@@ -543,11 +589,13 @@ fi
 %post server
 mysql_datadir=%{mysqldatadir}
 
+# ------------------------------------------------------------------------------
 # Create data directory if needed
 if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi
 if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
 if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
 
+# ------------------------------------------------------------------------------
 # Make MySQL start/shutdown automatically when the machine does it.
 # use insserv for older SuSE Linux versions
 if test -x /sbin/insserv
@@ -559,25 +607,31 @@ then
 	/sbin/chkconfig --add mysql
 fi
 
+# ------------------------------------------------------------------------------
 # Create a MySQL user and group. Do not report any problems if it already
 # exists.
 groupadd -r %{mysqld_group} 2> /dev/null || true
-useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true 
+useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
 # The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
 usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
 
+# ------------------------------------------------------------------------------
 # Change permissions so that the user that will run the MySQL daemon
 # owns all database files.
 chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
 
+# ------------------------------------------------------------------------------
 # Initiate databases if needed
 %{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
 
+# ------------------------------------------------------------------------------
 # Upgrade databases if needed would go here - but it cannot be automated yet
 
+# ------------------------------------------------------------------------------
 # Change permissions again to fix any new files.
 chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
 
+# ------------------------------------------------------------------------------
 # Fix permissions for the permission database so that only the user
 # can read them.
 chmod -R og-rw $mysql_datadir/mysql
@@ -592,7 +646,7 @@ sleep 2
 #systems, we recommend MySQL Enterprise, which contains enterprise-ready
 #software, intelligent advisory services, and full production support with
 #scheduled service packs and more.  Visit www.mysql.com/enterprise for more
-#information." 
+#information."
 
 %if %{CLUSTER_BUILD}
 %post ndb-storage
@@ -626,14 +680,19 @@ fi
 # We do not remove the mysql user since it may still own a lot of
 # database files.
 
-# Clean up the BuildRoot
+# ------------------------------------------------------------------------------
+# Clean up the BuildRoot after build is done
 %clean
 [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
 
+##############################################################################
+#  Files section
+##############################################################################
+
 %files server
 %defattr(-,root,root,0755)
 
-%doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README 
+%doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README
 %doc mysql-release-%{mysql_version}/support-files/my-*.cnf
 %if %{CLUSTER_BUILD}
 %doc mysql-release-%{mysql_version}/support-files/ndb-*.ini
@@ -840,18 +899,26 @@ fi
 %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
 
 %files embedded
-%defattr(-, root, root, 0755) 
+%defattr(-, root, root, 0755)
 %attr(644, root, root) %{_libdir}/mysql/libmysqld.a
 
 # The spec file changelog only includes changes made to the spec file
 # itself - note that they must be ordered by date (important when
 # merging BK trees)
 %changelog
+* Thu Aug 13 2009 - Mon Aug 17 2009 Joerg Bruehe <joerg.bruehe@stripped>
+
+- Start a general spec file cleanup, to avoid unnecessary differences:
+  - Eliminate trailing blanks.
+  - Use "tab" for indenting build options.
+  - Let MYSQL_BUILD_CC override CC (similar for CXX).
+  - Add marker blocks for various sections.
+
 * Fri Nov 07 2008 Joerg Bruehe <joerg@stripped>
 
 - Correct yesterday's fix, so that it also works for the last flag,
   and fix a wrong quoting: un-quoted quote marks must not be escaped.
-  
+
 * Thu Nov 06 2008 Kent Boortz <kent.boortz@stripped>
 
 - Removed "mysql_upgrade_shell"
@@ -861,7 +928,7 @@ fi
 
 - Modify CFLAGS and CXXFLAGS such that a debug build is not optimized.
   This should cover both gcc and icc flags.  Fixes bug#40546.
-  
+
 * Fri Aug 29 2008 Kent Boortz <kent@stripped>
 
 - Removed the "Federated" storage engine option, and enabled in all
@@ -896,7 +963,7 @@ fi
 
 * Wed May 02 2007 Joerg Bruehe <joerg@stripped>
 
-- "ndb_size.tmpl" is not needed any more, 
+- "ndb_size.tmpl" is not needed any more,
   "man1/mysql_install_db.1" lacked the trailing '*'.
 
 * Sat Apr 07 2007 Kent Boortz <kent@stripped>
@@ -935,12 +1002,12 @@ fi
 
 * Thu Nov 30 2006 Joerg Bruehe <joerg@stripped>
 
-- Call "make install" using "benchdir_root=%{_datadir}", 
+- Call "make install" using "benchdir_root=%{_datadir}",
   because that is affecting the regression test suite as well.
 
 * Thu Nov 16 2006 Joerg Bruehe <joerg@stripped>
 
-- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) 
+- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB)
   replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading
   (bug#22081).
 
@@ -1056,8 +1123,8 @@ fi
 
 * Mon Dec 05 2005 Joerg Bruehe <joerg@stripped>
 
-- Avoid using the "bundled" zlib on "shared" builds: 
-  As it is not installed (on the build system), this gives dependency 
+- Avoid using the "bundled" zlib on "shared" builds:
+  As it is not installed (on the build system), this gives dependency
   problems with "libtool" causing the build to fail.
   (Change was done on Nov 11, but left uncommented.)
 
@@ -1247,7 +1314,7 @@ fi
 
 * Thu Feb 12 2004 Lenz Grimmer <lenz@stripped>
 
-- when using gcc, _always_ use CXX=gcc 
+- when using gcc, _always_ use CXX=gcc
 - replaced Copyright with License field (Copyright is obsolete)
 
 * Tue Feb 03 2004 Lenz Grimmer <lenz@stripped>
@@ -1337,7 +1404,7 @@ fi
 
 * Wed Nov 27 2002 Lenz Grimmer <lenz@stripped>
 
-- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of 
+- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
   Linux distributions now support this scheme as proposed by the LSB either
   directly or via a compatibility symlink)
 - Use new "restart" init script action instead of starting and stopping
@@ -1352,7 +1419,7 @@ fi
   (mixing 3.23 and 4.0 packages)
 
 * Fri Aug 09 2002 Lenz Grimmer <lenz@stripped>
- 
+
 - Turn off OpenSSL in MySQL-Max for now until it works properly again
 - enable RAID for the Max binary instead
 - added compatibility link: safe_mysqld -> mysqld_safe to ease the


Attachment: [text/bzr-bundle] bzr/joerg@mysql.com-20090819113949-z4nfcjuwcpf5p5p7.bundle
Thread
bzr commit into mysql-5.1 branch (joerg:2872)Joerg Bruehe19 Aug