From bb609ecd67cd2f8c22e1de0ead2eaacecc62986c Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Fri, 27 Oct 2017 10:05:53 +0530 Subject: [PATCH] extras/rpms: Update specfile to support templates I should be using make install to install in specfile, but can't get it to work as I expected right now. --- extras/rpms/glusterd2.spec | 26 ++++++++++++++----- extras/rpms/{glusterd.toml => glusterd2.toml} | 1 + 2 files changed, 21 insertions(+), 6 deletions(-) rename extras/rpms/{glusterd.toml => glusterd2.toml} (65%) diff --git a/extras/rpms/glusterd2.spec b/extras/rpms/glusterd2.spec index 67e727604..cd6690e92 100644 --- a/extras/rpms/glusterd2.spec +++ b/extras/rpms/glusterd2.spec @@ -14,7 +14,7 @@ Summary: The GlusterFS management daemon (preview) License: GPLv2 or LGPLv3+ URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/v%{version}-%{release}/%{name}-v%{version}-%{release}.tar.gz -Source1: glusterd.toml +Source1: glusterd2.toml ExclusiveArch: x86_64 @@ -24,7 +24,7 @@ BuildRequires: git BuildRequires: mercurial BuildRequires: systemd -Requires: glusterfs-server >= 3.11.0 +Requires: glusterfs-server >= 4.0dev Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -47,20 +47,27 @@ pushd src/%{import_path} make vendor-install # Build glusterd2 make glusterd2 +make glustercli popd %install -#Install glusterd2 binary +# TODO: Use make install to install +#Install glusterd2 & glustercli binary install -D -p -m 0755 build/%{name} %{buildroot}%{_sbindir}/%{name} +install -D -p -m 0755 build/glustercli %{buildroot}%{_sbindir}/glustercli #Install systemd unit install -D -p -m 0644 extras/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service #Install glusterd config into etc -install -d -m 0755 %{buildroot}%{_sysconfdir}/glusterd -install -m 0644 -t %{buildroot}%{_sysconfdir}/glusterd %{SOURCE1} +install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name} +install -m 0644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE1} # Create /var/lib/glusterd2 install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} # logdir install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} +#Install templates +install -d -m 0755 %{buildroot}%{_datadir}/%{name}/templates +install -D -m 0644 -t %{buildroot}%{_datadir}/%{name}/templates volgen/templates/*.graph + %post %systemd_post %{name}.service @@ -73,11 +80,18 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} %files %{_sbindir}/%{name} -%config(noreplace) %{_sysconfdir}/glusterd +%{_sbindir}/glustercli +%config(noreplace) %{_sysconfdir}/%{glusterd2} %{_unitdir}/%{name}.service %dir %{_sharedstatedir}/%{name} %dir %{_localstatedir}/log/%{name} +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/templates +%{_datadir}/%{name}/templates/* %changelog +* Thu Oct 26 2017 Kaushal M - 4.0dev-8 +- Update spec file + * Mon Jul 03 2017 Kaushal M - 4.0dev-7 - Initial spec diff --git a/extras/rpms/glusterd.toml b/extras/rpms/glusterd2.toml similarity index 65% rename from extras/rpms/glusterd.toml rename to extras/rpms/glusterd2.toml index 051a89185..3cc27ef9b 100644 --- a/extras/rpms/glusterd.toml +++ b/extras/rpms/glusterd2.toml @@ -1,3 +1,4 @@ localstatedir = "/var/lib/glusterd2" logdir = "/var/log/glusterd2" logfile = "glusterd2.log" +templatesdir = "/usr/share/glusterd2/templates"