Blame SPECS/flannel.spec

5aa948
%global with_devel 0
5aa948
%global with_bundled 1
5aa948
%global with_debug 0
5aa948
%global with_check 0
5aa948
37628b
%global debug_package   %{nil}
37628b
%global provider        github
37628b
%global provider_tld    com
37628b
%global project         coreos
37628b
%global repo            flannel
37628b
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
5aa948
%global commit          29ffccc484cd46b6bc2d5a5b9d23e3e2f3f2851c
37628b
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
37628b
5aa948
%global devel_main      flannel-devel
5aa948
37628b
Name:           flannel 
5aa948
Version:        0.5.3
5aa948
Release:        8%{?dist}
37628b
Summary:        Etcd address management agent for overlay networks
37628b
License:        ASL 2.0 
37628b
URL:            https://%{import_path}
5aa948
Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
5aa948
#Source0:        https://%{import_path}/archive/v%{version}.tar.gz
37628b
Source1:        flanneld.sysconf
37628b
Source2:        flanneld.service
37628b
Source3:        flannel-docker.conf
5aa948
Source4:        flannel-tmpfiles.conf
37628b
5aa948
Patch0:         change-4001-to-2379-in-help-and-README.patch
5aa948
Patch1:         change-coreos.com-network-to-atomic.io-network-in-he.patch
5aa948
Patch2:         Notify-systemd-service-when-server-is-ready-to-liste.patch
5aa948
5aa948
ExclusiveArch:  %{ix86} x86_64 %{arm}
16274f
37628b
BuildRequires:      golang >= 1.2.7
5aa948
%if ! 0%{?with_bundled}
5aa948
BuildRequires:      golang(code.google.com/p/goauth2/compute/serviceaccount)
5aa948
BuildRequires:      golang(code.google.com/p/google-api-go-client/compute/v1)
5aa948
BuildRequires:      golang(code.google.com/p/google-api-go-client/googleapi)
5aa948
BuildRequires:      golang(github.com/coreos/etcd/client)
5aa948
BuildRequires:      golang(github.com/coreos/etcd/pkg/transport)
5aa948
BuildRequires:      golang(github.com/coreos/go-iptables/iptables)
5aa948
BuildRequires:      golang(github.com/coreos/go-systemd/activation)
5aa948
BuildRequires:      golang(github.com/coreos/go-systemd/daemon) >= 2-2
5aa948
BuildRequires:      golang(github.com/coreos/pkg/flagutil)
5aa948
BuildRequires:      golang(github.com/golang/glog)
5aa948
BuildRequires:      golang(github.com/gorilla/mux)
5aa948
BuildRequires:      golang(github.com/mitchellh/goamz/aws)
5aa948
BuildRequires:      golang(github.com/mitchellh/goamz/ec2)
5aa948
BuildRequires:      golang(github.com/vishvananda/netlink)
5aa948
BuildRequires:      golang(github.com/vishvananda/netlink/nl)
5aa948
BuildRequires:      golang(golang.org/x/net/context)
5aa948
%endif
37628b
BuildRequires:      pkgconfig(systemd)
37628b
Requires:           systemd
37628b
Requires(post):     systemd
37628b
Requires(preun):    systemd
37628b
Requires(postun):   systemd
37628b
37628b
%description
37628b
Flannel is an etcd driven address management agent. Most commonly it is used to
37628b
manage the ip addresses of overlay networks between systems running containers
37628b
that need to communicate with one another.
37628b
5aa948
%if 0%{?with_devel}
5aa948
%package devel
5aa948
Summary:  %{summary}
5aa948
BuildRequires: golang >= 1.2.7
5aa948
5aa948
BuildRequires: golang(code.google.com/p/goauth2/compute/serviceaccount)
5aa948
BuildRequires: golang(code.google.com/p/google-api-go-client/compute/v1)
5aa948
BuildRequires: golang(code.google.com/p/google-api-go-client/googleapi)
5aa948
BuildRequires: golang(github.com/coreos/etcd/client)
5aa948
BuildRequires: golang(github.com/coreos/etcd/pkg/transport)
5aa948
BuildRequires: golang(github.com/coreos/go-iptables/iptables)
5aa948
BuildRequires: golang(github.com/coreos/go-systemd/activation)
5aa948
BuildRequires: golang(github.com/golang/glog)
5aa948
BuildRequires: golang(github.com/gorilla/mux)
5aa948
BuildRequires: golang(github.com/mitchellh/goamz/aws)
5aa948
BuildRequires: golang(github.com/mitchellh/goamz/ec2)
5aa948
BuildRequires: golang(github.com/vishvananda/netlink)
5aa948
BuildRequires: golang(github.com/vishvananda/netlink/nl)
5aa948
BuildRequires: golang(golang.org/x/net/context)
5aa948
5aa948
Requires: golang(code.google.com/p/goauth2/compute/serviceaccount)
5aa948
Requires: golang(code.google.com/p/google-api-go-client/compute/v1)
5aa948
Requires: golang(code.google.com/p/google-api-go-client/googleapi)
5aa948
Requires: golang(github.com/coreos/etcd/client)
5aa948
Requires: golang(github.com/coreos/etcd/pkg/transport)
5aa948
Requires: golang(github.com/coreos/go-iptables/iptables)
5aa948
Requires: golang(github.com/coreos/go-systemd/activation)
5aa948
Requires: golang(github.com/golang/glog)
5aa948
Requires: golang(github.com/gorilla/mux)
5aa948
Requires: golang(github.com/mitchellh/goamz/aws)
5aa948
Requires: golang(github.com/mitchellh/goamz/ec2)
5aa948
Requires: golang(github.com/vishvananda/netlink)
5aa948
Requires: golang(github.com/vishvananda/netlink/nl)
5aa948
Requires: golang(golang.org/x/net/context)
5aa948
5aa948
Provides: golang(%{import_path}/backend) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/alloc) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/awsvpc) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/gce) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/hostgw) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/udp) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/backend/vxlan) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/network) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/pkg/ip) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/remote) = %{version}-%{release}
5aa948
Provides: golang(%{import_path}/subnet) = %{version}-%{release}
5aa948
5aa948
%description devel
5aa948
Flannel is an etcd driven address management agent. Most commonly it is used to
5aa948
manage the ip addresses of overlay networks between systems running containers
5aa948
that need to communicate with one another.
5aa948
5aa948
This package contains library source intended for
5aa948
building other packages which use %{project}/%{repo}.
5aa948
%endif
5aa948
37628b
%prep
5aa948
%setup -q -n %{repo}-%{commit}
16274f
%patch0 -p1
16274f
%patch1 -p1
5aa948
%patch2 -p1
5aa948
5aa948
%if ! 0%{?with_bundled}
5aa948
find . -name "*.go" \
5aa948
       -print |\
5aa948
              xargs sed -i 's/github.com\/coreos\/flannel\/Godeps\/_workspace\/src\///g'
5aa948
%endif
37628b
37628b
%build
5aa948
%if ! 0%{?with_bundled}
5aa948
rm -rf Godeps
5aa948
mkdir _build
5aa948
pushd _build
5aa948
  mkdir -p src/github.com/coreos
5aa948
  ln -s $(dirs +1 -l) src/github.com/coreos/flannel
5aa948
popd
5aa948
5aa948
%if 0%{?with_debug}
5aa948
function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; }
5aa948
%else
5aa948
function gobuild { go build -a -v -x "$@"; }
5aa948
%endif
5aa948
5aa948
mkdir bin
5aa948
export GOPATH=${PWD}/_build:%{gopath}
5aa948
gobuild -o bin/flanneld .
5aa948
%else
37628b
./build
5aa948
%endif
37628b
37628b
%install
37628b
# package with binary
37628b
install -D -p -m 755 bin/flanneld %{buildroot}%{_bindir}/flanneld
37628b
install -D -p -m 644 %{SOURCE1} %{buildroot}/etc/sysconfig/flanneld
37628b
install -D -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/flanneld.service
37628b
install -D -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/docker.service.d/flannel.conf
5aa948
install -D -p -m 755 dist/mk-docker-opts.sh %{buildroot}%{_libexecdir}/flannel/mk-docker-opts.sh
5aa948
install -D -p -m 0755 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
5aa948
5aa948
mkdir -p %{buildroot}/run
5aa948
install -d -m 0755 %{buildroot}/run/%{name}/
5aa948
5aa948
%if 0%{?with_devel}
5aa948
# devel package
5aa948
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
5aa948
cp -pav {backend,pkg,subnet} %{buildroot}/%{gopath}/src/%{import_path}/
5aa948
%endif
5aa948
5aa948
%check
5aa948
%if 0%{?with_check}
5aa948
export GOPATH=${PWD}/_build:%{gopath}
5aa948
go test %{import_path}/pkg/ip
5aa948
#go test %{import_path}/remote
5aa948
go test %{import_path}/subnet
5aa948
%endif
37628b
37628b
%post
37628b
%systemd_post flanneld.service
37628b
37628b
%preun
37628b
# clean tempdir and workdir on removal or upgrade
37628b
%systemd_preun flanneld.service
37628b
37628b
%postun
37628b
%systemd_postun_with_restart flanneld.service
37628b
37628b
%files
37628b
%doc CONTRIBUTING.md  LICENSE MAINTAINERS README.md  DCO NOTICE
37628b
%{_bindir}/flanneld
37628b
%{_unitdir}/flanneld.service
37628b
%{_unitdir}/docker.service.d/flannel.conf
37628b
%{_libexecdir}/flannel/mk-docker-opts.sh
37628b
%config(noreplace) %{_sysconfdir}/sysconfig/flanneld
5aa948
%dir /run/%{name}/
5aa948
%{_tmpfilesdir}/%{name}.conf
5aa948
5aa948
%if 0%{?with_devel}
5aa948
%files devel
5aa948
%doc CONTRIBUTING.md  LICENSE MAINTAINERS README.md  DCO NOTICE
5aa948
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
5aa948
%dir %{gopath}/src/%{import_path}/
5aa948
%{gopath}/src/%{import_path}/
5aa948
%endif
37628b
37628b
%changelog
5aa948
* Fri Oct 30 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-8
5aa948
- Add After=network-online.target and Wants=network-online.target
5aa948
  to actively wait for network to get on
5aa948
  resolves: #1275837
5aa948
5aa948
* Fri Oct 30 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-7
5aa948
- Add Restart=on-failure to flanned.service file
5aa948
5aa948
* Thu Oct 08 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-6
5aa948
- Make flannel start after the network is ready
5aa948
  resolves: #1269291
5aa948
5aa948
* Wed Sep 23 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-5
5aa948
- Flannel now owns /run/flannel directory
5aa948
5aa948
* Wed Sep 23 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-4
5aa948
- Send systemd notification when -listen is used
5aa948
- Create /run/flannel directory for mk-docker-opts.sh
5aa948
5aa948
* Thu Sep 17 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-3
5aa948
- Change coreos.com/network to atomic.io/network in help and docs
5aa948
  related: #1261756
5aa948
5aa948
* Thu Sep 10 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-2
5aa948
- Change 4001 port in flannel --help and README.md as well
5aa948
  resolves: #1261756
5aa948
5aa948
* Mon Aug 31 2015 jchaloup <jchaloup@redhat.com> - 0.5.3-1
5aa948
- Update to 0.5.3
5aa948
  resolves: #1258876
5aa948
5aa948
* Tue Jul 21 2015 jchaloup <jchaloup@redhat.com> - 0.5.1-3
4993b8
- Change etcd port from 4001 to 2379
5aa948
- Polish spec file
4993b8
5aa948
* Fri Jul 10 2015 jchaloup <jchaloup@redhat.com> - 0.5.1-2
4993b8
- Change flannel prefix from /coreos.com/network to /atomic.io/network
4993b8
5aa948
* Fri Jul 10 2015 jchaloup <jchaloup@redhat.com> - 0.5.1-1
5aa948
- Update to 0.5.1
5aa948
5aa948
* Fri Jul 10 2015 jchaloup <jchaloup@redhat.com> - 0.5.0-3
4993b8
- Add After=etcd.service to flanneld.service
4993b8
5aa948
* Fri Jun 26 2015 jchaloup <jchaloup@redhat.com> - 0.5.0-2
5aa948
- Add missing Requires: golang(github.com/gorilla/mux) to devel subpackage
5aa948
5aa948
* Fri Jun 26 2015 jchaloup <jchaloup@redhat.com> - 0.5.0-1
5aa948
- Update to 0.5.0
5aa948
5aa948
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-3
5aa948
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5aa948
5aa948
* Fri May 22 2015 jchaloup <jchaloup@redhat.com> - 0.4.1-2
5aa948
- Bump to upstream 9180d9a37e2ae6d7fceabea51c6416767c6b50f6
5aa948
  related: #1223445
5aa948
5aa948
* Wed May 20 2015 jchaloup <jchaloup@redhat.com> - 0.4.1-1
5aa948
- Bump to upstream 4ab27ddd3e87eb2daf152513c0b1dc22879393a8
5aa948
  resolves: #1223445
5aa948
5aa948
* Fri Apr 10 2015 Eric Paris <eparis@redhat.com> - 0.3.1-1
5aa948
- Bump to version 0.3.1
5aa948
5aa948
* Tue Apr 7 2015 Eric Paris <eparis@redhat.com> - 0.3.0-1
5aa948
- Bump to version 0.3.0
16274f
5aa948
* Mon Mar 30 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-7
5aa948
- Add debug info
5aa948
  related: #1165688
16274f
5aa948
* Fri Feb 20 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-6
5aa948
- Update [Build]Requires for go-etcd package
37628b
37628b
* Wed Jan 21 2015 Eric Paris <eparis@redhat.com> - 0.2.0-5
37628b
- Add generator more like upstream wants to use, use ExecStartPost
37628b
  (https://github.com/coreos/flannel/pull/85)
37628b
37628b
* Tue Jan 20 2015 Eric Paris <eparis@redhat.com> - 0.2.0-4
37628b
- Add generator to turn flannel env vars into docker flags
37628b
37628b
* Tue Jan 20 2015 Peter Lemenkov <lemenkov@gmail.com> - 0.2.0-3
37628b
- Change (Build)Requires accordning to the recent changes
37628b
  (http://pkgs.fedoraproject.org/cgit/golang-github-coreos-go-systemd.git/commit/?id=204f61c)
37628b
37628b
* Fri Jan 16 2015 Peter Lemenkov <lemenkov@gmail.com> - 0.2.0-2
37628b
- Change flannel service type to notify. See
37628b
  https://github.com/coreos/flannel/blob/v0.2.0/main.go#L213
37628b
37628b
* Tue Dec 23 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.2.0-1
37628b
- update to upstream v0.2.0
37628b
- append FLANNEL_OPTIONS variable to unitfile command
37628b
- systemd-units merged into systemd for fedora18+
37628b
37628b
* Tue Dec  2 2014 John W. Linville <linville@redhat.com> - 0.1.0-8.gita7b435a
37628b
- Remove patches related to out-of-tree slice backend
37628b
- Update to latest upstream
37628b
37628b
* Thu Nov 20 2014 jchaloup <jchaloup@redhat.com> - 0.1.0-7.git071d778
37628b
- Removing deps on Godeps and adding deps on golang-github packages
37628b
- Removing wait-online service and changing Type of flannel.service from simple to notify
37628b
- Adding README and other doc files
37628b
- Adding spec file header with commit, import_path, ...
37628b
- Adding devel subpackage
37628b
- spec polished based on Lokesh' notes (3 lines below)
37628b
- modify summary in specfile as in bug description (capitalize if needed)
37628b
- might need to enforce NVR for coreos/go-systemd in deps
37628b
- pkgconfig(systemd) is preferable to systemd in BR (I think)
37628b
  resolves: #1165688
37628b
37628b
* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
37628b
- Updating to latest upstream 
37628b
37628b
* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
37628b
- Added wait-online service to sync with docker
37628b
37628b
* Thu Nov 06 2014 - Neil Horman <nhoramn@tuxdriver.com> 
37628b
- Fixed flanneld.service file
37628b
- Added linvilles slice type patch
37628b
37628b
* Tue Nov 04 2014 - Neil Horman <nhorman@tuxdriver.com> - 0.1.0-20141104gitdc530ce
37628b
- Initial Build
37628b