Blame SPECS/flannel.spec

5aa948
%global with_devel 0
5aa948
%global with_bundled 1
9e995a
%global with_debug 1
5aa948
%global with_check 0
5aa948
9e995a
%if 0%{?with_debug}
9e995a
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
9e995a
%global _dwz_low_mem_die_limit 0
9e995a
%else
37628b
%global debug_package   %{nil}
9e995a
%endif
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}
504b40
%global commit          d9560b051b0abe92048ae5c72b5fbd71ba7b8f17
37628b
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
37628b
5aa948
%global devel_main      flannel-devel
5aa948
37628b
Name:           flannel 
504b40
Version:        0.7.0
504b40
Release:        1%{?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
68b756
Source5:        flanneld-start
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
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
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
9e995a
mkdir -p src/github.com/coreos
9e995a
ln -s ../../../ src/github.com/coreos/flannel
5aa948
9e995a
%if ! 0%{?with_bundled}
9e995a
export GOPATH=$(pwd):%{gopath}
5aa948
%else
9e995a
export GOPATH=$(pwd):%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace
5aa948
%endif
5aa948
504b40
%if ! 0%{?gobuild:1}
504b40
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
504b40
%endif
504b40
504b40
export LDFLAGS="-X github.com/coreos/flannel/version.Version=%{version}"
9e995a
504b40
%gobuild -o bin/flanneld %{import_path}
37628b
37628b
%install
37628b
# package with binary
37628b
install -D -p -m 755 bin/flanneld %{buildroot}%{_bindir}/flanneld
68b756
install -D -p -m 755 %{SOURCE5} %{buildroot}%{_bindir}/flanneld-start
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
68b756
%{_bindir}/flanneld-start
37628b
%{_unitdir}/flanneld.service
37628b
%{_unitdir}/docker.service.d/flannel.conf
37628b
%{_libexecdir}/flannel/mk-docker-opts.sh
7e924c
%dir %{_libexecdir}/flannel
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
504b40
* Mon Feb 06 2017 Jan Chaloupka <jchaloup@redhat.com> - 0.7.0-1
504b40
- Update to flannel v0.7.0
504b40
  resolves: #1419750
504b40
68b756
* Tue Dec 13 2016 Jan Chaloupka <jchaloup@redhat.com> - 0.5.5-2
68b756
- Use non-canonicalized etcd endpoints and prefix if canonicalized are not set
68b756
  resolves: #1341223
68b756
7e924c
* Wed Sep 07 2016 jchaloup <jchaloup@redhat.com> - 0.5.5-1
7e924c
- Update to flannel v5.5.0
7e924c
  resolves: #1373915
7e924c
7e924c
* Wed Jun 29 2016 jchaloup <jchaloup@redhat.com> - 0.5.3-10
7e924c
- Own /usr/libexec/flannel directory
7e924c
- make envs in service and config file canonical
7e924c
  resolves: #1341223
7e924c
9e995a
* Thu Jan 14 2016 jchaloup <jchaloup@redhat.com> - 0.5.3-9
9e995a
- Build with debug-info support
9e995a
  resolves: #1298728
9e995a
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