%global debug_package %{nil} %global import_path github.com/coreos/etcdctl %global gopath %{_datadir}/gocode Name: etcdctl Version: 0.4.6 Release: 1%{?dist} Summary: command line client for etcd License: ASL 2.0 URL: https://github.com/coreos/etcdctl/ Source0: https://github.com/coreos/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0: etcdctl-0.4.6-remove_thirdparty_imports.patch BuildRequires: golang # FIXME - There's a number of bundled libs in here we need to get out, a lot of # this work has been done for etcd packaging: # https://github.com/projectatomic/etcd-package # however we appear to be missing something as there's a boat load of # compiler errors, some of which are as simple as missing struct defs # which we need to sort out eventually. #BuildRequires: golang(github.com/codegangsta/cli) #BuildRequires: golang(github.com/coreos/etcd) #BuildRequires: golang(github.com/coreos/go-etcd) #BuildRequires: golang(github.com/coreos/go-log/log) #BuildRequires: systemd Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %description A command line client for etcd. It can be used in scripts or for administrators to explore an etcd cluster. %prep %setup -q -n %{name}-%{version} #FIXME - Apply this patch once everything is properly packaged #%patch0 -p1 # FIXME - Need a real way to set the version, this is a hack from upstream # Set the "version number", currently git commit id upstream• # # This is terrible. echo "package main const releaseVersion = \"%{version}\"" > release_version.go # I hope to uncomment this *ASAP* ## Nuke third_party deps, we have them packaged. #rm -rf third_party # Don't judge me for this ... it's so bad. # FIXME - Gaming the GOPATH to include the third party bundled libs at build # time. This is bad and I feel bad, but we need a package to start # testing things. mkdir _thirdpartyhacks pushd _thirdpartyhacks ln -s \ $(dirs +1 -l)/third_party/src/ \ src popd # Make link for etcdctl itself mkdir _build pushd _build mkdir -p src/github.com/coreos ln -s $(dirs +1 -l) src/%{import_path} popd %build export GOPATH=$(pwd)/_build:$(pwd)/_thirdpartyhacks:$(pwd)/_thirdthirdpartyhacks:%{buildroot}%{gopath}:%{gopath} go build %{import_path} %install install -D -p -m 0755 etcdctl %{buildroot}%{_bindir}/etcdctl %check # empty for now %files %doc LICENSE README.md %{_bindir}/etcdctl %changelog * Tue Sep 02 2014 Adam Miller - 0.4.6-1 - First package