diff --git a/mariadb.changes b/mariadb.changes index b75a185..001a550 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 12 16:03:07 UTC 2013 - tpaszkowski@suse.com + +- systemd awareness for openSUSE >= 12.1 + ------------------------------------------------------------------- Sun Mar 3 21:32:37 UTC 2013 - schwab@suse.de diff --git a/mariadb.spec b/mariadb.spec index b2c838a..9932c5a 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -77,6 +77,9 @@ BuildRequires: fdupes %if 0%{?fedora_version} > 11 BuildRequires: sqlite %endif +%if 0%{?suse_version} >= 1210 +BuildRequires: systemd +%endif %if 0%{?suse_version} > 1030 Recommends: logrotate %else @@ -86,6 +89,10 @@ Requires: logrotate Requires: %{name}-client Requires: %{name}-errormessages = %version Requires: perl-base +# systemd requirements for openSUSE >= 12.1 +%if 0%{?suse_version} >= 1210 +%{?systemd_requires} +%endif Provides: mysql = %{srv_vers} Provides: mysql-Max = %{srv_vers} %if 0%{?use_extra_provides} > 0 @@ -373,12 +380,26 @@ rm -f mysql-test/t/file_contents.test mysql-test/r/file_contents.result /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 || : +# systemd requirment +%if 0%{?suse_version} >= 1210 +%service_add_pre mysql.service +%endif + +%post +# systemd requirment +%if 0%{?suse_version} >= 1210 +%service_add_post mysql.service +%endif ####################################################################### # preun and posttran takes care of restart # ####################################################################### %preun [ $1 = 1 ] || /usr/sbin/rcmysql stop +# systemd requirment +%if 0%{?suse_version} >= 1210 +%service_del_preun mysql.service +%endif %pretrans -p if posix.access("/usr/sbin/rcmysql", "x") then @@ -443,6 +464,10 @@ if [ $1 = 0 ]; then %install_info_delete --info-dir=%{_infodir} %{_infodir}/mysql.info.* %{insserv_cleanup} fi +# systemd requirment +%if 0%{?suse_version} >= 1210 +%service_del_postun mysql.service +%endif ####################################################################### # Files section #