Change-Id: Ie2b005b39b893383511bd0a62d7e65980e57aa8a
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/22060
Tested-by: gerrit-photon <photon-checkins@vmware.com>
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
Summary: MySQL. |
| 2 | 2 |
Name: mysql |
| 3 | 3 |
Version: 8.0.34 |
| 4 |
-Release: 1%{?dist}
|
|
| 4 |
+Release: 2%{?dist}
|
|
| 5 | 5 |
License: GPLv2 |
| 6 | 6 |
Group: Applications/Databases |
| 7 | 7 |
Vendor: VMware, Inc. |
| ... | ... |
@@ -11,6 +11,8 @@ Url: http://www.mysql.com |
| 11 | 11 |
Source0: https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-%{version}.tar.gz
|
| 12 | 12 |
%define sha512 %{name}-boost=e5e79ac6870c214cf62c8e2830106d60e09d2e6df30654b84bb5d26864b4eabe777468a223e6ee4c1e22b7f6ec086c73e85e3f4c1fa66912b0e59b606ab46cd6
|
| 13 | 13 |
|
| 14 |
+Source1: %{name}.sysusers
|
|
| 15 |
+ |
|
| 14 | 16 |
BuildRequires: cmake |
| 15 | 17 |
BuildRequires: rpcsvc-proto-devel |
| 16 | 18 |
BuildRequires: icu-devel |
| ... | ... |
@@ -25,6 +27,8 @@ BuildRequires: libtirpc-devel |
| 25 | 25 |
BuildRequires: ncurses-devel |
| 26 | 26 |
BuildRequires: libnuma-devel |
| 27 | 27 |
BuildRequires: libfido2-devel |
| 28 |
+BuildRequires: systemd-devel |
|
| 29 |
+BuildRequires: libaio-devel |
|
| 28 | 30 |
|
| 29 | 31 |
Requires: icu |
| 30 | 32 |
Requires: libedit |
| ... | ... |
@@ -62,57 +66,108 @@ This package contains ICU data files needed by MySQL regular expressions. |
| 62 | 62 |
|
| 63 | 63 |
%build |
| 64 | 64 |
%{cmake} \
|
| 65 |
- -DCMAKE_INSTALL_PREFIX=%{_usr} \
|
|
| 65 |
+ -DBUILD_CONFIG="mysql_release" \ |
|
| 66 |
+ -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
|
|
| 67 |
+ -DINSTALL_LIBDIR="lib" \ |
|
| 68 |
+ -DINSTALL_PLUGINDIR="lib/plugin" \ |
|
| 69 |
+ -DINSTALL_SUPPORTFILESDIR="share/support-files" \ |
|
| 70 |
+ -DINSTALL_LAYOUT=RPM \ |
|
| 71 |
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
|
| 72 |
+ -DTMPDIR=%{_var}/tmp \
|
|
| 66 | 73 |
-DWITH_BOOST=boost \ |
| 67 |
- -DINSTALL_MANDIR=%{_mandir} \
|
|
| 68 |
- -DINSTALL_DOCDIR=%{_docdir} \
|
|
| 69 |
- -DINSTALL_DOCREADMEDIR=%{_docdir} \
|
|
| 70 |
- -DINSTALL_SUPPORTFILESDIR=share/support-files \ |
|
| 71 |
- -DCMAKE_BUILD_TYPE=RELEASE \ |
|
| 72 | 74 |
-DCMAKE_C_FLAGS=-fPIC \ |
| 73 | 75 |
-DCMAKE_CXX_FLAGS=-fPIC \ |
| 74 | 76 |
-DWITH_EMBEDDED_SERVER=OFF \ |
| 75 | 77 |
-DFORCE_INSOURCE_BUILD=1 \ |
| 76 | 78 |
-DWITH_UNIT_TESTS=OFF \ |
| 77 | 79 |
-DWITH_ROUTER=OFF \ |
| 78 |
- -DWITH_SYSTEM_LIBS=ON |
|
| 80 |
+ -DWITH_SYSTEM_LIBS=ON \ |
|
| 81 |
+ -DMYSQL_UNIX_ADDR="%{_sharedstatedir}/%{name}/%{name}.sock" \
|
|
| 82 |
+ -DDAEMON_NAME="mysqld" \ |
|
| 83 |
+ -DNICE_PROJECT_NAME="MySQL" \ |
|
| 84 |
+ -DWITH_SYSTEMD=1 \ |
|
| 85 |
+ -DSYSTEMD_SERVICE_NAME="mysqld" \ |
|
| 86 |
+ -DSYSTEMD_PID_DIR="/run/mysqld" |
|
| 79 | 87 |
|
| 80 | 88 |
%{cmake_build}
|
| 81 | 89 |
|
| 82 | 90 |
%install |
| 83 | 91 |
%{cmake_install}
|
| 84 | 92 |
|
| 85 |
-%if 0%{?with_check}
|
|
| 93 |
+# Ensure that needed directories exist |
|
| 94 |
+install -d -m 0751 %{buildroot}%{_sharedstatedir}/%{name}
|
|
| 95 |
+install -d -m 0755 %{buildroot}/run/mysqld
|
|
| 96 |
+install -d -m 0750 %{buildroot}%{_sharedstatedir}/%{name}-files
|
|
| 97 |
+install -d -m 0750 %{buildroot}%{_sharedstatedir}/%{name}-keyring
|
|
| 98 |
+ |
|
| 99 |
+pushd %{__cmake_builddir}
|
|
| 100 |
+# Install config and logrotate |
|
| 101 |
+install -D -m 0644 packaging/rpm-common/%{name}.logrotate \
|
|
| 102 |
+ %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
| 103 |
+ |
|
| 104 |
+install -D -m 0644 packaging/rpm-common/my.cnf \ |
|
| 105 |
+ %{buildroot}%{_sysconfdir}/my.cnf
|
|
| 106 |
+ |
|
| 107 |
+install -d %{buildroot}%{_sysconfdir}/my.cnf.d
|
|
| 108 |
+popd |
|
| 109 |
+ |
|
| 110 |
+rm -rf %{buildroot}%{_datadir}/%{name}-test \
|
|
| 111 |
+ %{buildroot}%{_libdir}/*.a
|
|
| 112 |
+ |
|
| 113 |
+install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.sysusers
|
|
| 114 |
+ |
|
| 86 | 115 |
%check |
| 87 |
-pushd %{__cmake_builddir}/mysql-test
|
|
| 88 |
-./mysql-test-run.pl --parallel=$(nproc) \ |
|
| 116 |
+pushd %{__cmake_builddir}/%{name}-test
|
|
| 117 |
+./%{name}-test-run.pl --parallel=$(nproc) \
|
|
| 89 | 118 |
--force --retry=2 \ |
| 90 | 119 |
--max-test-fail=9999 \ |
| 91 | 120 |
--summary-report=test-summary.log ||: |
| 92 |
-[ $(grep -w "Completed:" var/test-summary.log | cut -d ' ' -f5 | cut -d '.' -f1) -gt 95 ] |
|
| 121 |
+test $(grep -w "Completed:" var/test-summary.log | cut -d' ' -f5 | cut -d. -f1) -gt 95 |
|
| 93 | 122 |
popd |
| 94 |
-%endif |
|
| 95 |
- |
|
| 96 |
-%{ldconfig_scriptlets}
|
|
| 97 | 123 |
|
| 98 | 124 |
%clean |
| 99 | 125 |
rm -rf %{buildroot}/*
|
| 100 | 126 |
|
| 127 |
+%pre |
|
| 128 |
+if [ $1 -eq 1 ]; then |
|
| 129 |
+ %sysusers_create_compat %{SOURCE1}
|
|
| 130 |
+fi |
|
| 131 |
+ |
|
| 132 |
+%post |
|
| 133 |
+/sbin/ldconfig |
|
| 134 |
+[ -e /var/log/mysqld.log ] || \ |
|
| 135 |
+ install -m0640 -omysql -gmysql /dev/null /var/log/mysqld.log >/dev/null 2>&1 || : |
|
| 136 |
+ |
|
| 137 |
+%systemd_post mysqld.service |
|
| 138 |
+ |
|
| 139 |
+%preun |
|
| 140 |
+%systemd_preun mysqld.service |
|
| 141 |
+ |
|
| 142 |
+%postun |
|
| 143 |
+/sbin/ldconfig |
|
| 144 |
+%systemd_postun_with_restart mysqld.service |
|
| 145 |
+ |
|
| 101 | 146 |
%files |
| 102 | 147 |
%defattr(-,root,root) |
| 103 |
-%{_libdir}/plugin/*
|
|
| 104 |
-%{_libdir}/*.so.*
|
|
| 148 |
+%dir %attr(751,mysql,mysql) %{_sharedstatedir}/mysql
|
|
| 149 |
+%dir %attr(755,mysql,mysql) /run/mysqld |
|
| 150 |
+%dir %attr(750,mysql,mysql) %{_sharedstatedir}/mysql-files
|
|
| 151 |
+%dir %attr(750,mysql,mysql) %{_sharedstatedir}/mysql-keyring
|
|
| 152 |
+%config(noreplace) %{_sysconfdir}/my.cnf
|
|
| 153 |
+%dir %{_sysconfdir}/my.cnf.d
|
|
| 154 |
+%{_sysusersdir}/%{name}.sysusers
|
|
| 105 | 155 |
%{_bindir}/*
|
| 106 |
-%{_mandir}/man1/*
|
|
| 107 |
-%{_mandir}/man8/*
|
|
| 108 |
-%{_datadir}/support-files/*
|
|
| 109 |
-%exclude %{_usr}/mysql-test
|
|
| 110 |
-%exclude %{_datadir}
|
|
| 156 |
+%{_sbindir}/*
|
|
| 157 |
+%{_libdir}/*.so.*
|
|
| 158 |
+%{_libdir}/plugin/*
|
|
| 159 |
+%{_datadir}/*
|
|
| 160 |
+%{_unitdir}/*.service
|
|
| 161 |
+%{_tmpfilesdir}/%{name}.conf
|
|
| 162 |
+%{_sysconfdir}/logrotate.d/%{name}
|
|
| 111 | 163 |
|
| 112 | 164 |
%files devel |
| 113 | 165 |
%defattr(-,root,root) |
| 114 | 166 |
%{_libdir}/*.so
|
| 115 |
-%{_libdir}/*.a
|
|
| 116 | 167 |
%{_includedir}/*
|
| 117 | 168 |
%{_libdir}/pkgconfig/mysqlclient.pc
|
| 118 | 169 |
|
| ... | ... |
@@ -120,6 +175,8 @@ rm -rf %{buildroot}/*
|
| 120 | 120 |
%defattr(-,root,root) |
| 121 | 121 |
|
| 122 | 122 |
%changelog |
| 123 |
+* Sun Oct 08 2023 Shreenidhi Shedi <sshedi@vmware.com> 8.0.34-2 |
|
| 124 |
+- Add systemd service files for mysql-server |
|
| 123 | 125 |
* Sun Jul 23 2023 Shreenidhi Shedi <sshedi@vmware.com> 8.0.34-1 |
| 124 | 126 |
- Upgrade to v8.0.34 |
| 125 | 127 |
* Mon Jul 17 2023 Shreenidhi Shedi <sshedi@vmware.com> 8.0.33-4 |