%define mysql_uid 64400 %define mysql_gid 64400 %define mysqldatadir /var/lib/mysql %define _libdir64 %{_prefix}/lib64 Name: mysql Summary: MySQL client programs and shared libraries Group: Applications/Databases URL: http://www.mysql.com/ Version: 5.0.67 Release: 1 # exceptions allow client libraries to be linked with most open source SW, # not only GPL code. License: GPLv2 with exceptions Source0: http://www.mysql.com/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz Source1: http://www.mysql.com/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz.asc Source2: http://www.mysql.com/Downloads/MySQL-5.0/%{name}-%{version}.tar.gz.md5 Source3: mysqld-aix.init Source4: ndbd-aix.init Source5: ndb_mgmd-aix.init Source6: mysql-my_config.h Source7: mysql-ndb_types.h Source8: mysql-my.cnf Source9: mysql-scriptstub.c Source20: %{name}-5.0-switch-to-32_bit.sh Source21: %{name}-5.0-switch-to-64_bit.sh Packager: Michael Perzl BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: perl >= 5.8.8, readline-devel >= 5.2, openssl-devel >= 1.0.1 BuildRequires: make BuildRequires: patch BuildRequires: zlib-devel Requires: info, /sbin/install-info Requires: %{name}-libs = %{version}-%{release} Requires: bash %description MySQL is a multi-user, multi-threaded SQL database server. MySQL is a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries. The base package contains the standard MySQL client programs and generic MySQL files. The database is available as 32-bit and 64-bit. %package libs Summary: The shared libraries required for MySQL clients Group: Applications/Databases Requires: openssl >= 1.0.1 Requires: zlib %description libs The mysql-libs package provides the essential shared libraries for any MySQL client program or interface. You will need to install this package to use any other MySQL package or any clients that need to connect to a MySQL server. The library is available as 32-bit and 64-bit. %package server Summary: The MySQL server and related files Group: Applications/Databases Requires: %{name} = %{version}-%{release} # mysqlhotcopy needs DBI/DBD support Requires: perl-DBI Requires: perl-DBD-MySQL %description server MySQL is a multi-user, multi-threaded SQL database server. MySQL is a client/server implementation consisting of a server daemon (mysqld) and many different client programs and libraries. This package contains the MySQL server and some accompanying files and directories. %package cluster Summary: MySQL Cluster daemons and related files Group: Applications/Databases Requires: %{name} = %{version}-%{release} %description cluster MySQL is a multi-user, multi-threaded SQL database server. MySQL Cluster is a distributed in-memory data store that can be accessed by a MySQL server. This package contains the programs needed to run a MySQL Cluster installation. %package devel Summary: Files for development of MySQL applications Group: Applications/Databases Requires: %{name} = %{version}-%{release} Requires: openssl-devel >= 1.0.1 Requires: zlib-devel %description devel MySQL is a multi-user, multi-threaded SQL database server. This package contains the libraries and header files that are needed for developing MySQL client applications. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "xlc_r -q64" or "gcc -maix64". %package embedded Summary: MySQL as an embeddable library Group: Applications/Databases Requires: openssl >= 1.0.1 Requires: zlib %description embedded MySQL is a multi-user, multi-threaded SQL database server. This package contains a version of the MySQL server that can be embedded into a client application instead of running as a separate process. %package embedded-devel Summary: Development files for MySQL as an embeddable library Group: Applications/Databases Requires: %{name}-embedded = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release} %description embedded-devel MySQL is a multi-user, multi-threaded SQL database server. This package contains files needed for developing and testing with the embedded version of the MySQL server. %package bench Summary: MySQL benchmark scripts and data Group: Applications/Databases Requires: %{name} = %{version}-%{release} %description bench MySQL is a multi-user, multi-threaded SQL database server. This package contains benchmark scripts and data for use when benchmarking MySQL. %package test Summary: The test suite distributed with MySQL Group: Applications/Databases Requires: %{name} = %{version}-%{release} Requires: %{name}-server = %{version}-%{release} %description test MySQL is a multi-user, multi-threaded SQL database server. This package contains the regression test suite distributed with the MySQL sources. ############################################################################ # # # %prep # # # ############################################################################ %prep %setup -q mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) ############################################################################ # # # %build # # # ############################################################################ %build export PATH=/opt/freeware/bin:$PATH export CC="xlc_r -O3 -qstrict" export CXX="xlC_r -O3 -qstrict" export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -I/opt/freeware/include" export CPPFLAGS=${CFLAGS} export CXXFLAGS=${CFLAGS} ############################### 64-bit BEGIN ############################## cd 64bit # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --localstatedir=/var/lib/%{name} \ --enable-shared \ --enable-thread-safe-client \ --enable-assembler \ --enable-largefile \ --enable-local-infile \ --without-debug \ --with-readline \ --with-extra-charsets=all \ --with-zlib-dir=%{_prefix} \ --with-fast-mutexes \ --with-mysqld-user=mysql \ --with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-big-tables \ --with-ssl \ --with-openssl=%{_prefix} \ --with-comment="MySQL Community Server (GPL)" \ --with-archive-storage-engine \ --with-innodb \ --with-plugin-innobase \ --with-ndbcluster \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-blackhole-storage-engine \ --with-federated-storage-engine \ --with-partition \ --with-embedded-server $CC $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/%{name}\"" %{SOURCE9} gmake -j 8 gmake %{?_smp_mflags} # regular build will make libmysqld.a but not libmysqld.so :-( mkdir libmysqld/work cd libmysqld/work CreateExportList -X64 %{name}.exp ../lib%{name}d.a $CXX $CFLAGS -q64 -qmkshrobj ../lib%{name}d.a -o lib%{name}d.so -bE:%{name}.exp \ -L/opt/freeware/lib -lcrypt -lssl -lcrypto -lz -lm rm -f %{name}.exp /usr/bin/ar -rv lib%{name}d.a lib%{name}d.so cd ../.. ############################### 64-bit END ############################## ############################### 32-bit BEGIN ############################## cd ../32bit # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --localstatedir=/var/lib/%{name} \ --enable-shared \ --enable-thread-safe-client \ --enable-assembler \ --enable-largefile \ --enable-local-infile \ --without-debug \ --with-readline \ --with-extra-charsets=all \ --with-zlib-dir=%{_prefix} \ --with-fast-mutexes \ --with-mysqld-user=mysql \ --with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-big-tables \ --with-ssl \ --with-openssl=%{_prefix} \ --with-comment="MySQL Community Server (GPL)" \ --with-archive-storage-engine \ --with-innodb \ --with-plugin-innobase \ --with-ndbcluster \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-blackhole-storage-engine \ --with-federated-storage-engine \ --with-partition \ --with-embedded-server $CC $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/%{name}\"" %{SOURCE9} gmake -j 8 gmake %{?_smp_mflags} # regular build will make libmysqld.a but not libmysqld.so :-( mkdir libmysqld/work cd libmysqld/work CreateExportList -X32 %{name}.exp ../lib%{name}d.a $CXX $CFLAGS -q32 -qmkshrobj ../lib%{name}d.a -o lib%{name}d.so -bE:%{name}.exp \ -L/opt/freeware/lib -lcrypt -lssl -lcrypto -lz -lm rm -f %{name}.exp /usr/bin/ar -rv lib%{name}d.a lib%{name}d.so ############################### 32-bit END ############################## ############################################################################ # # # %install # # # ############################################################################ %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 64bit export OBJECT_MODE=64 gmake install DESTDIR=${RPM_BUILD_ROOT} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done cd ${RPM_BUILD_ROOT}%{_libexecdir} for f in * ; do mv -f ${f} ${f}_64 done ) # multilib header hacks mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}/my_config.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/my_config-ppc64.h mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ndb/ndb_types.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ndb/ndb_types-ppc64.h rm -f ${RPM_BUILD_ROOT}%{_libdir64}/%{name}/libmysqld.a cp libmysqld/work/libmysqld.a ${RPM_BUILD_ROOT}%{_libdir64}/%{name} chmod 0644 ${RPM_BUILD_ROOT}%{_libdir64}/%{name}/libmysqld.a mv ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug_64 ${RPM_BUILD_ROOT}%{_libdir64}/%{name}/mysqlbug cp scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug_64 chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug_64 mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config_64 ${RPM_BUILD_ROOT}%{_libdir64}/mysql/mysql_config cp scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config_64 chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/mysql_config_64 # # fix wrong shared library path for # %{_libexecdir}/mysqld_64 # %{_libexecdir}/ndb_mgmd_64 # cd sql rm mysqld gmake -n mysqld | sed 's|.libs\/libndbclient.a|libndbclient.la|g' | sh rm -f ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld_64 cp .libs/mysqld ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld_64 chmod 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld_64 cd ../ndb/src/mgmsrv rm ndb_mgmd gmake ndb_mgmd | tail -1 > cmd.txt rm ndb_mgmd cat cmd.txt | sed 's|:/opt/freeware/src/packages/BUILD/mysql-5.0.67/64bit/ndb/src/.libs||g' | sh cp ndb_mgmd ${RPM_BUILD_ROOT}%{_libexecdir}/ndb_mgmd_64 chmod 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/ndb_mgmd_64 cd ../../../../32bit export OBJECT_MODE=32 gmake install DESTDIR=${RPM_BUILD_ROOT} # multilib header hacks mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}/my_config.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/my_config-ppc32.h cp %{SOURCE6} ${RPM_BUILD_ROOT}%{_includedir}/%{name}/my_config.h mv ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ndb/ndb_types.h ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ndb/ndb_types-ppc32.h cp %{SOURCE7} ${RPM_BUILD_ROOT}%{_includedir}/%{name}/ndb/ndb_types.h chmod 0644 ${RPM_BUILD_ROOT}%{_includedir}/%{name}/*.h rm -f ${RPM_BUILD_ROOT}%{_libdir}/%{name}/libmysqld.a cp libmysqld/work/libmysqld.a ${RPM_BUILD_ROOT}%{_libdir}/%{name} chmod 0644 ${RPM_BUILD_ROOT}%{_libdir}/%{name}/libmysqld.a mv ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug ${RPM_BUILD_ROOT}%{_libdir}/%{name}/mysqlbug cp scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/mysqlbug mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/mysql_config cp scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config chmod 0755 ${RPM_BUILD_ROOT}%{_bindir}/mysql_config # # fix wrong shared library path for # %{_libexecdir}/mysqld # %{_libexecdir}/ndb_mgmd # cd sql rm mysqld gmake -n mysqld | sed 's|.libs\/libndbclient.a|libndbclient.la|g' | sh rm -f ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld cp .libs/mysqld ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld chmod 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/mysqld cd ../ndb/src/mgmsrv rm ndb_mgmd gmake ndb_mgmd | tail -1 > cmd.txt rm ndb_mgmd cat cmd.txt | sed 's|:/opt/freeware/src/packages/BUILD/mysql-5.0.67/32bit/ndb/src/.libs||g' | sh cp ndb_mgmd ${RPM_BUILD_ROOT}%{_libexecdir}/ndb_mgmd chmod 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/ndb_mgmd # rename all 32-bit binaries to _32 ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in `ls -1 | grep -v _64` ; do mv -f ${f} ${f}_32 done cd ${RPM_BUILD_ROOT}%{_libexecdir} for f in `ls -1 | grep -v _64` ; do mv -f ${f} ${f}_32 done ) /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_libexecdir}/* || : # make the 64-bit version the default version ( cd ${RPM_BUILD_ROOT}%{_bindir} for file in `ls -1 | grep -v _64` ; do f=`basename ${file} _32` ln -s ${f}_64 ${f} done cp %{SOURCE20} ./%{name}-switch-to-32_bit.sh cp %{SOURCE21} ./%{name}-switch-to-64_bit.sh chmod 0755 %{name}-switch-to-*.sh cd ${RPM_BUILD_ROOT}%{_libexecdir} for file in `ls -1 | grep -v _64` ; do f=`basename ${file} _32` ln -s ${f}_64 ${f} done ) rm -f ${RPM_BUILD_ROOT}%{_infodir}/dir gzip -9 ${RPM_BUILD_ROOT}%{_infodir}/* mkdir -p ${RPM_BUILD_ROOT}/var/log touch ${RPM_BUILD_ROOT}/var/log/mysqld.log mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d cp %{SOURCE3} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/mysqld cp %{SOURCE4} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/ndbd cp %{SOURCE5} ${RPM_BUILD_ROOT}/etc/rc.d/init.d/ndb_mgmd chmod 0755 ${RPM_BUILD_ROOT}/etc/rc.d/init.d/* mkdir -p ${RPM_BUILD_ROOT}/var/run/mysqld mkdir -p ${RPM_BUILD_ROOT}/var/lib/mysql mkdir -p ${RPM_BUILD_ROOT}/var/lib/mysql-cluster mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} cp %{SOURCE8} ${RPM_BUILD_ROOT}%{_sysconfdir}/my.cnf chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/my.cnf mv ${RPM_BUILD_ROOT}%{_prefix}/sql-bench ${RPM_BUILD_ROOT}%{_datadir}/sql-bench mv ${RPM_BUILD_ROOT}%{_prefix}/mysql-test ${RPM_BUILD_ROOT}%{_datadir}/mysql-test rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1* rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_binary_distribution* rm -f ${RPM_BUILD_ROOT}%{_bindir}/make_win_src_distribution* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_bin_dist.1 rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/make_win_src_distribution.1 rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/binary-configure rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/make_binary_distribution rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/make_sharedlib_distribution rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/mi_test_all* rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/mysql.server rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/mysqld_multi.server rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/MySQL-shared-compat.spec rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/*.plist rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/preinstall rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/postinstall rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/mysql-*.spec rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/mysql-log-rotate rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/ChangeLog rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-stress-test.pl.1 rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/mysql-test-run.pl.1 rm -f ${RPM_BUILD_ROOT}%{_libexecdir}/ndb_cpcd* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/ndb_cpcd.1 # for the moment, remove ndb_size because of dependency on HTML::Template rm -f ${RPM_BUILD_ROOT}%{_bindir}/ndb_size.pl* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/ndb_size.pl.1* rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/ndb_size.tmpl # extract shared libraries for run-time linking ( cd ${RPM_BUILD_ROOT}%{_libdir}/%{name} for f in libmysqlclient.a libmysqlclient_r.a libndbclient.a ; do ar -X32 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir64}/%{name} for f in libmysqlclient.a libmysqlclient_r.a libndbclient.a ; do ar -X64 -x ${f} done ) %pre server # Shut down a previously installed server first if test -x /etc/rc.d/init.d/mysqld then /etc/rc.d/init.d/mysqld stop > /dev/null 2>&1 echo "Giving mysqld a couple of seconds to exit nicely" sleep 5 fi # add the "mysql" group only if it does not yet exist result=`/usr/sbin/lsgroup mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkgroup -A id=%{mysql_gid} mysql 2> /dev/null || : fi # add the "mysql" user only if it does not yet exist result=`/usr/sbin/lsuser mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkuser id=%{mysql_uid} pgrp='mysql' gecos='MySQL Server' \ login='false' rlogin='false' mysql 2> /dev/null || : fi %preun server if [ "$1" = "0" ] ; then # Stop MySQL before uninstalling it if test -x /etc/rc.d/init.d/mysqld then /etc/rc.d/init.d/mysqld stop > /dev/null fi # Remove autostart of MySQL rm -f /etc/rc.d/rc2.d/Smysqld rm -f /etc/rc.d/rc2.d/Kmysqld rm -f /etc/rc.d/rc3.d/Smysqld rm -f /etc/rc.d/rc3.d/Kmysqld # remove "mysql" user and group /usr/sbin/rmuser -p mysql || : /usr/sbin/rmgroup mysql || : fi %pre cluster # add the "mysql" group only if it does not yet exist result=`/usr/sbin/lsgroup mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkgroup -A id=%{mysql_gid} mysql 2> /dev/null || : fi # add the "mysql" user only if it does not yet exist result=`/usr/sbin/lsuser mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkuser id=%{mysql_uid} pgrp='mysql' gecos='MySQL Server' \ login='false' rlogin='false' mysql 2> /dev/null || : fi %preun cluster if [ "$1" = "0" ] ; then # Remove autostart of ndb_mgmd rm -f /etc/rc.d/rc2.d/Sndb_mgmd rm -f /etc/rc.d/rc2.d/Kndb_mgmd rm -f /etc/rc.d/rc3.d/Sndb_mgmd rm -f /etc/rc.d/rc3.d/Kndb_mgmd # Remove autostart of ndbd rm -f /etc/rc.d/rc2.d/Sndbd rm -f /etc/rc.d/rc2.d/Kndbd rm -f /etc/rc.d/rc3.d/Sndbd rm -f /etc/rc.d/rc3.d/Kndbd fi %preun if [ "$1" = "0" ] ; then /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || : fi %post /sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || : %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 # Add autostart of mysqld ln -sf '../init.d/mysqld' /etc/rc.d/rc2.d/Smysqld ln -sf '../init.d/mysqld' /etc/rc.d/rc2.d/Kmysqld ln -sf '../init.d/mysqld' /etc/rc.d/rc3.d/Smysqld ln -sf '../init.d/mysqld' /etc/rc.d/rc3.d/Kmysqld # add the "mysql" group only if it does not yet exist result=`/usr/sbin/lsgroup mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkgroup -A id=%{mysql_gid} mysql 2> /dev/null || : fi # add the "mysql" user only if it does not yet exist result=`/usr/sbin/lsuser mysql | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [[ "${result}" != "mysql" ]] ; then /usr/bin/mkuser id=%{mysql_uid} pgrp='mysql' gecos='MySQL Server' \ login='false' rlogin='false' mysql 2> /dev/null || : fi # Change permissions so that the user that will run the MySQL daemon # owns all database files. chown -R mysql:mysql ${mysql_datadir} # Initiate databases if needed %{_bindir}/mysql_install_db --rpm --user=mysql # Upgrade databases if needed would go here - but it cannot be automated yet # Change permissions again to fix any new files. chown -R mysql:mysql ${mysql_datadir} # Fix permissions for the permission database so that only the user # can read them. chmod -R og-rw ${mysql_datadir}/mysql # Restart in the same way that mysqld will be started normally. /etc/rc.d/init.d/mysqld start # Allow mysqld_safe to start mysqld and print a message before we exit sleep 2 %post cluster if [ "$1" = "1" ]; then # Add autostart of ndb_mgmd ln -sf '../init.d/ndb_mgmd' /etc/rc.d/rc2.d/Sndb_mgmd ln -sf '../init.d/ndb_mgmd' /etc/rc.d/rc2.d/Kndb_mgmd ln -sf '../init.d/ndb_mgmd' /etc/rc.d/rc3.d/Sndb_mgmd ln -sf '../init.d/ndb_mgmd' /etc/rc.d/rc3.d/Kndb_mgmd # Add autostart of ndbd ln -sf '../init.d/ndbd' /etc/rc.d/rc2.d/Sndbd ln -sf '../init.d/ndbd' /etc/rc.d/rc2.d/Kndbd ln -sf '../init.d/ndbd' /etc/rc.d/rc3.d/Sndbd ln -sf '../init.d/ndbd' /etc/rc.d/rc3.d/Kndbd fi /usr/bin/chmod 0755 /var/lib/mysql-cluster %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc 32bit/README 32bit/COPYING 32bit/EXCEPTIONS-CLIENT %{_bindir}/msql2mysql* %{_bindir}/mysql %{_bindir}/mysql_?? %{_bindir}/mysql_config* %{_bindir}/mysql_find_rows* %{_bindir}/mysql_tableinfo* %{_bindir}/mysql_waitpid* %{_bindir}/mysqlaccess* %{_bindir}/mysqladmin* %{_bindir}/mysqlbinlog* %{_bindir}/mysqlcheck* %{_bindir}/mysqldump %{_bindir}/mysqldump_?? %{_bindir}/mysqlimport* %{_bindir}/mysqlshow* %{_bindir}/my_print_defaults* %{_bindir}/%{name}-switch-to-*.sh %{_infodir}/* %{_mandir}/man1/mysql.1 %{_mandir}/man1/mysql_config.1 %{_mandir}/man1/mysql_find_rows.1 %{_mandir}/man1/mysql_tableinfo.1 %{_mandir}/man1/mysql_waitpid.1 %{_mandir}/man1/mysqlaccess.1 %{_mandir}/man1/mysqladmin.1 %{_mandir}/man1/mysqldump.1 %{_mandir}/man1/mysqlman.1 %{_mandir}/man1/mysqlshow.1 %{_mandir}/man1/my_print_defaults.1 %{_libdir}/%{name}/mysqlbug %{_libdir64}/%{name}/mysqlbug %{_libdir}/%{name}/mysql_config %{_libdir64}/%{name}/mysql_config %files libs %defattr(-,root,system) # although the default my.cnf contains only server settings, we put it in the # libs package because it can be used for client settings too. %config(noreplace) %{_sysconfdir}/my.cnf %dir %{_libdir}/%{name} %{_libdir}/%{name}/libmysqlclient*.a %{_libdir64}/%{name}/libmysqlclient*.a %{_libdir}/%{name}/libmysqlclient*.so.* %{_libdir64}/%{name}/libmysqlclient*.so.* %{_libdir}/%{name}/libndbclient.a %{_libdir64}/%{name}/libndbclient.a %{_libdir}/%{name}/libndbclient.so.* %{_libdir64}/%{name}/libndbclient.so.* %dir %{_datadir}/%{name} %{_datadir}/%{name}/english %lang(cs) %{_datadir}/%{name}/czech %lang(da) %{_datadir}/%{name}/danish %lang(nl) %{_datadir}/%{name}/dutch %lang(et) %{_datadir}/%{name}/estonian %lang(fr) %{_datadir}/%{name}/french %lang(de) %{_datadir}/%{name}/german %lang(el) %{_datadir}/%{name}/greek %lang(hu) %{_datadir}/%{name}/hungarian %lang(it) %{_datadir}/%{name}/italian %lang(ja) %{_datadir}/%{name}/japanese %lang(ko) %{_datadir}/%{name}/korean %lang(no) %{_datadir}/%{name}/norwegian %lang(no) %{_datadir}/%{name}/norwegian-ny %lang(pl) %{_datadir}/%{name}/polish %lang(pt) %{_datadir}/%{name}/portuguese %lang(ro) %{_datadir}/%{name}/romanian %lang(ru) %{_datadir}/%{name}/russian %lang(sr) %{_datadir}/%{name}/serbian %lang(sk) %{_datadir}/%{name}/slovak %lang(es) %{_datadir}/%{name}/spanish %lang(sv) %{_datadir}/%{name}/swedish %lang(uk) %{_datadir}/%{name}/ukrainian %{_datadir}/%{name}/charsets %files server %defattr(-,root,system) %doc 32bit/support-files/*.cnf %{_bindir}/innochecksum* %{_bindir}/myisam_ftdump* %{_bindir}/myisamchk* %{_bindir}/myisamlog* %{_bindir}/myisampack* %{_bindir}/mysql_convert_table_format* %{_bindir}/mysql_explain_log* %{_bindir}/mysql_fix_extensions* %{_bindir}/mysql_fix_privilege_tables* %{_bindir}/mysql_install_db* %{_bindir}/mysql_secure_installation* %{_bindir}/mysql_setpermission* %{_bindir}/mysql_tzinfo_to_sql* %{_bindir}/mysql_upgrade* %{_bindir}/mysql_zap* %{_bindir}/mysqlbug* %{_bindir}/mysqldumpslow* %{_bindir}/mysqld_multi* %{_bindir}/mysqld_safe* %{_bindir}/mysqlhotcopy* %{_bindir}/mysqltestmanager* %{_bindir}/mysqltest %{_bindir}/mysqltest_?? %{_bindir}/perror* %{_bindir}/replace* %{_bindir}/resolve_stack_dump* %{_bindir}/resolveip* %{_libexecdir}/mysqld* %{_libexecdir}/mysqlmanager* %{_mandir}/man1/innochecksum.1 %{_mandir}/man1/msql2mysql.1 %{_mandir}/man1/myisam_ftdump.1 %{_mandir}/man1/myisamchk.1 %{_mandir}/man1/myisamlog.1 %{_mandir}/man1/myisampack.1 %{_mandir}/man1/mysql_convert_table_format.1 %{_mandir}/man1/mysql_explain_log.1 %{_mandir}/man1/mysql_fix_extensions.1 %{_mandir}/man1/mysql_fix_privilege_tables.1 %{_mandir}/man1/mysql_install_db.1 %{_mandir}/man1/mysql_secure_installation.1 %{_mandir}/man1/mysql_setpermission.1 %{_mandir}/man1/mysql_tzinfo_to_sql.1 %{_mandir}/man1/mysql_upgrade.1 %{_mandir}/man1/mysql_zap.1 %{_mandir}/man1/mysql.server.1 %{_mandir}/man1/mysqlbinlog.1 %{_mandir}/man1/mysqlbug.1 %{_mandir}/man1/mysqlcheck.1 %{_mandir}/man1/mysqld_multi.1 %{_mandir}/man1/mysqld_safe.1 %{_mandir}/man1/mysqlhotcopy.1 %{_mandir}/man1/mysqlimport.1 %{_mandir}/man1/mysqlmanager-pwgen.1 %{_mandir}/man1/mysqlmanagerc.1 %{_mandir}/man1/mysqltest.1 %{_mandir}/man1/perror.1 %{_mandir}/man1/replace.1 %{_mandir}/man1/resolve_stack_dump.1 %{_mandir}/man1/resolveip.1 %{_mandir}/man1/safe_mysqld.1 %{_mandir}/man8/mysqld.8 %{_mandir}/man8/mysqlmanager.8 %{_datadir}/%{name}/errmsg.txt %{_datadir}/%{name}/fill_help_tables.sql %{_datadir}/%{name}/mysql_fix_privilege_tables.sql %{_datadir}/%{name}/mysql_system_tables.sql %{_datadir}/%{name}/mysql_system_tables_data.sql %{_datadir}/%{name}/mysql_test_data_timezone.sql %{_datadir}/%{name}/my-*.cnf /etc/rc.d/init.d/mysqld %attr(0755,mysql,mysql) %dir /var/run/mysqld %attr(0755,mysql,mysql) %dir /var/lib/mysql %attr(0640,mysql,mysql) %config(noreplace) %verify(not md5 size mtime) /var/log/mysqld.log %files cluster %defattr(-,root,system) %{_bindir}/ndb_config* %{_bindir}/ndb_delete_all* %{_bindir}/ndb_desc* %{_bindir}/ndb_drop_index* %{_bindir}/ndb_drop_table* %{_bindir}/ndb_error_reporter* %{_bindir}/ndb_mgm* %{_bindir}/ndb_restore* %{_bindir}/ndb_select_all* %{_bindir}/ndb_select_count* %{_bindir}/ndb_show_tables* %{_bindir}/ndb_test_platform* %{_bindir}/ndb_waiter* %{_libexecdir}/ndb_mgmd* %{_libexecdir}/ndbd* %{_datadir}/%{name}/ndb-*.ini /etc/rc.d/init.d/ndbd /etc/rc.d/init.d/ndb_mgmd %attr(0755,mysql,mysql) %dir /var/lib/mysql-cluster %{_mandir}/man1/ndb_config.1 %{_mandir}/man1/ndb_delete_all.1 %{_mandir}/man1/ndb_desc.1 %{_mandir}/man1/ndb_drop_index.1 %{_mandir}/man1/ndb_drop_table.1 %{_mandir}/man1/ndb_error_reporter.1 %{_mandir}/man1/ndb_mgm.1 %{_mandir}/man1/ndb_print_backup_file.1 %{_mandir}/man1/ndb_print_schema_file.1 %{_mandir}/man1/ndb_print_sys_file.1 %{_mandir}/man1/ndb_restore.1 %{_mandir}/man1/ndb_select_all.1 %{_mandir}/man1/ndb_select_count.1 %{_mandir}/man1/ndb_show_tables.1 %{_mandir}/man1/ndb_waiter.1 %{_mandir}/man8/ndb_mgmd.8 %{_mandir}/man8/ndbd.8 %files devel %defattr(-,root,system) %{_includedir}/%{name} %{_libdir}/%{name}/libdbug.a %{_libdir64}/%{name}/libdbug.a %{_libdir}/%{name}/libheap.a %{_libdir64}/%{name}/libheap.a %{_libdir}/%{name}/libmyisam.a %{_libdir64}/%{name}/libmyisam.a %{_libdir}/%{name}/libmyisammrg.a %{_libdir64}/%{name}/libmyisammrg.a %{_libdir}/%{name}/libmystrings.a %{_libdir64}/%{name}/libmystrings.a %{_libdir}/%{name}/libmysys.a %{_libdir64}/%{name}/libmysys.a %{_libdir}/%{name}/libvio.a %{_libdir64}/%{name}/libvio.a %{_libdir}/%{name}/libmysqlclient*.la %{_libdir64}/%{name}/libmysqlclient*.la %{_libdir}/%{name}/libndbclient*.la %{_libdir64}/%{name}/libndbclient*.la %files embedded %defattr(-,root,system) %{_libdir}/%{name}/libmysqld.a %{_libdir64}/%{name}/libmysqld.a %files embedded-devel %defattr(-,root,system) %{_bindir}/mysql_client_test_embedded* %{_bindir}/mysqltest_embedded* %{_mandir}/man1/mysql_client_test_embedded.1 %{_mandir}/man1/mysqltest_embedded.1 %files bench %defattr(-,root,system) %{_datadir}/sql-bench %files test %defattr(-,root,system) %{_bindir}/mysql_client_test %{_bindir}/mysql_client_test_?? %attr(-,mysql,mysql) %{_datadir}/mysql-test %{_mandir}/man1/mysql_client_test.1 %changelog * Wed Nov 25 2009 Michael Perzl - 5.0.67-1 - first version for AIX V5.1 and higher