#(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 major 18 %define libmariadbembedded_major 0 %define libmariadbembedded_minor 0.1 %define libname %mklibname mariadb %{major} %define libmariadbservices %mklibname mariadbservices %define libmariadbembedded %mklibname mariadb-embedded %{libmariadbembedded_major} %define develname %mklibname -d mariadb %define old_staticdevelname %mklibname -d -s mariadb %define libmariadbembedded_devel %mklibname -d mariadb-embedded %define mirror http://mirror2.hs-esslingen.de/mariadb %define snapshotdate 20111107 %define muser mysql Summary: A very fast and reliable SQL database engine Name: mariadb Version: 5.5.15 Release: %mkrel 0.bzr%snapshotdate.5 Group: Databases License: GPLv2 with exceptions URL: http://mariadb.org/ Source0: %{mirror}/%{name}-%{version}/kvm-tarbake-jaunty-x86/%{name}-%{version}.tar.gz Source2: mysqld.sysconfig Source3: my.cnf Source4: libmysql.version Source10: mysql.tmpfiles.d Source11: mysqld.service Source12: mysqld-prepare-db-dir Source13: mysqld-wait-ready # the following patches are rediffed from the mysql-5.5 src.rpm to mariadb-5.5 # fedora patches Patch1: mariadb-5.5-errno.patch Patch2: mariadb-5.5-strmov.patch Patch3: mariadb-5.5-install-test.patch Patch4: mysql-expired-certs.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886368 Patch5: mariadb-5.5-stack-guard.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886378 Patch6: mariadb-5.5-chain-certs.patch Patch7: mariadb-5.5-versioning.patch Patch8: mariadb-5.5-dubious-exports.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886476 Patch9: mariadb-5.5-disable-test.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886479 Patch10: mariadb-5.5-plugin-bool.patch Patch12: mysql-openssl-test.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886484 Patch13: mariadb-5.5-mysqld-nowatch.patch # mandriva patches Patch101: mariadb-5.5-logrotate.patch Patch102: mariadb-5.5-initscript.patch Patch103: mariadb-5.5-mysql_upgrade-exit-status.patch # filed upstream: https://bugs.launchpad.net/maria/+bug/886526 Patch104: mariadb-5.5-shebang.patch # unsure if still required #Patch105: mysql-5.1.35-test-variables-big.patch Patch106: mariadb-5.5-hotcopy.patch Patch107: mariadb-5.5-mysql_install_db-quiet.patch # mageia patches # (ahmad) add patch to fix some header files location (hint from Mandriva) # filed upstream: https://bugs.launchpad.net/maria/+bug/886550 Patch110: mariadb-5.5-fix-headers-location.patch Requires(post): rpm-helper Requires(preun): rpm-helper Requires(pre): rpm-helper Requires(postun): rpm-helper Requires(post): %{name}-common = %{version}-%{release} Requires(preun): %{name}-common = %{version}-%{release} Requires(post): %{name}-client = %{version}-%{release} Requires(preun): %{name}-client = %{version}-%{release} Requires(postun): %{name}-common = %{version}-%{release} Requires(postun): %{name}-client = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} Requires: %{name}-core = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} Provides: mysql BuildRequires: bison BuildRequires: cmake 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: wrap-devel BuildRequires: python BuildRequires: readline-devel BuildRequires: systemtap BuildRequires: tetex BuildRequires: texinfo BuildRequires: xfs-devel BuildRequires: zlib-devel BuildRequires: boost-devel BuildConflicts: edit-devel %description The MariaDB software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. The mariadb server is compiled with the following storage engines: - Aria Storage Engine - Archive Storage Engine - Blackhole Storage Engine - CSV Storage Engine - Federated Storage Engine - FederatedX Storage Engine - Heap Storage Engine - InnoDB Storage Engine - MyISAM Storage Engine - MyISAMMRG Storage Engine - OQGraph Storage Engine - Partition Storage Engine - Perfschema Storage Engine - Sphinx Storage Engine - XtraDB Storage Engine %package core Summary: Server core binary Group: System/Servers Requires: %{name}-common-core >= %{version}-%{release} Provides: mysql-core %description core Core mysqld server binary. For a full MariaDB database server, install package 'mariadb'. %package common-core Summary: Common files required by core binary Group: System/Servers Provides: mysql-common-core %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): %{name}-client >= %{version}-%{release} Requires(preun): %{name}-client >= %{version}-%{release} Requires: %{name}-client >= %{version}-%{release} Requires: %{name}-common-core >= %{version}-%{release} Provides: mysql-common %description common Common files for the MariaDB database server. %package client Summary: Client Group: Databases Requires(post): %{libname} >= %{version}-%{release} Requires(preun): %{libname} >= %{version}-%{release} Requires: %{libname} >= %{version}-%{release} Provides: mysql-client %description client This package contains the standard MariaDB clients. %package bench Summary: Benchmarks and test system Group: System/Servers Requires(post): %{name}-client >= %{version}-%{release} Requires(preun): %{name}-client >= %{version}-%{release} Requires: %{name}-client >= %{version}-%{release} Provides: mysql-bench %description bench This package contains MariaDB benchmark scripts and data. %package -n %{libname} Summary: Shared libraries Group: System/Libraries Provides: %{name}-shared-libs = %{version}-%{release} Provides: %{name}-shared = %{version}-%{release} Provides: %mklibname mysql %{major} %description -n %{libname} This package contains the shared libraries (*.so*) which certain languages and applications need to dynamically load and use MariaDB. %package -n %{libmariadbservices} Summary: Shared libraries Group: System/Libraries Provides: %mklibname mysqlservices %description -n %{libmariadbservices} The libmariadbservices library provides access to the available services and dynamic plugins now must be linked against this library (use the -lmysqlservices flag). %package -n %{develname} Summary: Development header files and libraries Group: Development/Other Requires(post): %{libname} >= %{version}-%{release} Requires(preun): %{libname} >= %{version}-%{release} Requires(post): %{name}-common >= %{version}-%{release} Requires(preun): %{name}-common >= %{version}-%{release} Requires(post): %{name}-client >= %{version}-%{release} Requires(preun): %{name}-client >= %{version}-%{release} Requires: %{libname} = %{version}-%{release} Requires: %{libmariadbservices} = %{version}-%{release} Requires: %{name}-common >= %{version}-%{release} Requires: %{name}-client >= %{version}-%{release} Provides: %{name}-devel = %{version}-%{release} Provides: %{libname}-devel = %{version}-%{release} Obsoletes: %{libname}-devel Obsoletes: %{old_staticdevelname} < 5.5.10 Provides: %mklibname -d mysql Provides: mysql-devel %description -n %{develname} This package contains the development header files and libraries necessary to develop MariaDB client applications. %package -n %{libmariadbembedded} Summary: MariaDB as an embeddable library Group: System/Libraries Provides: %{name}-embedded = %{version}-%{release} Obsoletes: %{name}-embedded < 5.5.10-6 Provides: %mklibname mysqld %{libmariadbembedded_major} %description -n %{libmariadbembedded} MariaDB is a multi-user, multi-threaded SQL database server. This package contains a version of the MariaDB server that can be embedded into a client application instead of running as a separate process. The API is identical for the embedded MariaDB version and the client/server version. %package -n %{libmariadbembedded_devel} Summary: Development files for MySQL as an embeddable library Group: Development/Other Provides: %{name}-embedded-devel = %{version}-%{release} Obsoletes: %{name}-embedded-devel < 5.5.10-6 Requires: %{libmariadbembedded} = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release} Provides: %mklibname -d mysqld %description -n %{libmariadbembedded_devel} MariaDB is a multi-user, multi-threaded SQL database server. This package contains files needed for developing and testing with the embedded version of the MariaDB server. The API is identical for the embedded MariaDB version and the client/server version. %prep %setup -q -n %{name}-%{version}-MariaDB %apply_patches 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 \ -DWITH_PLUGIN_PBXT=1 \ -DFEATURE_SET="community" \ -DCOMPILATION_COMMENT="Mageia - MariaDB 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 mkdir -p %{buildroot}/etc/tmpfiles.d install -m 0644 %{SOURCE10} %{buildroot}/etc/tmpfiles.d/mysql.conf mkdir -p %{buildroot}/lib/systemd/system install -m 644 %{SOURCE11} %{buildroot}/lib/systemd/system install -m 755 %{SOURCE12} %{buildroot}%{_sbindir}/mysqld-prepare-db-dir install -m 755 %{SOURCE13} %{buildroot}%{_sbindir}/mysqld-wait-ready # 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 install -m 0755 -d %{buildroot}/var/lib/mysql # Remove libmysqld.a, install libmysqld.so rm -f %{buildroot}%{_libdir}/libmysqld.a mv %{buildroot}%{_libdir}/libmysqld.so %{buildroot}%{_libdir}/libmysqld.so.%{libmariadbembedded_major}.%{libmariadbembedded_minor} ln -s libmysqld.so.%{libmariadbembedded_major}.%{libmariadbembedded_minor} %{buildroot}%{_libdir}/libmysqld.so.%{libmariadbembedded_major} ln -s libmysqld.so.%{libmariadbembedded_major} %{buildroot}%{_libdir}/libmysqld.so # 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 # remove static libs rm -f %{buildroot}%{_libdir}/libmysqlclient.a rm -f %{buildroot}%{_libdir}/libmysqlclient_r.a # 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}/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 <