%define Werror_cflags %nil %define _disable_ld_no_undefined 1 #(ie. use with rpm --rebuild): # # --with debug Compile with debugging code # # enable build with debugging code: will _not_ strip away any debugging code, # will _add_ -g3 to CFLAGS, will _add_ --enable-maintainer-mode to # configure. %define build_debug 0 %define build_test 0 # commandline overrides: # rpm -ba|--rebuild --with 'xxx' %{?_with_debug: %{expand: %%define build_debug 1}} %{?_with_test: %{expand: %%define build_test 1}} %{?_without_test: %global build_test 0} %if %{build_debug} # disable build root strip policy %define __spec_install_post %{_libdir}/rpm/brp-compress || : # This gives extra debuggin and huge binaries %{expand:%%define optflags %{optflags} %([ ! $DEBUG ] && echo '-g3')} %endif %if %{build_debug} %define build_debug 1 %endif %if %{build_test} %define build_test 1 %endif %define _requires_exceptions perl(this) %define major 16 %define libname %mklibname mysql %{major} %define develname %mklibname -d mysql %define staticdevelname %mklibname -d -s mysql %define muser mysql Summary: A very fast and reliable SQL database engine Name: mysql Version: 5.5.8 Release: %mkrel 5 Group: Databases License: GPL URL: http://www.mysql.com/ Source0: http://mysql.dataphone.se/Downloads/MySQL-5.1/mysql-%{version}.tar.gz Source1: http://mysql.dataphone.se/Downloads/MySQL-5.1/mysql-%{version}.tar.gz.asc Source2: mysqld.sysconfig Source3: my.cnf Source4: libmysql.version # fedora patches Patch0: mysql-errno.patch Patch1: mysql-strmov.patch Patch2: mysql-install-test.patch Patch3: mysql-expired-certs.patch Patch4: mysql-stack-guard.patch Patch5: mysql-chain-certs.patch Patch6: mysql-versioning.patch Patch7: mysql-dubious-exports.patch Patch8: mysql-disable-test.patch # mandriva patches Patch100: mysql-mysqldumpslow_no_basedir.diff Patch101: mysql-logrotate.diff Patch102: mysql-initscript.diff Patch103: mysql_upgrade-exit-status.patch Patch104: mysql-5.1.31-shebang.patch Patch105: mysql-5.1.35-test-variables-big.patch Patch106: mysql-5.1.36-hotcopy.patch Patch107: mysql-install_db-quiet.patch Patch108: mysql-5.5.8-bug58350.diff Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper Requires(post): mysql-common = %{version}-%{release} Requires(preun): mysql-common = %{version}-%{release} Requires(post): mysql-client = %{version}-%{release} Requires(preun): mysql-client = %{version}-%{release} Requires(postun): mysql-common = %{version}-%{release} Requires(postun): mysql-client = %{version}-%{release} Requires: mysql-common = %{version}-%{release} Requires: mysql-core = %{version}-%{release} Requires: mysql-client = %{version}-%{release} BuildRequires: bison BuildRequires: cmake BuildRequires: dos2unix BuildRequires: doxygen BuildRequires: glibc-devel BuildRequires: libaio-devel BuildRequires: libstdc++-devel BuildRequires: libtermcap-devel BuildRequires: multiarch-utils >= 1.0.3 BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: python BuildRequires: readline-devel BuildRequires: systemtap BuildRequires: tetex BuildRequires: texinfo BuildRequires: xfs-devel BuildRequires: zlib-devel BuildConflicts: edit-devel Provides: msqlormysql mysqlserver Provides: mysql-max = %{version}-%{release} Obsoletes: mysql-max < 5.1.43 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, 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 MySQL AB. The mysql server is compiled with the following storage engines: - InnoDB Storage Engine - Archive Storage Engine - CSV Storage Engine - Federated Storage Engine - User Defined Functions (UDFs). - Blackhole Storage Engine - Partition Storage Engine - Perfschema Storage Engine %package core Summary: Server core binary Group: System/Servers Conflicts: mysql < 5.1.39-3 Conflicts: mysql-max < 5.1.43 Requires: mysql-common-core >= %{version}-%{release} %description core Core mysqld server binary. For a full MySQL database server, install package 'mysql'. %package common-core Summary: Common files required by core binary Group: System/Servers Conflicts: mysql-common < 5.1.43-1 %description common-core Common files minimally required by mysqld server binary. %package common Summary: Common files Group: System/Servers Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper Requires(post): mysql-client >= %{version}-%{release} Requires(preun): mysql-client >= %{version}-%{release} Requires: mysql-client >= %{version}-%{release} Requires: mysql-common-core >= %{version}-%{release} %description common Common files for the MySQL(TM) database server. %package client Summary: Client Group: Databases Requires(post): %{libname} >= %{version}-%{release} Requires(preun): %{libname} >= %{version}-%{release} Requires: %{libname} >= %{version}-%{release} %description client This package contains the standard MySQL clients. %package bench Summary: Benchmarks and test system Group: System/Servers Requires(post): mysql-client >= %{version}-%{release} Requires(preun): mysql-client >= %{version}-%{release} Requires: mysql-client >= %{version}-%{release} Requires: perl %description bench This package contains MySQL benchmark scripts and data. %package -n %{libname} Summary: Shared libraries Group: System/Libraries Provides: mysql-shared-libs = %{version}-%{release} Provides: mysql-shared = %{version}-%{release} %description -n %{libname} This package contains the shared libraries (*.so*) which certain languages and applications need to dynamically load and use MySQL. %package -n %{develname} Summary: Development header files and libraries Group: Development/Other Requires(post): %{libname} >= %{version}-%{release} Requires(preun): %{libname} >= %{version}-%{release} Requires(post): mysql-common >= %{version}-%{release} Requires(preun): mysql-common >= %{version}-%{release} Requires(post): mysql-client >= %{version}-%{release} Requires(preun): mysql-client >= %{version}-%{release} Requires: %{libname} = %{version}-%{release} Requires: mysql-common >= %{version}-%{release} Requires: mysql-client >= %{version}-%{release} Provides: mysql-devel = %{version}-%{release} Provides: %{libname}-devel = %{version}-%{release} Obsoletes: %{libname}-devel Conflicts: %{mklibname mysql 12 -d} Conflicts: %{mklibname mysql 14 -d} Conflicts: %{mklibname mysql 15 -d} %description -n %{develname} This package contains the development header files and libraries necessary to develop MySQL client applications. This package also contains the MySQL server as an embedded library. The embedded MySQL server library makes it possible to run a full-featured MySQL server inside the client application. The main benefits are increased speed and more simple management for embedded applications. The API is identical for the embedded MySQL version and the client/server version. %package -n %{staticdevelname} Summary: Static development libraries Group: Development/Other Requires: mysql-devel >= %{version}-%{release} Provides: mysql-static-devel = %{version}-%{release} Provides: %{libname}-static-devel = %{version}-%{release} Obsoletes: %{libname}-static-devel %description -n %{staticdevelname} This package contains the static development libraries. %prep %setup -q -n mysql-%{version} # fedora patches %patch0 -p1 -b .errno %patch1 -p1 -b .strmov %patch2 -p1 -b .install-test %patch3 -p1 -b .expired-certs %patch4 -p1 -b .stack-guard %patch5 -p1 -b .chain-certs %patch6 -p1 -b .versioning %patch7 -p1 -b .dubious-exports %patch8 -p1 -b .disable-test # mandriva patches %patch100 -p0 -b .mysqldumpslow_no_basedir %patch101 -p0 -b .logrotate %patch102 -p0 -b .initscript %patch103 -p1 -b .mysql_upgrade-exit-status %patch104 -p1 -b .shebang %patch105 -p0 -b .test-variables-big %patch106 -p0 -b .hotcopy %patch107 -p0 -b .install_db-quiet %patch108 -p1 -b .bug58350 mkdir -p Mageia cp %{SOURCE2} Mageia/mysqld.sysconfig cp %{SOURCE3} Mageia/my.cnf # lib64 fix perl -pi -e "s|/usr/lib/|%{_libdir}/|g" Mageia/my.cnf # antiborker perl -pi -e "s|\@bindir\@|%{_bindir}|g" support-files/* scripts/* perl -pi -e "s|\@sbindir\@|%{_sbindir}|g" support-files/* scripts/* perl -pi -e "s|\@libexecdir\@|%{_sbindir}|g" support-files/* scripts/* perl -pi -e "s|\@localstatedir\@|/var/lib/mysql|g" support-files/* scripts/* perl -pi -e "s|^basedir=.*|basedir=%{_prefix}|g" support-files/* scripts/mysql_install_db* # this may be part of the problems with mysql-test # http://bugs.mysql.com/bug.php?id=52223 #perl -pi -e "s|basedir/lib\b|basedir/%{_lib}\b|g" mysql-test/mysql-test-run.pl #perl -pi -e "s|basedir/lib/|basedir/%{_lib}/|g" mysql-test/mysql-test-run.pl # workaround for upstream bug #56342 rm -f mysql-test/t/ssl_8k_key-master.opt # upstream has fallen down badly on symbol versioning, do it ourselves cp %{SOURCE4} libmysql/libmysql.version %build %serverbuild export CFLAGS="${CFLAGS:-%{optflags}}" export CXXFLAGS="${CXXFLAGS:-%{optflags}}" export FFLAGS="${FFLAGS:-%{optflags}}" %cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DINSTALL_SBINDIR=sbin \ -DMYSQL_DATADIR=/var/lib/mysql \ -DSYSCONFDIR=%{_sysconfdir} \ -DINSTALL_PLUGINDIR=%{_lib}/mysql/plugin \ -DINSTALL_MANDIR=share/man \ -DINSTALL_SHAREDIR=share/mysql \ -DINSTALL_LIBDIR=%{_lib} \ -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_INFODIR=share/info \ -DINSTALL_MYSQLDATADIR=/var/lib/mysql \ -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \ -DINSTALL_SQLBENCHDIR=share/mysql \ -DINSTALL_SUPPORTFILESDIR=share/mysql \ -DINSTALL_MYSQLSHAREDIR=share/mysql \ -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \ -DWITH_READLINE=0 \ -DWITH_LIBEDIT=0 \ -DWITH_LIBWRAP=1 \ -DWITH_SSL=system \ -DWITH_ZLIB=system \ -DWITH_PIC=1 \ -DMYSQL_TCP_PORT=3306 \ -DEXTRA_CHARSETS=all \ -DENABLED_LOCAL_INFILE=1 \ -DENABLE_DTRACE=1 \ -DWITH_EMBEDDED_SERVER=1 \ -DMYSQL_USER=%{muser} \ %if %{build_debug} -DWITH_DEBUG=1 \ %else -DWITH_DEBUG=0 \ %endif -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ -DWITHOUT_NDBCLUSTER_STORAGE_ENGINE=1 \ -DWITHOUT_DAEMON_EXAMPLE=1 \ -DFEATURE_SET="community" \ -DCOMPILATION_COMMENT="Mageia - MySQL Community Edition (GPL)" cp ../libmysql/libmysql.version libmysql/libmysql.version %make %install rm -rf %{buildroot} # don't fiddle with the initscript! export DONT_GPRINTIFY=1 %if %{build_debug} export DONT_STRIP=1 %endif install -d %{buildroot}%{_sysconfdir}/sysconfig install -d %{buildroot}%{_initrddir} install -d %{buildroot}%{_var}/run/mysqld install -d %{buildroot}%{_var}/log/mysqld install -d %{buildroot}/var/lib/mysql/{mysql,test} %makeinstall_std -C build # install init scripts install -m0755 build/support-files/mysql.server %{buildroot}%{_initrddir}/mysqld # install configuration files install -m0644 Mageia/mysqld.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mysqld install -m0644 Mageia/my.cnf %{buildroot}%{_sysconfdir}/my.cnf # bork mv %{buildroot}%{_bindir}/mysqlaccess.conf %{buildroot}%{_sysconfdir}/ chmod 644 %{buildroot}%{_sysconfdir}/mysqlaccess.conf mv %{buildroot}%{_prefix}/scripts/mysql_install_db %{buildroot}%{_bindir}/ mv %{buildroot}%{_datadir}/mysql/aclocal %{buildroot}%{_datadir}/aclocal pushd %{buildroot}%{_bindir} ln -sf mysqlcheck mysqlrepair ln -sf mysqlcheck mysqlanalyze ln -sf mysqlcheck mysqloptimize popd # nuke -Wl,--as-needed from the mysql_config file perl -pi -e "s|^ldflags=.*|ldflags=\'-rdynamic\'|g" %{buildroot}%{_bindir}/mysql_config # cmake generates some completely wacko references to -lprobes_mysql when # building with dtrace support. Haven't found where to shut that off, # so resort to this blunt instrument. While at it, let's not reference # libmysqlclient_r anymore either. sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' \ %{buildroot}%{_bindir}/mysql_config >mysql_config.tmp cp -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config chmod 755 %{buildroot}%{_bindir}/mysql_config # libmysqlclient_r is no more. Upstream tries to replace it with symlinks # but that really doesn't work (wrong soname in particular). We'll keep # just the devel libmysqlclient_r.so link, so that rebuilding without any # source change is enough to get rid of dependency on libmysqlclient_r. rm -f %{buildroot}%{_libdir}/libmysqlclient_r.so* ln -s libmysqlclient.so %{buildroot}%{_libdir}/libmysqlclient_r.so # mysql-test includes one executable that doesn't belong under /usr/share, # so move it and provide a symlink mv %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} ln -s %{_bindir}/my_safe_process %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process # house cleaning rm -rf %{buildroot}%{_datadir}/info rm -f %{buildroot}%{_bindir}/mysqltest_embedded rm -f %{buildroot}%{_bindir}/client_test rm -f %{buildroot}%{_bindir}/make_win_binary_distribution rm -f %{buildroot}%{_bindir}/make_win_src_distribution rm -f %{buildroot}%{_datadir}/mysql/binary-configure rm -f %{buildroot}%{_datadir}/mysql/config.huge.ini rm -f %{buildroot}%{_datadir}/mysql/config.medium.ini rm -f %{buildroot}%{_datadir}/mysql/config.small.ini rm -f %{buildroot}%{_datadir}/mysql/mysqld_multi.server rm -f %{buildroot}%{_datadir}/mysql/mysql-log-rotate rm -f %{buildroot}%{_datadir}/mysql/mysql.server rm -f %{buildroot}%{_datadir}/mysql/ndb-config-2-node.ini rm -f %{buildroot}%{_datadir}/mysql/binary-configure rm -f %{buildroot}%{_mandir}/man1/make_win_bin_dist.1* rm -f %{buildroot}%{_mandir}/man1/make_win_src_distribution.1* rm -f %{buildroot}%{_datadir}/mysql/magic # no idea how to fix this rm -rf %{buildroot}%{_prefix}/data rm -rf %{buildroot}%{_prefix}/docs rm -rf %{buildroot}%{_prefix}/scripts rm -f %{buildroot}%{_prefix}/COPYING rm -f %{buildroot}%{_prefix}/INSTALL-BINARY rm -f %{buildroot}%{_prefix}/README %multiarch_binaries %{buildroot}%{_bindir}/mysql_config %multiarch_includes %{buildroot}%{_includedir}/mysql/my_config.h cat > README.urpmi <