[packages/mysql-router] package extra files (systemd service, tmpfiles, config)

glen glen at pld-linux.org
Tue Oct 27 16:47:55 CET 2015


commit 861ab58cbceefef3eb872309d7e36dfa7c24a7d8
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Oct 27 17:47:48 2015 +0200

    package extra files (systemd service, tmpfiles, config)

 mysql-router.spec | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/mysql-router.spec b/mysql-router.spec
index 05fc9c8..c24627b 100644
--- a/mysql-router.spec
+++ b/mysql-router.spec
@@ -1,5 +1,9 @@
 # TODO
 # - fix shared libs SONAME
+# - user (use mysql user like upstream .spec does)
+# - file/dir permissions (configs will likely contain passwords?)
+# - services (systemd, init.d)
+# - logrotate
 Summary:	MySQL Router
 Name:		mysql-router
 Version:	2.0.2
@@ -42,6 +46,13 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+install -d $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/mysqlrouter \
+	$RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir},%{_sysconfdir}/mysqlrouter}
+
+cp -p build/packaging/rpm-oel/mysqlrouter.service $RPM_BUILD_ROOT%{systemdunitdir}/mysqlrouter.service
+cp -p build/packaging/rpm-oel/mysqlrouter.tmpfiles.d $RPM_BUILD_ROOT%{systemdtmpfilesdir}/mysqlrouter.conf
+cp -p build/packaging/rpm-oel/mysqlrouter.ini $RPM_BUILD_ROOT%{_sysconfdir}/mysqlrouter/mysqlrouter.ini
+
 # no -devel yet
 %{__rm} -r $RPM_BUILD_ROOT%{_includedir}/mysql/mysqlrouter
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libmysqlharness.a
@@ -57,6 +68,8 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc README.txt License.txt
+%dir %{_sysconfdir}/mysqlrouter
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mysqlrouter/mysqlrouter.ini
 %attr(755,root,root) %{_sbindir}/mysqlrouter
 %attr(755,root,root) %{_libdir}/libmysqlharness.so.0
 %attr(755,root,root) %{_libdir}/libmysqlrouter.so.1
@@ -65,3 +78,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/mysqlrouter/keepalive.so
 %attr(755,root,root) %{_libdir}/mysqlrouter/logger.so
 %attr(755,root,root) %{_libdir}/mysqlrouter/routing.so
+%{systemdunitdir}/mysqlrouter.service
+%{systemdtmpfilesdir}/mysqlrouter.conf
+%dir %{_localstatedir}/run/mysqlrouter
+%dir %{_localstatedir}/log/mysqlrouter
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mysql-router.git/commitdiff/861ab58cbceefef3eb872309d7e36dfa7c24a7d8



More information about the pld-cvs-commit mailing list