-
Notifications
You must be signed in to change notification settings - Fork 82
Add an RPM specfile #333
Add an RPM specfile #333
Changes from all commits
68caadb
ee11150
ff57aa8
be3f3eb
0c294e2
d92debb
42a7816
24e66b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" |
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ fi | |
GOBUILD_TAGS="novirt noaugeas " | ||
VERSION=$($(dirname $0)/pkg-version --full) | ||
LDFLAGS="-X github.com/gluster/glusterd2/gdctx.GlusterdVersion=$VERSION" | ||
LDFLAGS+=" -B 0x$(head -c20 /dev/urandom | od -An -tx1 | tr -d ' \n')" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT, this would make the builds un-reproducible. As a result, maybe best to avoid doing this. More info here: https://reproducible-builds.org/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fedora requires this though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @purpleidea I was also looking for this sometime back and Go doesn't officially support reproducible builds yet. @kshlm We should base build id based on git sha-1 eventually. https://fedoraproject.org/wiki/PackagingDrafts/Go#Build_ID |
||
BIN=$(basename $(go list -f '{{.ImportPath}}')) | ||
|
||
if [ "$PLUGINS" == "yes" ]; then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be as part of make dist. Good if we can avoid network calls during RPM/packaging create.
This is fine for current release, we can take care of this issue later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea. I'll do this next time. Makes is easier to do a release.