This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from kshlm/rpm-spec-and-requirements
Add an RPM specfile
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
localstatedir = "/var/lib/glusterd2" | ||
logdir = "/var/log/glusterd2" | ||
logfile = "glusterd2.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
%global _dwz_low_mem_die_limit 0 | ||
|
||
%global provider github | ||
%global provider_tld com | ||
%global project gluster | ||
%global repo glusterd2 | ||
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} | ||
%global import_path %{provider_prefix} | ||
|
||
Name: %{repo} | ||
Version: 4.0dev | ||
Release: 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 | ||
|
||
ExclusiveArch: x86_64 | ||
|
||
BuildRequires: golang >= 1.8.0 | ||
BuildRequires: glide >= 0.12.0 | ||
BuildRequires: git | ||
BuildRequires: mercurial | ||
BuildRequires: systemd | ||
|
||
Requires: glusterfs-server >= 3.11.0 | ||
Requires(post): systemd | ||
Requires(preun): systemd | ||
Requires(postun): systemd | ||
|
||
%description | ||
Preview release of the next generation GlusterFS management framework and daemon, coming with GlusterFS-4.0 | ||
|
||
%prep | ||
%setup -q -n %{name}-v%{version}-%{release} | ||
|
||
%build | ||
export GOPATH=$(pwd):%{gopath} | ||
|
||
mkdir -p src/%(dirname %{import_path}) | ||
ln -s ../../../ src/%{import_path} | ||
|
||
pushd src/%{import_path} | ||
# Install vendored packages | ||
# TODO: See if we can build with unbundled packages | ||
make vendor-install | ||
# Build glusterd2 | ||
make glusterd2 | ||
popd | ||
|
||
%install | ||
#Install glusterd2 binary | ||
install -D -p -m 0755 build/%{name} %{buildroot}%{_sbindir}/%{name} | ||
#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} | ||
# Create /var/lib/glusterd2 | ||
install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} | ||
# logdir | ||
install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} | ||
|
||
%post | ||
%systemd_post %{name}.service | ||
|
||
%preun | ||
%systemd_preun %{name}.service | ||
|
||
%postun | ||
%systemd_postun %{name}.service | ||
|
||
%files | ||
%{_sbindir}/%{name} | ||
%config(noreplace) %{_sysconfdir}/glusterd | ||
%{_unitdir}/%{name}.service | ||
%dir %{_sharedstatedir}/%{name} | ||
%dir %{_localstatedir}/log/%{name} | ||
|
||
%changelog | ||
* Mon Jul 03 2017 Kaushal M <[email protected]> - 4.0dev-7 | ||
- Initial spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=GlusterD2, the management service for GlusterFS (pre-release) | ||
Requires=rpcbind.service | ||
After=network.target rpcbind.service | ||
Before=network-online.target | ||
Conflicts=glusterd.service | ||
|
||
[Service] | ||
ExecStart=/usr/sbin/glusterd2 | ||
KillMode=process | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters