From 7a3a090f4e2daeab7a41aab64d17d3dbdd0098fa49f5c27fba3df0cd744f4551 Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Fri, 26 Jul 2013 08:08:06 +0000 Subject: [PATCH 1/8] - fix ownership of logdir (bnc#763150) OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=121 --- build.inc | 2 ++ configuration-tweaks.tar.bz2 | 4 ++-- mariadb.changes | 5 +++++ mysql-patches.tar.bz2 | 4 ++-- rc.mysql-multi | 3 ++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build.inc b/build.inc index b206e85..7ed6fff 100644 --- a/build.inc +++ b/build.inc @@ -111,6 +111,8 @@ BuildMySQL() { -DWITH_EMBEDDED_SERVER=true \ -DCOMPILATION_COMMENT="openSUSE package" \ -DDENABLE_DOWNLOADS=false \ + -DINSTALL_PLUGINDIR_RPM="%{_libdir}/mysql/plugin" \ + -DINSTALL_LIBDIR_RPM="%{_libdir}" \ "$@" .. make %{?jobs:-j%jobs} nm --numeric-sort sql/mysqld > sql/mysqld.sym diff --git a/configuration-tweaks.tar.bz2 b/configuration-tweaks.tar.bz2 index 479f499..a1a220c 100644 --- a/configuration-tweaks.tar.bz2 +++ b/configuration-tweaks.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2b4528bfd705dccf6be532a58ace71daff468b7e2777a01f569836a29552488 -size 323 +oid sha256:03f98286d7ddf181361a0c4a2d4d8dc91a82ef76e292b72bcf2f14436344718b +size 309 diff --git a/mariadb.changes b/mariadb.changes index f51ae06..05a37c5 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 26 10:07:33 CEST 2013 - mhrusecky@suse.cz + +- fix ownership of logdir (bnc#763150) + ------------------------------------------------------------------- Thu Jul 25 13:08:06 CEST 2013 - mhrusecky@suse.cz diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index 446b786..6293313 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2b34d03c24091c0a8120aae545ac9f0959b4167c21e7a1954819836bdf66a673 -size 11823 +oid sha256:48a241b4af682cfa423dc45e333ff80ffe9b6c2236c511ae54f7d3e53277e729 +size 11654 diff --git a/rc.mysql-multi b/rc.mysql-multi index de8fa0e..9afd44c 100644 --- a/rc.mysql-multi +++ b/rc.mysql-multi @@ -329,8 +329,9 @@ else log_dir="`dirname "$i"`" if [ \! -d "$log_dir" ]; then mkdir -p "$log_dir" - chmod 770 "$log_dir" fi + chmod 770 "$log_dir" + chown -R mysq;:mysql "$log_dir" done # We assume a fresh install if the directory $datadir/mysql From 467c7e41630fb0a5a32b227ea9deed72b5b3a95036351c72e4c4faaeffbe1efd Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Fri, 26 Jul 2013 09:37:49 +0000 Subject: [PATCH 2/8] shorter install.inc OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=122 --- install.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/install.inc b/install.inc index b3b5f32..9821de9 100644 --- a/install.inc +++ b/install.inc @@ -108,9 +108,6 @@ install -D -m 644 %_sourcedir/mysql.SuSEfirewall2 \ # testsuite mkdir -p '%buildroot'/usr/share/mysql-test/ install -m 755 suse-test-run '%buildroot'/usr/share/mysql-test/ -# XXX this should go under /var/..., but some tests get confused by a symlink -# var -> ../../../var/... -#ln -sf ../../../var/lib/mysql/mysql-test %buildroot/usr/share/mysql-test/var mkdir '%buildroot'/usr/share/mysql-test/var # Final fixes find '%buildroot'/usr/share/mysql-test -name '*.orig' -delete From 65a3f5a7905b29798d9fbacb49f3c4ecda2ee29c1439898b3499700e1443e72e Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Tue, 30 Jul 2013 20:06:56 +0000 Subject: [PATCH 3/8] merge OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=125 --- configuration-tweaks.tar.bz2 | 4 ++-- install.inc | 31 ++++++++++++++++++++----------- mariadb.changes | 6 ++++++ mariadb.spec | 11 +++-------- mysql-patches.tar.bz2 | 4 ++-- rc.mysql-multi | 2 +- 6 files changed, 34 insertions(+), 24 deletions(-) diff --git a/configuration-tweaks.tar.bz2 b/configuration-tweaks.tar.bz2 index a1a220c..f37d61b 100644 --- a/configuration-tweaks.tar.bz2 +++ b/configuration-tweaks.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:03f98286d7ddf181361a0c4a2d4d8dc91a82ef76e292b72bcf2f14436344718b -size 309 +oid sha256:fd2bf9befa5e326fb66e33381e8fdb9b9b3e91976c6d6d15181619f50ea81867 +size 310 diff --git a/install.inc b/install.inc index 9821de9..01b7856 100644 --- a/install.inc +++ b/install.inc @@ -100,8 +100,6 @@ for i in "${DOCS[@]}"; do done install -m 755 %_sourcedir/rc.mysql-multi %buildroot/etc/init.d/mysql ln -sf ../../etc/init.d/mysql %buildroot/usr/sbin/rcmysql -# this is used by the init script -install -m 755 -d %buildroot/var/run/mysql # SuSEfirewall service description install -D -m 644 %_sourcedir/mysql.SuSEfirewall2 \ %buildroot/etc/sysconfig/SuSEfirewall2.d/services/mysql @@ -131,18 +129,33 @@ cat mysql-ndb-storage.files mysql-ndb-management.files \ rm -f .$tmp done %endif +pushd '%buildroot'/%_libdir +for i in *.so.*.*.*; do + if [ -L "$i" ]; then + trg="`readlink "$i"`" + rm "$i" + mv "$trg" "$i" + ln -s "$i" "$trg" + fi +done +for i in *.so.*; do + if [ -L "$i" ] && [ -L "`readlink "$i"`" ]; then + trg="`readlink "$i"`" + rm "$i" + ln -s "`readlink "$trg"`" "$i" + fi +done +popd %if ! 0%{prefered} > 0 cat libmysqlclient-devel.files | sed 's|%%doc\ ||' | while read tmp; do cd '%buildroot' rm -f ."$tmp" done rm -rf '%buildroot'/%_libdir/libmysqld.* -rm -rf '%buildroot'/%_libdir/*.la -rm -rf '%buildroot'/%_libdir/*.so +rm -rf '%buildroot'/%_libdir/{*.la,*.so,*.a} rm -rf '%buildroot'/%_datadir/man/*/mysql_config.1* rm -rf '%buildroot'/%_includedir rm -rf '%buildroot'/%_datadir/aclocal -rm -rf '%buildroot'/%_libdir/*.a %endif sed -i 's|doc/packages/mysql|doc/packages/%{name}|g' '%buildroot'/etc/init.d/mysql ln -s mysqlcheck '%buildroot'%_bindir/mysqlrepair @@ -158,15 +171,11 @@ fi mkdir -p '%buildroot'/etc/my.cnf.d rm -rf '%buildroot'/etc/my.cnf.d/* bzip2 -cd '%_sourcedir'/configuration-tweaks.tar.bz2 | tar -C '%buildroot'/etc/my.cnf.d -xvf - -if [ -z "`ls '%buildroot'/usr/share/info/mysql.info*`" ]; then - install -D -m 0644 Docs/mysql.info "%buildroot/usr/share/info/mysql.info" - gzip -9 "%buildroot/usr/share/info/mysql.info" -fi +[ -z "`ls '%buildroot'/usr/share/info/mysql.info* 2> /dev/null`" ] || rm -f '%buildroot'/usr/share/info/mysql.info* if [ "`ls '%buildroot'%_libdir/mysql/plugin/dialog*.so`" ]; then echo '%%dir %%_libdir/mysql' >> mysql-client.files echo '%%dir %%_libdir/mysql/plugin' >> mysql-client.files echo '%%_libdir/mysql/plugin/dialog*.so' >> mysql-client.files fi rm -rf '%buildroot'/usr/share/doc/{mysql,mariadb}* -rm -rf '%buildroot'/usr/share/mysql/solaris -rm -rf '%buildroot'/usr/share/mysql/SELinux +rm -rf '%buildroot'/usr/share/mysql/{solaris,SELinux} diff --git a/mariadb.changes b/mariadb.changes index 05a37c5..aff7127 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 30 21:51:25 CEST 2013 - mhrusecky@suse.cz + +- get rid of info which is not info (bnc#747811) +- minor polishing of spec/installation + ------------------------------------------------------------------- Fri Jul 26 10:07:33 CEST 2013 - mhrusecky@suse.cz diff --git a/mariadb.spec b/mariadb.spec index 72aa499..28c11fe 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -55,10 +55,10 @@ Source14: my.ini BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} PreReq: pwdutils -PreReq: %install_info_prereq %insserv_prereq %endif BuildRequires: autoconf BuildRequires: automake +BuildRequires: bison BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: libaio-devel @@ -68,7 +68,6 @@ BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: procps -BuildRequires: readline-devel BuildRequires: zlib-devel %if 0%{?suse_version} BuildRequires: pwdutils @@ -383,7 +382,7 @@ rm -f mysql-test/t/file_contents.test mysql-test/r/file_contents.result /usr/sbin/groupadd -r mysql >/dev/null 2>/dev/null || : /usr/sbin/useradd -r -o -g mysql -u 60 -c "MySQL database admin" \ -s /bin/false -d /var/lib/mysql mysql 2> /dev/null || : -/usr/sbin/usermod -g mysql -s /bin/false mysql || : +/usr/sbin/usermod -g mysql -s /bin/false mysql 2> /dev/null || : # systemd requirment %if 0%{?suse_version} >= 1210 %service_add_pre mysql.service @@ -393,7 +392,7 @@ rm -f mysql-test/t/file_contents.test mysql-test/r/file_contents.result /usr/sbin/groupadd -r mysql >/dev/null 2>/dev/null || : /usr/sbin/useradd -r -o -g mysql -u 60 -c "MySQL database admin" \ -s /bin/false -d /var/lib/mysql mysql 2> /dev/null || : -/usr/sbin/usermod -g mysql -s /bin/false mysql || : +/usr/sbin/usermod -g mysql -s /bin/false mysql 2> /dev/null || : %post # systemd requirment @@ -418,8 +417,6 @@ if posix.access("/usr/sbin/rcmysql", "x") then end %posttrans -[ -z "`ls %{_infodir}/mysql.info.* 2> /dev/null`" ] || \ -%install_info --info-dir=%{_infodir} %{_infodir}/mysql.info.* if [ -d /var/lib/mysql ]; then touch /var/lib/mysql/.run-mysql_upgrade chown -R mysql:mysql /var/lib/mysql @@ -459,7 +456,6 @@ fi %postun if [ $1 = 0 ]; then - %install_info_delete --info-dir=%{_infodir} %{_infodir}/mysql.info.* %{insserv_cleanup} rm -f "/var/lib/systemd/migrated/mysql.service" if [ -x /usr/bin/systemctl ]; then @@ -478,7 +474,6 @@ fi %config(noreplace) %attr(0640, root, mysql) /etc/my.cnf.d/* %config /etc/logrotate.d/mysql %doc %{_defaultdocdir}/%{name} -%doc %{_infodir}/mysql.info.* /etc/init.d/mysql /usr/sbin/rcmysql %dir /usr/share/%{name} diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index 6293313..84d5f6d 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48a241b4af682cfa423dc45e333ff80ffe9b6c2236c511ae54f7d3e53277e729 -size 11654 +oid sha256:6cd896d7385a3e80c7e50c25cf1728ebd23d99235920ff273782da86aa48fbf8 +size 11665 diff --git a/rc.mysql-multi b/rc.mysql-multi index 9afd44c..b7e59a2 100644 --- a/rc.mysql-multi +++ b/rc.mysql-multi @@ -331,7 +331,7 @@ else mkdir -p "$log_dir" fi chmod 770 "$log_dir" - chown -R mysq;:mysql "$log_dir" + chown -R mysql:mysql "$log_dir" done # We assume a fresh install if the directory $datadir/mysql From 22e846a1bbe4d4d53c02b7cf476cabad0a2da79bac9ac878955875dfe99e496f Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Wed, 31 Jul 2013 08:22:31 +0000 Subject: [PATCH 4/8] fix OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=126 --- configuration-tweaks.tar.bz2 | 4 ++-- install.inc | 2 ++ mysql-patches.tar.bz2 | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configuration-tweaks.tar.bz2 b/configuration-tweaks.tar.bz2 index f37d61b..e44e069 100644 --- a/configuration-tweaks.tar.bz2 +++ b/configuration-tweaks.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd2bf9befa5e326fb66e33381e8fdb9b9b3e91976c6d6d15181619f50ea81867 -size 310 +oid sha256:3cc0f6ea38614ac278f6828fc2c9518437fd9958231af5fd58e0a3b8d590399c +size 312 diff --git a/install.inc b/install.inc index 01b7856..7d0ad0f 100644 --- a/install.inc +++ b/install.inc @@ -100,6 +100,8 @@ for i in "${DOCS[@]}"; do done install -m 755 %_sourcedir/rc.mysql-multi %buildroot/etc/init.d/mysql ln -sf ../../etc/init.d/mysql %buildroot/usr/sbin/rcmysql +# this is used by the init script +install -m 755 -d %buildroot/var/run/mysql # SuSEfirewall service description install -D -m 644 %_sourcedir/mysql.SuSEfirewall2 \ %buildroot/etc/sysconfig/SuSEfirewall2.d/services/mysql diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index 84d5f6d..c19c693 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6cd896d7385a3e80c7e50c25cf1728ebd23d99235920ff273782da86aa48fbf8 -size 11665 +oid sha256:31303abcc376d68b7a0d0c8af714664a5b8829df29c397e4ea19da44f9eeb9ec +size 11673 From 1134b7b25a8ef1796b3c4c40f580e3877f9b6fa67afdd1013644823f6dbe7f09 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 12 Aug 2013 08:38:56 +0000 Subject: [PATCH 5/8] Accepting request 186214 from home:oertel:branches:server:database - add patch for lib64 on s390x mysql-patches/mariadb-5.5.24-s390x-libdir.patch OBS-URL: https://build.opensuse.org/request/show/186214 OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=127 --- mariadb.changes | 6 ++++++ mysql-patches.tar.bz2 | 4 ++-- series | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mariadb.changes b/mariadb.changes index aff7127..cd6dd47 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 7 15:12:13 CEST 2013 - ro@suse.de + +- add patch for lib64 on s390x + mysql-patches/mariadb-5.5.24-s390x-libdir.patch + ------------------------------------------------------------------- Tue Jul 30 21:51:25 CEST 2013 - mhrusecky@suse.cz diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index c19c693..77755cb 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31303abcc376d68b7a0d0c8af714664a5b8829df29c397e4ea19da44f9eeb9ec -size 11673 +oid sha256:a0e2010cb3d5483443dd9444f61618da50ab966c13c1acada187e17f8a0b5195 +size 11226 diff --git a/series b/series index 252baca..ad339d5 100644 --- a/series +++ b/series @@ -11,3 +11,4 @@ mysql-community-server-5.5.6-safe-process-in-bin.patch mariadb-5.5.28-group.patch mariadb-5.5.24-ppc64-libdir.patch mariadb-5.5.24-aarch64-libdir.patch +mariadb-5.5.24-s390x-libdir.patch From 9cefabf9c724c3a0b31b6e7af6a1ced9010c36cb7bd735fc5e8c03c44f31888d Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Mon, 12 Aug 2013 10:27:00 +0000 Subject: [PATCH 6/8] - merge latest packaging fixes * better handling of libdir * more cautious upgrades OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=128 --- configuration-tweaks.tar.bz2 | 4 ++-- install.inc | 24 +++++++++--------------- mariadb.changes | 7 +++++++ mariadb.spec | 32 ++++++++++++++++++++++++++++++-- mysql-patches.tar.bz2 | 4 ++-- rc.mysql-multi | 32 ++++++++++++++++++++++++++------ series | 6 +++--- 7 files changed, 79 insertions(+), 30 deletions(-) diff --git a/configuration-tweaks.tar.bz2 b/configuration-tweaks.tar.bz2 index e44e069..72e06a7 100644 --- a/configuration-tweaks.tar.bz2 +++ b/configuration-tweaks.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3cc0f6ea38614ac278f6828fc2c9518437fd9958231af5fd58e0a3b8d590399c -size 312 +oid sha256:219b058d331b9ac48e9ee207888ea60adc3e086733e7cda68592a04951bfb30e +size 317 diff --git a/install.inc b/install.inc index 7d0ad0f..12760e6 100644 --- a/install.inc +++ b/install.inc @@ -15,26 +15,20 @@ if [ -f "%{buildroot}%{_bindir}/mytop" ]; then fi rm -f %buildroot%_libdir/mysql/plugin/handlersocket.so # remove most static libs (FIXME: don't build them at all...) -rm -f %buildroot%_libdir/libmysqlclient*a -rm -f %buildroot%_libdir/libmysqlservices*a -rm -f %buildroot%_libdir/mysql/*.a %buildroot%_libdir/mysql/*.la -rm -f %buildroot%_libdir/mysql/plugin/*a +[ \! -f "%buildroot%_libdir/"libmysqld.a ] || mv "%buildroot%_libdir/"libmysqld.a "%buildroot%_libdir/"libmysqld.static +rm -f %buildroot%_libdir/*.a +[ \! -f "%buildroot%_libdir/"libmysqld.static ] || mv "%buildroot%_libdir/"libmysqld.static "%buildroot%_libdir/"libmysqld.a +rm -f %buildroot%_libdir/mysql/{,plugin}/*.{a,la} # XXX: package these? The ndb tools are linked statically atm rm -f %buildroot%_libdir/mysql/libndbclient.* -rm -f %{buildroot}/usr/share/mysql-test/mysql-test-run -rm -f %{buildroot}/usr/share/mysql-test/mtr -rm -f %{buildroot}/usr/share/mysql/binary-configure -rm -f %{buildroot}/usr/share/mysql/errmsg-utf8.txt -rm -f %{buildroot}/usr/share/mysql/magic -rm -f %{buildroot}/usr/share/mysql/mysql-log-rotate -rm -f %{buildroot}/usr/share/mysql/mysql*.server +rm -f %{buildroot}/usr/share/mysql-test/{mysql-test-run,mtr} +rm -f %{buildroot}/usr/share/mysql/{binary-configure,errmsg-utf8.txt,magic,mysql-log-rotate,mysql*.server} rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini ln -sf mysql-test-run.pl %{buildroot}/usr/share/mysql-test/mtr ln -sf mysql-test-run.pl %{buildroot}/usr/share/mysql-test/mysql-test-run mv %{buildroot}/usr/share/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} # generate filelist for binaries and their manpages (easier than enumerating -# all the binaries and manapages manually, esp. when there are new manpages in -# each release) +# all the binaries and manapages manually filelist() { echo '%%defattr(-, root, root)' @@ -170,11 +164,11 @@ ln -s libndbclient.so.6.0.0 '%buildroot'%_libdir/libndbclient.so.6 if [ -f '%buildroot'/usr/bin/mysqlaccess.conf ]; then mv '%buildroot'/usr/bin/mysqlaccess.conf '%buildroot'/etc/mysqlaccess.conf fi +rm -rf '%buildroot'/etc/my.cnf.d mkdir -p '%buildroot'/etc/my.cnf.d -rm -rf '%buildroot'/etc/my.cnf.d/* bzip2 -cd '%_sourcedir'/configuration-tweaks.tar.bz2 | tar -C '%buildroot'/etc/my.cnf.d -xvf - [ -z "`ls '%buildroot'/usr/share/info/mysql.info* 2> /dev/null`" ] || rm -f '%buildroot'/usr/share/info/mysql.info* -if [ "`ls '%buildroot'%_libdir/mysql/plugin/dialog*.so`" ]; then +if [ "`ls '%buildroot'%_libdir/mysql/plugin/dialog*.so 2> /dev/null`" ]; then echo '%%dir %%_libdir/mysql' >> mysql-client.files echo '%%dir %%_libdir/mysql/plugin' >> mysql-client.files echo '%%_libdir/mysql/plugin/dialog*.so' >> mysql-client.files diff --git a/mariadb.changes b/mariadb.changes index cd6dd47..6cbd665 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 12 12:25:16 CEST 2013 - mhrusecky@suse.cz + +- merge latest packaging fixes + * better handling of libdir + * more cautious upgrades + ------------------------------------------------------------------- Wed Aug 7 15:12:13 CEST 2013 - ro@suse.de diff --git a/mariadb.spec b/mariadb.spec index 28c11fe..ee509e8 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -15,7 +15,6 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - # Few definitions which will alter build %define prefered 1 %define use_cmake 1 @@ -68,6 +67,7 @@ BuildRequires: ncurses-devel BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: procps +BuildRequires: readline-devel BuildRequires: zlib-devel %if 0%{?suse_version} BuildRequires: pwdutils @@ -93,14 +93,18 @@ Requires: perl-base BuildRequires: systemd %{?systemd_requires} %endif +%if "%{name}" != mysql Provides: mysql = %{srv_vers} +%endif Provides: mysql-Max = %{srv_vers} %if 0%{?use_extra_provides} > 0 Provides: %{extra_provides} = %{version} Obsoletes: %{extra_provides} < %{version} %endif %if 0%{?prefered} > 0 +%if "%{name}" != mysql Obsoletes: mysql < %{srv_vers} +%endif Obsoletes: mysql-Max < %{srv_vers} %endif Conflicts: otherproviders(mysql) @@ -170,18 +174,22 @@ languages and applications need to dynamically load and use MariaDB. %package client Summary: Client for MariaDB Group: Productivity/Databases/Clients +%if "%{name}" != mysql Provides: mysql-client = %{srv_vers} +%endif %if 0%{?suse_version} PreReq: pwdutils %endif %if 0%{?use_extra_provides} > 0 Provides: %{extra_provides}-client = %{version} Obsoletes: %{extra_provides}-client < %{version} -Requires: %{name}-errormessages = %version %endif +Requires: %{name}-errormessages = %version %if 0%{?prefered} > 0 +%if "%{name}" != mysql Obsoletes: mysql-client < %{srv_vers} %endif +%endif Conflicts: otherproviders(mysql-client) %description client @@ -200,14 +208,18 @@ Requires: %{name}-client Requires: perl-DBD-mysql Summary: Benchmarks for MariaDB Group: Productivity/Databases/Tools +%if "%{name}" != mysql Provides: mysql-bench = %{srv_vers} +%endif %if 0%{?use_extra_provides} > 0 Provides: %{extra_provides}-bench = %{version} Obsoletes: %{extra_provides}-bench < %{version} %endif %if 0%{?prefered} > 0 +%if "%{name}" != mysql Obsoletes: mysql-bench < %{srv_vers} %endif +%endif Conflicts: otherproviders(mysql-bench) %description bench @@ -247,14 +259,18 @@ Requires: %{name}-bench = %{version} Requires: %{name}-client = %{version} Requires: %{name}-tools = %{version} Requires: perl-DBD-mysql +%if "%{name}" != mysql Provides: mysql-test = %{srv_vers} +%endif %if 0%{?use_extra_provides} > 0 Provides: %{extra_provides}-test = %{version} Obsoletes: %{extra_provides}-test < %{version} %endif %if 0%{?prefered} > 0 +%if "%{name}" != mysql Obsoletes: mysql-test < %{srv_vers} %endif +%endif Conflicts: otherproviders(mysql-test) %description test @@ -268,15 +284,19 @@ Group: Productivity/Databases/Servers Requires: perl-DBD-mysql # make sure this package is installed when updating from 10.2 and older Provides: mysql-client:/usr/bin/perror +%if "%{name}" != mysql Provides: mysql-tools = %{srv_vers} +%endif Provides: mysql:/usr/bin/mysqlhotcopy %if 0%{?use_extra_provides} > 0 Provides: %{extra_provides}-tools = %{version} Obsoletes: %{extra_provides}-tools < %{version} %endif %if 0%{?prefered} > 0 +%if "%{name}" != mysql Obsoletes: mysql-tools < %{srv_vers} %endif +%endif Conflicts: otherproviders(mysql-tools) %description tools @@ -300,8 +320,10 @@ cluster. %package ndb-storage Summary: MariaDB - ndbcluster storage engine Group: Productivity/Databases/Servers +%if "%{name}" != mysql Provides: mysql-ndb-storage = %{srv_vers} Obsoletes: mysql-ndb-storage < %{srv_vers} +%endif Conflicts: otherproviders(mysql-ndb-storage) %description ndb-storage @@ -313,8 +335,10 @@ computers that should store ndbcluster table data. %package ndb-management Summary: MariaDB - ndbcluster storage engine management Group: Productivity/Databases/Servers +%if "%{name}" != mysql Provides: mysql-ndb-management = %{srv_vers} Obsoletes: mysql-ndb-management < %{srv_vers} +%endif Conflicts: otherproviders(mysql-ndb-management) %description ndb-management @@ -325,8 +349,10 @@ one computer in the cluster. %package ndb-tools Summary: MariaDB - ndbcluster storage engine basic tools Group: Productivity/Databases/Servers +%if "%{name}" != mysql Provides: mysql-ndb-tools = %{srv_vers} Obsoletes: mysql-ndb-tools < %{srv_vers} +%endif Conflicts: otherproviders(mysql-ndb-tools) %description ndb-tools @@ -335,8 +361,10 @@ This package contains ndbcluster storage engine basic tools. %package ndb-extra Summary: MariaDB - ndbcluster storage engine extra tools Group: Productivity/Databases/Servers +%if "%{name}" != mysql Provides: mysql-ndb-extra = %{srv_vers} Obsoletes: mysql-ndb-extra < %{srv_vers} +%endif Conflicts: otherproviders(mysql-ndb-extra) %description ndb-extra diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index 77755cb..1e20803 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a0e2010cb3d5483443dd9444f61618da50ab966c13c1acada187e17f8a0b5195 -size 11226 +oid sha256:8d8547e5bd6984bdbff29f6f6f1bfa78a18353a9389c5f47a708d8c52f07fe53 +size 13345 diff --git a/rc.mysql-multi b/rc.mysql-multi index b7e59a2..9e56712 100644 --- a/rc.mysql-multi +++ b/rc.mysql-multi @@ -334,6 +334,8 @@ else chown -R mysql:mysql "$log_dir" done + MYSQLVER="`mysqld --version | sed 's|.*Ver\ *\([^\ ]*\)\.[0-9]\+[\-\ ].*|\1|'`" + # We assume a fresh install if the directory $datadir/mysql # does not exist and create the privilege database if ! test -d "$datadir/mysql"; then @@ -341,17 +343,33 @@ else mysql_install_db --user="$mysql_daemon_user" --datadir="$datadir" ||{ rc_failed; rc_status -v; rc_exit } + echo -n "$MYSQLVER" > "$datadir"/mysql_upgrade_info fi check_obsolete - # Run mysql_upgrade on every package install/upgrade. Not allways - # necessary, but doesn't do any harm. + # Run mysql_upgrade on every package install/upgrade. Not always + # necessary, but doesn't do any harm. On big upgrade, require + # user confirmation. if [ -f "/var/lib/mysql/.run-mysql_upgrade" ]; then + if [ \! -f "/var/lib/mysql/.force_upgrade" ] && \ + [ -z "`grep "^$MYSQLVER" "$datadir/mysql_upgrade_info" 2> /dev/null`" ]; then + echo + echo "You are upgrading from different stable version of MySQL!" + echo "Make sure you to make backup of your data (mostly $datadir)!" + echo + echo "If you want to continue upgrading your database, run following commands:" + echo + echo " touch /var/lib/mysql/.force_upgrade" + echo " rcmysql restart" + echo + rc_failed; rc_status -v; rc_exit + + fi echo > "$log_upgrade" echo "`LANG="" date` - upgrading MySQL..." >> "$log_upgrade" echo >> "$log_upgrade" echo "Will update MySQL now, if you encounter any problems, please read following file:" | tee -a "$log_upgrade" echo " /usr/share/doc/packages/mysql/README.SuSE" | tee -a "$log_upgrade" - sed -i -e 's|^\([^#]*skip-locking\)|#\1\nskip-external-locking|' \ + sed -i -e 's|^\([^#]*skip-locking\)|\1\nskip-external-locking|' \ -e 's|^\([^#]*skip-federated\)|#\1|' /etc/my.cnf # Check logs for inconsistencies SRCLOGS="" @@ -426,6 +444,7 @@ else rc_failed; rc_status -v; rc_exit; } if [ "`grep "Upgrading MySQL..." "$log_upgrade"`" ]; then + echo "Problems should be fixed now." echo "Rechecking whether everything is Ok... " | tee -a "$log_upgrade" LANG=C $cmd --no-defaults --force \ --socket="$protected/mysql.sock" | \ @@ -463,9 +482,10 @@ else # Fix ownerships and permissions for $datadir chmod 750 "$datadir" chown -R "$mysql_daemon_user:$mysql_daemon_group" "$datadir" - rm -f /var/lib/mysql/.run-mysql_upgrade \ - rm -f /var/lib/mysql/.force_upgrade \ - "$datadir"/{update-stamp-*,mysql/stamp-4.1} # used in the past + rm -f /var/adm/update-messages/mysql-* + rm -f /var/lib/mysql/.run-mysql_upgrade + rm -f /var/lib/mysql/.force_upgrade + rm -f "$datadir"/{update-stamp-*,mysql/stamp-4.1} # used in the past chown "$mysql_daemon_user:$mysql_daemon_group" "$log_upgrade" chmod 640 "$log_upgrade" fi diff --git a/series b/series index ad339d5..94a895b 100644 --- a/series +++ b/series @@ -9,6 +9,6 @@ mariadb-5.5.32-upgrade-exit-status.patch mariadb-5.2.3-cnf.patch mysql-community-server-5.5.6-safe-process-in-bin.patch mariadb-5.5.28-group.patch -mariadb-5.5.24-ppc64-libdir.patch -mariadb-5.5.24-aarch64-libdir.patch -mariadb-5.5.24-s390x-libdir.patch +mariadb-5.5.32-deharcode-libdir.patch +mysql-5.5.31-upgrade-datadir.patch +mysql-5.5-dump.patch From 45b9473e1f37b67799133688cf23b078d39143563d3af50bf861f4dbec4ba393 Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Mon, 12 Aug 2013 12:34:46 +0000 Subject: [PATCH 7/8] - chown --no-dereference instead of chown to improve security - fix build for ppc64 using -mminimal-toc OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=129 --- build.inc | 7 +++++-- configuration-tweaks.tar.bz2 | 4 ++-- mariadb.changes | 6 ++++++ mysql-patches.tar.bz2 | 4 ++-- rc.mysql-multi | 12 ++++++------ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/build.inc b/build.inc index 7ed6fff..ab744fd 100644 --- a/build.inc +++ b/build.inc @@ -4,9 +4,12 @@ %define socketpath /var/run/mysql %endif %if 0%{?suse_version} > 1140 -export WARN_DIS="$WARN_DIS -Wno-unused-but-set-variable -fno-strict-aliasing -Wno-unused-parameter " +export EXTRA_FLAGS=" -Wno-unused-but-set-variable -fno-strict-aliasing -Wno-unused-parameter " %endif -export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DFORCE_INIT_OF_VARS $WARN_DIS " +%ifarch ppc64 +export EXTRA_FLAGS=" -mminimal-toc " +%endif +export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DFORCE_INIT_OF_VARS $EXTRA_FLAGS " export CXXFLAGS="$CFLAGS -fno-exceptions -fno-rtti" %if 0%{use_cmake} < 1 diff --git a/configuration-tweaks.tar.bz2 b/configuration-tweaks.tar.bz2 index 72e06a7..a1cbf17 100644 --- a/configuration-tweaks.tar.bz2 +++ b/configuration-tweaks.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:219b058d331b9ac48e9ee207888ea60adc3e086733e7cda68592a04951bfb30e -size 317 +oid sha256:5e1d7b3da204d4812554888639fd49101b3a2d87c41bac802df35cf794ef088c +size 312 diff --git a/mariadb.changes b/mariadb.changes index 6cbd665..797fd95 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 12 14:32:51 CEST 2013 - mhrusecky@suse.cz + +- chown --no-dereference instead of chown to improve security +- fix build for ppc64 using -mminimal-toc + ------------------------------------------------------------------- Mon Aug 12 12:25:16 CEST 2013 - mhrusecky@suse.cz diff --git a/mysql-patches.tar.bz2 b/mysql-patches.tar.bz2 index 1e20803..698b3be 100644 --- a/mysql-patches.tar.bz2 +++ b/mysql-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d8547e5bd6984bdbff29f6f6f1bfa78a18353a9389c5f47a708d8c52f07fe53 -size 13345 +oid sha256:3c9a38335384fb99e0ac76488a2dd72cefa8fbca5f9f2b191c2348ecc64d6b0b +size 13306 diff --git a/rc.mysql-multi b/rc.mysql-multi index 9e56712..72cf61f 100644 --- a/rc.mysql-multi +++ b/rc.mysql-multi @@ -273,7 +273,7 @@ else parse_arguments `$print_defaults $defaults mysqld mysql_server` mkdir -m 755 -p /var/run/mysql - chown $mysql_daemon_user:$mysql_daemon_group /var/run/mysql + chown --no-dereference "$mysql_daemon_user:$mysql_daemon_group" /var/run/mysql export TEMPDIR="`cat /var/run/mysql/tmpdir 2> /dev/null`" # Safeguard (relative paths, core dumps..) @@ -292,7 +292,7 @@ else rm -rf "$TEMPDIR" fi TEMPDIR="`mktemp -d -p /var/tmp mysql.XXXXXX | tee /var/run/mysql/tmpdir`" - [ -z "$TEMPDIR" ] || chown "$mysql_daemon_user:$mysql_daemon_group" "$TEMPDIR" + [ -z "$TEMPDIR" ] || chown --no-dereference "$mysql_daemon_user:$mysql_daemon_group" "$TEMPDIR" [ "`ls -ld "$TEMPDIR" | grep "^drwx------[\\.\+]\?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || { echo "Can't create secure $TEMPDIR" rc_failed; rc_status -v; rc_exit; @@ -331,7 +331,7 @@ else mkdir -p "$log_dir" fi chmod 770 "$log_dir" - chown -R mysql:mysql "$log_dir" + chown -R --no-dereference mysql:mysql "$log_dir" done MYSQLVER="`mysqld --version | sed 's|.*Ver\ *\([^\ ]*\)\.[0-9]\+[\-\ ].*|\1|'`" @@ -418,7 +418,7 @@ else # reloads privileges tables, so we can get lock out for cmd in "/usr/bin/mysql_upgrade" \ "/usr/bin/mysql_upgrade"; do - [ -z "$protected" ] || chown "$mysql_daemon_user:$mysql_daemon_group" "$protected" + [ -z "$protected" ] || chown --no-dereference "$mysql_daemon_user:$mysql_daemon_group" "$protected" [ "`ls -ld "$protected" | grep "^drwx------[\\.\+]\?[[:blank:]]\+[0-9]\+[[:blank:]]\+$mysql_daemon_user[[:blank:]]\+$mysql_daemon_group[[:blank:]]\+.*"`" ] || { echo "Can't create secure $protected" | tee -a "$log_upgrade" touch /var/lib/mysql/.run-mysql_upgrade @@ -481,12 +481,12 @@ else rm -rf "$protected" # Fix ownerships and permissions for $datadir chmod 750 "$datadir" - chown -R "$mysql_daemon_user:$mysql_daemon_group" "$datadir" + chown -R --no-dereference "$mysql_daemon_user:$mysql_daemon_group" "$datadir" rm -f /var/adm/update-messages/mysql-* rm -f /var/lib/mysql/.run-mysql_upgrade rm -f /var/lib/mysql/.force_upgrade rm -f "$datadir"/{update-stamp-*,mysql/stamp-4.1} # used in the past - chown "$mysql_daemon_user:$mysql_daemon_group" "$log_upgrade" + chown --no-dereference "$mysql_daemon_user:$mysql_daemon_group" "$log_upgrade" chmod 640 "$log_upgrade" fi From a9047ea8f841de7f9f07188a0e592bdd4b2a672dd00303e154a722d82296ce9c Mon Sep 17 00:00:00 2001 From: "Michal Hrusecky (old before rename to _miska_)" Date: Mon, 12 Aug 2013 14:40:38 +0000 Subject: [PATCH 8/8] changelog OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=130 --- mariadb.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/mariadb.changes b/mariadb.changes index 797fd95..9416177 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -2,6 +2,7 @@ Mon Aug 12 14:32:51 CEST 2013 - mhrusecky@suse.cz - chown --no-dereference instead of chown to improve security + * similar issue as CVE-2013-1976 - fix build for ppc64 using -mminimal-toc -------------------------------------------------------------------