[packages/lizardfs: 3/4] Adapterized, split /var/lib/lizardfs directory for each daemon.

matkor matkor at pld-linux.org
Thu Jun 16 17:25:16 CEST 2016


commit 69fdf7785ae7014da373b9a6a869b6bdffab547f
Author: Mateusz Korniak <matkor at pld-linux.org>
Date:   Thu Jun 16 16:29:38 2016 +0200

    Adapterized, split /var/lib/lizardfs  directory for each daemon.

 lizardfs.spec | 119 +++++++++++++++++++++++++++++++---------------------------
 1 file changed, 64 insertions(+), 55 deletions(-)
---
diff --git a/lizardfs.spec b/lizardfs.spec
index 444f34e..e7a5413 100644
--- a/lizardfs.spec
+++ b/lizardfs.spec
@@ -1,6 +1,7 @@
-# TODO: 
+# TODO:
 # - Add daemon startup scripts
-# - Verify if CGI server works, dependencies 
+#   https://github.com/moosefs/moosefs/blob/master/systemd/moosefs-master.service.in
+# - Verify if CGI server works, dependencies
 
 Summary:	Open Source Distributed File System
 Summary(pl.UTF-8):	Rozporoszony system plików Open Source
@@ -9,62 +10,69 @@ Version:	3.9.4
 Release:	0.1
 License:	GPL v3
 Group:		Applications
-Source0:	https://github.com/%{name}/%{name}/archive/v.%{version}.tar.gz
+Source0:	https://github.com/lizardfs/lizardfs/archive/v.%{version}.tar.gz
 # Source0-md5:	71766d18a5066506e54d952ab6056bd3
-Patch0:          %{name}-cmake_fix.patch
+Patch0:		%{name}-cmake_fix.patch
 URL:		https://github.com/lizardfs/lizardfs
-BuildRequires:  cmake >= 3.4.0
-BuildRequires:  zlib-devel
-BuildRequires:  boost-devel
-BuildRequires:  pkgconfig
-BuildRequires:  /usr/bin/a2x			# asciidoc
-BuildRequires:  docbook-dtd45-xml
-BuildRequires:  libfuse-devel
-# Requires:	
+BuildRequires:	/usr/bin/a2x			#
+BuildRequires:	asciidoc
+BuildRequires:	boost-devel
+BuildRequires:	cmake >= 3.4.0
+BuildRequires:	docbook-dtd45-xml
+BuildRequires:	libfuse-devel
+BuildRequires:	pkgconfig
+BuildRequires:	zlib-devel
+# Requires:
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-LizardFS is a highly reliable, scalable and efficient distributed file system. 
-It spreads data over a number of physical servers, making it visible to an end user as a single file system.
+LizardFS is a highly reliable, scalable and efficient distributed file
+system. It spreads data over a number of physical servers, making it
+visible to an end user as a single file system.
 
 %description -l pl.UTF-8
-LizardFS is jest niezawodnym, skalowalnym i efektywnym rozproszonym systemem plików.
-Rozkłada dane na rózne fizyczne serwery, dająć użytkownikowi końcowemu widok pojedynczego systemu plików.
+LizardFS is jest niezawodnym, skalowalnym i efektywnym rozproszonym
+systemem plików. Rozkłada dane na rózne fizyczne serwery, dająć
+użytkownikowi końcowemu widok pojedynczego systemu plików.
 
 
 %package master
-Summary:        Master/shadow metadata server
-Group:          Applications
-Requires:	%{name} == %{version}-%{release}
+Summary:	Master/shadow metadata server
+Group:		Applications
+Requires:	%{name} = %{version}-%{release}
+
 %description master
 Master/shadow metadata server
 
 
 %package chunkserver
-Summary:        Chunk server
-Group:          Applications
-Requires:	%{name} == %{version}-%{release}
+Summary:	Chunk server
+Group:		Applications
+Requires:	%{name} = %{version}-%{release}
+
 %description chunkserver
 Chunk server
 
 
 %package metalogger
-Summary:        Metalogger
-Group:          Applications
-Requires:	%{name} == %{version}-%{release}
+Summary:	Metalogger
+Group:		Applications
+Requires:	%{name} = %{version}-%{release}
+
 %description metalogger
 Metalogger
 
 
 %package cgiserver
-Summary:        CGI server
-Group:          Applications
-Requires:	%{name} == %{version}-%{release}
+Summary:	CGI server
+Group:		Applications
+Requires:	%{name} = %{version}-%{release}
+
 %description cgiserver
 CGI server
 
 %prep
-%setup -q -n lizardfs-v.%{version}
+%setup -q -n %{name}-v.%{version}
 %patch0 -p1
 
 %build
@@ -72,7 +80,7 @@ install -d build
 cd build
 %cmake \
 	-DCMAKE_BUILD_TYPE=Release  \
-        ../
+		../
 %{__make}
 
 %install
@@ -80,12 +88,16 @@ rm -rf $RPM_BUILD_ROOT
 cd build
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
-	
-# /usr/etc/mfs/ ?
+
+# %{_prefix}%{_sysconfdir}/mfs/ ?
 install -d $RPM_BUILD_ROOT%{_sysconfdir}
-mv $RPM_BUILD_ROOT/usr/etc/mfs/  $RPM_BUILD_ROOT/etc/mfs/
+mv $RPM_BUILD_ROOT%{_prefix}%{_sysconfdir}/mfs/ $RPM_BUILD_ROOT%{_sysconfdir}/mfs/
 
 install -d $RPM_BUILD_ROOT/var/lib/%{name}
+cp $RPM_BUILD_ROOT/usr/var/lib/mfs/metadata.mfs.empty  $RPM_BUILD_ROOT%{_sysconfdir}/mfs/
+install -d $RPM_BUILD_ROOT/var/lib/%{name}/master
+install -d $RPM_BUILD_ROOT/var/lib/%{name}/chunkserver
+mv $RPM_BUILD_ROOT/usr/var/lib/mfs/metadata.mfs.empty  $RPM_BUILD_ROOT/var/lib/%{name}/master/metadata.mfs
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -109,27 +121,23 @@ fi
 %defattr(644,root,root,755)
 %doc doc COPYING README UPGRADE NEWS INSTALL
 ## %attr(755,root,root) %{_bindir}/*
-%dir /etc/mfs
-%dir /var/lib/%{name}
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/globaliolimits.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/iolimits.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/mfsexports.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/mfsgoals.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/mfsmount.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/mfstopology.cfg.dist
+%dir %{_sysconfdir}/mfs
+%dir %attr(750,root,root) /var/lib/%{name}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/globaliolimits.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/iolimits.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfsexports.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfsgoals.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfsmount.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfstopology.cfg.dist
 %{_mandir}
 
 %attr(755,root,root) %{_bindir}/lizardfs-admin
 %attr(755,root,root) %{_bindir}/lizardfs-probe
-
-
 %attr(755,root,root) %{_bindir}/mfsappendchunks
 %attr(755,root,root) %{_bindir}/mfscheckfile
 %attr(755,root,root) %{_bindir}/mfsdeleattr
 %attr(755,root,root) %{_bindir}/mfsdirinfo
 %attr(755,root,root) %{_bindir}/mfsfileinfo
-
-
 %attr(755,root,root) %{_bindir}/mfsfilerepair
 %attr(755,root,root) %{_bindir}/mfsgeteattr
 %attr(755,root,root) %{_bindir}/mfsgetgoal
@@ -147,7 +155,6 @@ fi
 %attr(755,root,root) %{_bindir}/mfssettrashtime
 %attr(755,root,root) %{_bindir}/mfssnapshot
 %attr(755,root,root) %{_bindir}/mfstools
-
 %attr(755,root,root) %{_sbindir}/mfsmetadump
 %attr(755,root,root) %{_sbindir}/mfsmetarestore
 %attr(755,root,root) %{_sbindir}/mfsrestoremaster
@@ -155,27 +162,29 @@ fi
 %files master
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/mfsmaster
-%config(noreplace) %verify(not md5 mtime size) /etc/mfs/mfsmaster.cfg.dist
-%config(noreplace) %verify(not md5 mtime size) /usr/var/lib/mfs/metadata.mfs.empty
-
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfsmaster.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/metadata.mfs.empty
+%dir %attr(750,mfs,mfs) /var/lib/%{name}/master
+%config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/master/metadata.mfs
 
 %files chunkserver
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/mfschunkserver
-%config(noreplace) %verify(not md5 mtime size) /etc/mfs/mfschunkserver.cfg.dist
-%config(noreplace) %verify(not md5 mtime size)        /etc/mfs/mfshdd.cfg.dist
-
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfschunkserver.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfshdd.cfg.dist
+%dir %attr(750,mfs,mfs) /var/lib/%{name}/chunkserver
 
 %files metalogger
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/mfsmetalogger
-%config(noreplace) %verify(not md5 mtime size) /etc/mfs/mfsmetalogger.cfg.dist
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mfs/mfsmetalogger.cfg.dist
+# %dir %attr(750,mfs,mfs) /var/lib/%{name}/metalogger
 
 %files cgiserver
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/lizardfs-cgiserver
 %attr(755,root,root) %{_sbindir}/mfscgiserv
-/usr/share/mfscgi/
-## %config(noreplace) %verify(not md5 mtime size) /etc/mfs/mfsmetalogger.cfg.dist
+%{_datadir}/mfscgi/
+# %dir %attr(750,mfs,mfs) /var/lib/%{name}/cgiserver
 
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lizardfs.git/commitdiff/16ae71b3c578995fc90434a300c86c0eb49af751



More information about the pld-cvs-commit mailing list