%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/{ld.so.conf.d,logrotate.d,rc.d/init.d,sysconfig,mysql/%{mysqlversion},skel} \
- $RPM_BUILD_ROOT/var/{lib/mysqlrouter,log/{archive,}/{mysql,mysqlrouter}/%{mysqlversion},lib/{mysql,mysql-files}/%{mysqlversion}} \
+ $RPM_BUILD_ROOT/var/{log/{archive,}/{mysql,mysqlrouter}/%{mysqlversion},lib/{mysql,mysql-files,mysqlrouter}/%{mysqlversion}} \
$RPM_BUILD_ROOT%{_libdir}
%{__make} -C build install \
%dir %{_datadir}/mysql
%attr(751,root,root) %dir /var/lib/mysql
%attr(751,root,root) %dir /var/lib/mysql-files
+%attr(751,root,root) %dir /var/lib/mysqlrouter
%attr(751,root,root) %dir /var/log/mysql
%attr(751,root,root) %dir /var/log/archive/mysql
+%attr(751,root,root) %dir /var/log/mysqlrouter
+%attr(751,root,root) %dir /var/log/archive/mysqlrouter
%files dirs
%defattr(644,root,root,755)
%{_sysconfdir}/ld.so.conf.d/%{name}-router.conf
%dir %{_libdir}/mysql/%{mysqlversion}/router
%dir %{_libdir}/mysql/%{mysqlversion}/router/private
+%attr(750,root,root) %dir /var/lib/mysqlrouter/%{mysqlversion}
%attr(755,root,root) %{_libdir}/mysql/%{mysqlversion}/bin/mysqlrouter
%attr(755,root,root) %{_libdir}/mysql/%{mysqlversion}/bin/mysqlrouter_keyring
%attr(755,root,root) %{_libdir}/mysql/%{mysqlversion}/bin/mysqlrouter_passwd
%{_datadir}/mysql/%{mysqlversion}/man/man1/mysqlrouter.1*
%{_datadir}/mysql/%{mysqlversion}/man/man1/mysqlrouter_passwd.1*
%{_datadir}/mysql/%{mysqlversion}/man/man1/mysqlrouter_plugin_info.1*
-%attr(751,root,root) %dir /var/lib/mysqlrouter
-%attr(751,root,root) %dir /var/log/mysqlrouter
%attr(750,mysqlrouter,mysqlrouter) %dir /var/log/mysqlrouter/%{mysqlversion}
%attr(750,mysqlrouter,mysqlrouter) %dir /var/log/archive/mysqlrouter/%{mysqlversion}
%attr(640,mysql,mysql) %ghost /var/log/mysqlrouter/%{mysqlversion}/*