Blame SPECS/flannel.spec

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