From ec7088d30c8d49aef4ea37ffdc18b20a627b8206 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 30 May 2015 09:42:14 +0300 Subject: [PATCH 1/1] up to 2.0.11; add nogit patch --- etcd.spec | 28 +++++++++++++++++++--------- nogit.patch | 11 +++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 nogit.patch diff --git a/etcd.spec b/etcd.spec index c988de6..d7f1ea6 100644 --- a/etcd.spec +++ b/etcd.spec @@ -1,31 +1,40 @@ -# disable debug packages for go packages -%define debug_package %{nil} +# git rev-parse --short v2.0.11 +%define githash 777151f Summary: A highly-available key value store for shared configuration Name: etcd -Version: 0.3.0 +Version: 2.0.11 Release: 1 License: Apache v2.0 Group: Daemons Source0: https://github.com/coreos/etcd/archive/v%{version}/%{name}-%{version}.tar.gz -# Source0-md5: 123d5b2143ad4b21cb89af3e56fd0852 +# Source0-md5: e928ca4a227930ae17bcef5cdf5478da +Patch0: nogit.patch URL: https://github.com/coreos/etcd/ -BuildRequires: golang +BuildRequires: golang >= 1.2.1-3 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +# disable debug packages for go packages +%define debug_package %{nil} + +# this will fool adapter not to touch 'etcd' +%define _sysconfdir __bogus__value + %description A highly-available key value store for shared configuration. %prep %setup -q -sed -i "s/^\(VER=\).*HEAD)/\1%{version}/" scripts/release-version +%patch0 -p1 %build -./build +GIT_SHA=%{githash} \ +sh -xe build %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_bindir} -install -p %{name} $RPM_BUILD_ROOT%{_bindir} +install -p bin/etcd $RPM_BUILD_ROOT%{_bindir} +install -p bin/etcdctl $RPM_BUILD_ROOT%{_bindir} %clean rm -rf $RPM_BUILD_ROOT @@ -33,4 +42,5 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc LICENSE README.md Documentation/internal-protocol-versioning.md -%attr(755,root,root) %{_bindir}/%{name} +%attr(755,root,root) %{_bindir}/etcd +%attr(755,root,root) %{_bindir}/etcdctl diff --git a/nogit.patch b/nogit.patch new file mode 100644 index 0000000..77c0b2c --- /dev/null +++ b/nogit.patch @@ -0,0 +1,11 @@ +--- etcd-2.0.11/build~ 2015-05-15 23:54:32.000000000 +0300 ++++ etcd-2.0.11/build 2015-05-30 09:37:00.739376624 +0300 +@@ -11,7 +11,7 @@ + + eval $(go env) + +-GIT_SHA=`git rev-parse --short HEAD` ++GIT_SHA=${GIT_SHA:-`git rev-parse --short HEAD`} + + # Static compilation is useful when etcd is run in a container + CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s -X ${REPO_PATH}/version.GitSHA ${GIT_SHA}" -o bin/etcd ${REPO_PATH} -- 2.44.0