[community-mysql] Do not use scl prefix more than once in paths Based on https://www.redhat.com/archives/sclorg/2015-F
Honza Horak
hhorak at fedoraproject.org
Fri Mar 6 19:50:51 UTC 2015
commit 062422d0a194e7ee95177ed67c1f41a04d5eb3aa
Author: Honza Horak <hhorak at redhat.com>
Date: Fri Mar 6 15:59:39 2015 +0100
Do not use scl prefix more than once in paths
Based on https://www.redhat.com/archives/sclorg/2015-February/msg00038.html
Conflicts:
community-mysql.spec
community-mysql.spec | 19 ++++++++++++++-----
mysql.init.in | 4 ++--
server.cnf.in | 2 +-
3 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/community-mysql.spec b/community-mysql.spec
index df3cf6d..f83186e 100644
--- a/community-mysql.spec
+++ b/community-mysql.spec
@@ -52,12 +52,16 @@
%global daemondir %{_sysconfdir}/rc.d/init.d
%endif
%global daemon_name mysqld
+%global daemon_no_prefix mysqld
+
+# Directory for storing pid file
+%global pidfiledir %{_localstatedir}/run/%{daemon_name}
# We define some system's well known locations here so we can use them easily
# later when building to another location (like SCL)
%global logrotateddir %{_sysconfdir}/logrotate.d
%global logfiledir %{_localstatedir}/log
-%global logfile %{logfiledir}/%{daemon_name}.log
+%global logfile %{logfiledir}/%{daemon_no_prefix}.log
# Defining where database data live
%global dbdatadir %{_localstatedir}/lib/mysql
@@ -74,7 +78,7 @@
Name: community-mysql
Version: 5.6.23
-Release: 3%{?with_debug:.debug}%{?dist}
+Release: 4%{?with_debug:.debug}%{?dist}
Summary: MySQL client programs and shared libraries
Group: Applications/Databases
URL: http://www.mysql.com
@@ -459,8 +463,9 @@ cmake .. \
-DFEATURE_SET="community" \
-DINSTALL_LAYOUT=RPM \
-DDAEMON_NAME="%{daemon_name}" \
+ -DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \
-DLOG_LOCATION="%{logfile}" \
- -DPID_FILE_DIR="%{_localstatedir}/run/%{daemon_name}" \
+ -DPID_FILE_DIR="%{pidfiledir}" \
-DNICE_PROJECT_NAME="MySQL" \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DSYSCONFDIR="%{_sysconfdir}" \
@@ -527,7 +532,7 @@ install -p -m 0644 Docs/INFO_BIN %{buildroot}%{_libdir}/mysql/
mkdir -p %{buildroot}%{logfiledir}
touch %{buildroot}%{logfile}
-mkdir -p %{buildroot}%{_localstatedir}/run/%{daemon_name}
+mkdir -p %{buildroot}%{pidfiledir}
install -p -m 0755 -d %{buildroot}%{dbdatadir}
%if %{with config}
@@ -895,7 +900,7 @@ fi
%{?with_init_systemd:%{_tmpfilesdir}/%{name}.conf}
%attr(0755,mysql,mysql) %dir %{dbdatadir}
-%attr(0755,mysql,mysql) %dir %{_localstatedir}/run/%{daemon_name}
+%attr(0755,mysql,mysql) %dir %{pidfiledir}
%attr(0755,mysql,mysql) %dir %{_localstatedir}/lib/mysql
%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile}
%config(noreplace) %{logrotateddir}/%{daemon_name}
@@ -937,6 +942,10 @@ fi
%endif
%changelog
+* Tue Mar 03 2015 Honza Horak <hhorak at redhat.com> - 5.6.23-4
+- Do not use scl prefix more than once in paths
+ Based on https://www.redhat.com/archives/sclorg/2015-February/msg00038.html
+
* Mon Feb 23 2015 Honza Horak <hhorak at redhat.com> - 5.6.23-3
- Expand paths in perl scripts in mysql-test
- Use correct path in install_db script warning
diff --git a/mysql.init.in b/mysql.init.in
index 475fa72..3dfa55a 100644
--- a/mysql.init.in
+++ b/mysql.init.in
@@ -7,7 +7,7 @@
# description: MySQL database server.
# processname: mysqld
# config: @sysconfdir@/my.cnf
-# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NAME at .pid
+# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NO_PREFIX at .pid
### BEGIN INIT INFO
# Provides: mysqld
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
@@ -36,7 +36,7 @@ MYGROUP=mysql
# Edit the following file in order to re-write some of the environment
# variables defined above, like $STARTTIMEOUT, $STOPTIMEOUT, $exec
-[ -e @sysconfdir@/sysconfig/$prog ] && . @sysconfdir@/sysconfig/$prog
+[ -e @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@ ] && . @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
lockfile=/var/lock/subsys/$prog
diff --git a/server.cnf.in b/server.cnf.in
index 2c0572e..e25b599 100644
--- a/server.cnf.in
+++ b/server.cnf.in
@@ -17,7 +17,7 @@
datadir=@MYSQL_DATADIR@
socket=@MYSQL_UNIX_ADDR@
log-error=@LOG_LOCATION@
-pid-file=@PID_FILE_DIR@/@DAEMON_NAME at .pid
+pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX at .pid
# this is only for embedded server
More information about the scm-commits
mailing list