Blame SPECS/etcd.spec

18e3f8
%if 0%{?fedora}
18e3f8
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
18e3f8
%global _dwz_low_mem_die_limit 0
18e3f8
%else
18e3f8
%global debug_package   %{nil}
18e3f8
%endif
18e3f8
%global provider        github
18e3f8
%global provider_tld    com
18e3f8
%global project         coreos
18e3f8
%global repo            etcd
be5080
%global commit          0678329cd64a64d7478eae6c35ed0bea0346da86
be5080
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
18e3f8
18e3f8
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
18e3f8
18e3f8
Name:		%{repo}
be5080
Version:	2.0.11
18e3f8
Release:	2%{?dist}
319373
Summary:	A highly-available key value store for shared configuration
319373
License:	ASL 2.0
18e3f8
URL:		https://%{import_path}
18e3f8
Source0:	https://%{import_path}/archive/v%{version}.tar.gz
18e3f8
Source1:	%{name}.service
18e3f8
Source2:	%{name}.conf
18e3f8
be5080
Patch0:		don-t-set-GIT_SHA-in-build-script.patch
18e3f8
%if 0%{?fedora}
be5080
Patch1: 	etcd-2.0.1-Replace-depricated-ErrWrongType-with-its-local-defin.patch
18e3f8
%endif
18e3f8
18e3f8
ExclusiveArch:  %{ix86} x86_64 %{arm}
18e3f8
BuildRequires:	golang >= 1.2.1-3
18e3f8
%if 0%{?fedora}
18e3f8
BuildRequires:	golang(code.google.com/p/gogoprotobuf/proto)
18e3f8
BuildRequires:	golang(github.com/codegangsta/cli)
18e3f8
BuildRequires:	golang(github.com/coreos/go-etcd/etcd)
18e3f8
BuildRequires:  golang(github.com/jonboulle/clockwork)
18e3f8
BuildRequires:  golang(github.com/stretchr/testify/assert)
18e3f8
BuildRequires:  golang(golang.org/x/net/context)
18e3f8
%endif
319373
BuildRequires:	systemd
319373
Requires(pre):	shadow-utils
319373
Requires(post): systemd
319373
Requires(preun): systemd
319373
Requires(postun): systemd
319373
319373
%description
319373
A highly-available key value store for shared configuration.
319373
18e3f8
%if 0%{?fedora}
18e3f8
%package devel
18e3f8
BuildRequires:  golang >= 1.2.1-3
18e3f8
BuildRequires:	golang(code.google.com/p/gogoprotobuf/proto)
18e3f8
BuildRequires:	golang(github.com/codegangsta/cli)
18e3f8
BuildRequires:	golang(github.com/coreos/go-etcd/etcd)
18e3f8
BuildRequires:  golang(golang.org/x/net/context)
18e3f8
BuildRequires:  golang(github.com/jonboulle/clockwork)
18e3f8
BuildRequires:  golang(github.com/stretchr/testify/assert)
18e3f8
Requires:       golang >= 1.2.1-3
18e3f8
Provides: golang(%{import_path}/client) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/discovery) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/error) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdctl/command) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdmain) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdserver) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdserver/etcdhttp) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdserver/etcdhttp/httptypes) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdserver/etcdserverpb) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/etcdserver/stats) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/integration) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/migrate) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/migrate/etcd4pb) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/coreos) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/cors) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/crc) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/fileutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/flags) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/idutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/ioutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/metrics) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/netutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/osutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/pbutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/testutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/timeutil) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/transport) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/types) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/pkg/wait) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/proxy) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/raft) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/raft/raftpb) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/raft/rafttest) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/rafthttp) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/snap) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/snap/snappb) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/store) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/version) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/wal) = %{version}-%{release}
18e3f8
Provides: golang(%{import_path}/wal/walpb) = %{version}-%{release}
18e3f8
Summary:        etcd golang devel libraries
18e3f8
ExclusiveArch:  %{ix86} x86_64 %{arm}
18e3f8
18e3f8
%description devel
18e3f8
golang development libraries for etcd, a highly-available key value store for
18e3f8
shared configuration.
18e3f8
%endif
18e3f8
319373
%prep
18e3f8
%setup -qn %{name}-%{version}
18e3f8
%if 0%{?fedora}
18e3f8
rm -rf Godeps/_workspace/src/github.com/{codegangsta,coreos,stretchr,jonboulle}
18e3f8
rm -rf Godeps/_workspace/src/{code.google.com,bitbucket.org,golang.org}
18e3f8
18e3f8
find . -name "*.go" \
18e3f8
       -print |\
18e3f8
       xargs sed -i 's/github.com\/coreos\/etcd\/Godeps\/_workspace\/src\///g'
18e3f8
18e3f8
%endif
be5080
%patch0 -p1
319373
319373
%build
18e3f8
%if 0%{?fedora}
18e3f8
# Make link for etcd itself
18e3f8
mkdir -p src/github.com/coreos
18e3f8
ln -s ../../../ src/github.com/coreos/etcd
18e3f8
18e3f8
export GOPATH=$(pwd):%{gopath}:$GOPATH
18e3f8
# *** ERROR: No build ID note found in /.../BUILDROOT/etcd-2.0.0-1.rc1.fc22.x86_64/usr/bin/etcd
18e3f8
function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; }
18e3f8
gobuild -o bin/etcd %{import_path}
18e3f8
gobuild -o bin/etcdctl %{import_path}/etcdctl
18e3f8
gobuild -o bin/etcd-migrate %{import_path}/tools/%{name}-migrate
18e3f8
%else
be5080
export GIT_SHA=%{shortcommit}
319373
./build
18e3f8
%endif
18e3f8
319373
319373
%install
18e3f8
install -D -p -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
18e3f8
install -D -p -m 0755 bin/%{name}ctl %{buildroot}%{_bindir}/%{name}ctl
18e3f8
%if 0%{?fedora}
18e3f8
install -D -p -m 0755 bin/%{name}-migrate %{buildroot}%{_bindir}/%{name}-migrate
18e3f8
%endif
18e3f8
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
18e3f8
install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}
18e3f8
install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2}
c5056e
319373
319373
# And create /var/lib/etcd
18e3f8
install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name}
18e3f8
18e3f8
%if 0%{?fedora}
18e3f8
# Install files for devel sub-package
18e3f8
install -d %{buildroot}/%{gopath}/src/%{import_path}
18e3f8
cp -pav main.go %{buildroot}/%{gopath}/src/%{import_path}/
18e3f8
for dir in client discovery error etcdctl etcdmain etcdserver \
18e3f8
        migrate pkg proxy raft rafthttp snap store version wal \
18e3f8
	integration
18e3f8
do
18e3f8
    cp -rpav ${dir} %{buildroot}/%{gopath}/src/%{import_path}/
18e3f8
done
18e3f8
%endif
c5056e
319373
%check
18e3f8
%if 0%{?fedora}
18e3f8
export GOPATH=%{buildroot}%{gopath}:%{gopath}
18e3f8
go test %{import_path}/client
18e3f8
go test %{import_path}/discovery
18e3f8
go test %{import_path}/error
18e3f8
go test %{import_path}/etcdctl/command
18e3f8
go test %{import_path}/etcdmain
18e3f8
#go test %{import_path}/etcdserver
18e3f8
#go test %{import_path}/etcdserver/etcdhttp
18e3f8
#go test %{import_path}/etcdserver/etcdhttp/httptypes
18e3f8
#go test %{import_path}/integration
18e3f8
go test %{import_path}/migrate
18e3f8
#go test %{import_path}/pkg/fileutil
18e3f8
go test %{import_path}/pkg/flags
18e3f8
go test %{import_path}/pkg/ioutil
18e3f8
#go test %{import_path}/pkg/transport
18e3f8
go test %{import_path}/pkg/types
18e3f8
go test %{import_path}/pkg/wait
18e3f8
go test %{import_path}/proxy
18e3f8
go test %{import_path}/raft
18e3f8
go test %{import_path}/rafthttp
18e3f8
go test %{import_path}/snap
18e3f8
#go test %{import_path}/store
18e3f8
go test %{import_path}/wal
18e3f8
%else
18e3f8
#./cover // requires golang cover
18e3f8
#./test  // requires golang cover
18e3f8
%endif
319373
319373
%pre
18e3f8
getent group %{name} >/dev/null || groupadd -r %{name}
18e3f8
getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \
18e3f8
	-s /sbin/nologin -c "etcd user" %{name}
18e3f8
319373
%post
319373
%systemd_post %{name}.service
319373
319373
%preun
319373
%systemd_preun %{name}.service
319373
319373
%postun
319373
%systemd_postun %{name}.service
319373
319373
%files
18e3f8
%config(noreplace) %{_sysconfdir}/%{name}
18e3f8
%{_bindir}/%{name}
18e3f8
%{_bindir}/%{name}ctl
18e3f8
%if 0%{?fedora}
18e3f8
%{_bindir}/%{name}-migrate
18e3f8
%endif
18e3f8
%dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name}
319373
%{_unitdir}/%{name}.service
319373
%doc LICENSE README.md Documentation/internal-protocol-versioning.md
18e3f8
%doc Godeps/Godeps.json
319373
18e3f8
%if 0%{?fedora}
18e3f8
%files devel
18e3f8
%doc LICENSE README.md Documentation/internal-protocol-versioning.md
18e3f8
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
18e3f8
%{gopath}/src/%{import_path}
18e3f8
%doc Godeps/Godeps.json
18e3f8
%endif
319373
18e3f8
%changelog
be5080
* Fri May 22 2015 jchaloup <jchaloup@redhat.com> - 2.0.11-2
be5080
- ETCD_ADVERTISE_CLIENT_URLS has to be set if ETCD_LISTEN_CLIENT_URLS is
be5080
  set GOMAXPROCS to use all processors available
be5080
  related: #1223388
be5080
be5080
* Wed May 20 2015 jchaloup <jchaloup@redhat.com> - 2.0.11-1
be5080
- Update to etcd-2.0.11
be5080
  resolves: #1223388
be5080
18e3f8
* Wed Apr 08 2015 jchaloup <jchaloup@redhat.com> - 2.0.9-2
18e3f8
- No debug info
18e3f8
  related: #1199223
18e3f8
18e3f8
* Wed Apr 08 2015 jchaloup <jchaloup@redhat.com> - 2.0.9-1
18e3f8
- Update to v2.0.9
18e3f8
  related: #1199223
18e3f8
18e3f8
* Fri Apr 03 2015 jchaloup <jchaloup@redhat.com> - 2.0.8-0.2
18e3f8
- Update spec file to fit for rhel too (thanks to eparis)
18e3f8
  resolves: #1199223
18e3f8
18e3f8
* Wed Apr 01 2015 jchaloup <jchaloup@redhat.com> - 2.0.8-0.1
18e3f8
- Update to v2.0.8
18e3f8
  resolves: #1207881
18e3f8
18e3f8
* Tue Mar 31 2015 jchaloup <jchaloup@redhat.com> - 2.0.7-0.1
18e3f8
- Update to v2.0.7
18e3f8
  Add Godeps.json to doc
18e3f8
  related: #1191441
18e3f8
18e3f8
* Thu Mar 12 2015 jchaloup <jchaloup@redhat.com> - 2.0.5-0.1
18e3f8
- Bump to 9481945228b97c5d019596b921d8b03833964d9e (v2.0.5)
18e3f8
18e3f8
* Tue Mar 10 2015 Eric Paris <eparis@redhat.com> - 2.0.3-0.2
18e3f8
- Fix .service files to work if no config file
18e3f8
18e3f8
* Fri Feb 20 2015 jchaloup <jchaloup@redhat.com> - 2.0.3-0.1
18e3f8
- Bump to upstream 4d728cc8c488a545a8bdeafd054d9ccc2bfb6876
18e3f8
18e3f8
* Wed Feb 18 2015 jchaloup <jchaloup@redhat.com> - 2.0.1-0.2
18e3f8
- Update configuration and service file
18e3f8
  Fix depricated ErrWrongType after update of gogo/protobuf
18e3f8
  related: #1191441
18e3f8
18e3f8
* Wed Feb 11 2015 jchaloup <jchaloup@redhat.com> - 2.0.1-0.1
18e3f8
- Update to 2.0.1
18e3f8
  resolves: #1191441
18e3f8
18e3f8
* Mon Feb 09 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.5
18e3f8
- Add missing debug info to binaries (patch from Jan Kratochvil)
18e3f8
  resolves: #1184257
18e3f8
18e3f8
* Fri Jan 30 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.4
18e3f8
- Update to etcd-2.0.0
18e3f8
- use gopath as the last directory to search for source code
18e3f8
  related: #1176138
18e3f8
18e3f8
* Mon Jan 26 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.3.rc1
18e3f8
- default to /var/lib/etcd/default.etcd as 2.0 uses that default (f21 commit byt eparis)
18e3f8
  related: #1176138
18e3f8
  fix /etc/etcd/etcd.conf path
18e3f8
18e3f8
* Tue Jan 20 2015 jchaloup <jchaloup@redhat.com> - 2.0.0-0.2.rc1
18e3f8
- Update of BuildRequires/Requires, Provides and test
18e3f8
  Add BuildRequire on jonboulle/clockwork
18e3f8
  related: #1176138
18e3f8
18e3f8
* Tue Dec 23 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 2.0.0-0.1.rc1
18e3f8
- Resolves: rhbz#1176138 - update to v2.0.0-rc1
18e3f8
- do not redefine gopath
18e3f8
- use jonboulle/clockwork from within Godeps
18e3f8
18e3f8
* Fri Oct 17 2014 jchaloup <jchaloup@redhat.com> - 0.4.6-7
18e3f8
- Add ExclusiveArch for go_arches
18e3f8
18e3f8
* Mon Oct 06 2014 jchaloup <jchaloup@redhat.com> - 0.4.6-6
18e3f8
- related: #1047194
18e3f8
  Remove dependency on go.net
18e3f8
18e3f8
* Mon Oct 06 2014 jchaloup <jchaloup@redhat.com> - 0.4.6-5
18e3f8
- Fix the .service file so it can launch!
18e3f8
  related: #1047194
319373
319373
* Mon Sep 22 2014 jchaloup <jchaloup@redhat.com> - 0.4.6-4
319373
- resolves: #1047194
319373
  Update to 0.4.6 from https://github.com/projectatomic/etcd-package
319373
319373
* Tue Aug 19 2014 Adam Miller <maxamillion@fedoraproject.org> - 0.4.6-3
319373
- Add devel sub-package
319373
319373
* Wed Aug 13 2014 Eric Paris <eparis@redhat.com> - 0.4.6-2
319373
- Bump to 0.4.6
319373
- run as etcd, not root
319373
319373
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.2-6
319373
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
319373
319373
* Sun Oct 20 2013 Peter Lemenkov <lemenkov@gmail.com> - 0.1.2-5
319373
- goprotobuf library unbundled (see rhbz #1018477)
319373
- go-log library unbundled (see rhbz #1018478)
319373
- go-raft library unbundled (see rhbz #1018479)
319373
- go-systemd library unbundled (see rhbz #1018480)
319373
- kardianos library unbundled (see rhbz #1018481)
319373
319373
* Sun Oct 13 2013 Peter Lemenkov <lemenkov@gmail.com> - 0.1.2-4
319373
- go.net library unbundled (see rhbz #1018476)
319373
319373
* Sat Oct 12 2013 Peter Lemenkov <lemenkov@gmail.com> - 0.1.2-3
319373
- Prepare for packages unbundling
319373
- Verbose build
319373
319373
* Sat Oct 12 2013 Peter Lemenkov <lemenkov@gmail.com> - 0.1.2-2
319373
- Fix typo in the etc.service file
319373
319373
* Sat Oct 12 2013 Peter Lemenkov <lemenkov@gmail.com> - 0.1.2-1
319373
- Ver. 0.1.2
319373
- Integrate with systemd
319373
319373
* Mon Aug 26 2013 Luke Cypret <cypret@fedoraproject.org> - 0.1.1-1
319373
- Initial creation