Blob Blame History Raw
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global project         coreos
%global repo            flannel
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit          52c3c4fb51109fdbb09a0d002ac35606f4a773ae
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           flannel 
Version:        0.2.0
Release:        7%{?dist}
Summary:        Etcd address management agent for overlay networks
License:        ASL 2.0 
URL:            https://%{import_path}
#Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Source0:        https://%{import_path}/archive/v%{version}.tar.gz
Source1:        flanneld.sysconf
Source2:        flanneld.service
Source3:        flannel-docker.conf
Source4:        mk-docker-opts.sh
ExclusiveArch:  %{ix86} x86_64 %{arm}

Patch0:         flannel-vxlan-create-retry.patch
Patch1:         flannel-Clarify-the-logging-when-VXLAN-interface-creation-fa.patch

BuildRequires:      golang >= 1.2.7
BuildRequires:      pkgconfig(systemd)
Requires:           systemd
Requires(post):     systemd
Requires(preun):    systemd
Requires(postun):   systemd

%description
Flannel is an etcd driven address management agent. Most commonly it is used to
manage the ip addresses of overlay networks between systems running containers
that need to communicate with one another.

%prep
%setup -q -n %{repo}-%{version}
%patch0 -p1
%patch1 -p1

%build
./build

%install
# package with binary
install -D -p -m 755 bin/flanneld %{buildroot}%{_bindir}/flanneld
install -D -p -m 644 %{SOURCE1} %{buildroot}/etc/sysconfig/flanneld
install -D -p -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/flanneld.service
install -D -p -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/docker.service.d/flannel.conf
install -D -p -m 755 %{SOURCE4} %{buildroot}%{_libexecdir}/flannel/mk-docker-opts.sh

%post
%systemd_post flanneld.service

%preun
# clean tempdir and workdir on removal or upgrade
%systemd_preun flanneld.service

%postun
%systemd_postun_with_restart flanneld.service

%files
%doc CONTRIBUTING.md  LICENSE MAINTAINERS README.md  DCO NOTICE
%{_bindir}/flanneld
%{_unitdir}/flanneld.service
%{_unitdir}/docker.service.d/flannel.conf
%{_libexecdir}/flannel/mk-docker-opts.sh
%config(noreplace) %{_sysconfdir}/sysconfig/flanneld

%changelog
* Sun Mar 08 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-7
- flanneld fails to start on boot
  resolves: #1184579

* Thu Mar 5 2015 Eric Paris <eparis@redhat.com>
- remove {} around FLANNEL_OPTIONS so you can use more than 1

* Fri Jan 30 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-6
- remove devel subpackage

* Wed Jan 21 2015 Eric Paris <eparis@redhat.com> - 0.2.0-5
- Add generator more like upstream wants to use, use ExecStartPost
  (https://github.com/coreos/flannel/pull/85)

* Tue Jan 20 2015 Eric Paris <eparis@redhat.com> - 0.2.0-4
- Add generator to turn flannel env vars into docker flags

* Tue Jan 20 2015 Peter Lemenkov <lemenkov@gmail.com> - 0.2.0-3
- Change (Build)Requires accordning to the recent changes
  (http://pkgs.fedoraproject.org/cgit/golang-github-coreos-go-systemd.git/commit/?id=204f61c)

* Fri Jan 16 2015 Peter Lemenkov <lemenkov@gmail.com> - 0.2.0-2
- Change flannel service type to notify. See
  https://github.com/coreos/flannel/blob/v0.2.0/main.go#L213

* Tue Dec 23 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.2.0-1
- update to upstream v0.2.0
- append FLANNEL_OPTIONS variable to unitfile command
- systemd-units merged into systemd for fedora18+

* Tue Dec  2 2014 John W. Linville <linville@redhat.com> - 0.1.0-8.gita7b435a
- Remove patches related to out-of-tree slice backend
- Update to latest upstream

* Thu Nov 20 2014 jchaloup <jchaloup@redhat.com> - 0.1.0-7.git071d778
- Removing deps on Godeps and adding deps on golang-github packages
- Removing wait-online service and changing Type of flannel.service from simple to notify
- Adding README and other doc files
- Adding spec file header with commit, import_path, ...
- Adding devel subpackage
- spec polished based on Lokesh' notes (3 lines below)
- modify summary in specfile as in bug description (capitalize if needed)
- might need to enforce NVR for coreos/go-systemd in deps
- pkgconfig(systemd) is preferable to systemd in BR (I think)
  resolves: #1165688

* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
- Updating to latest upstream 

* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
- Added wait-online service to sync with docker

* Thu Nov 06 2014 - Neil Horman <nhoramn@tuxdriver.com> 
- Fixed flanneld.service file
- Added linvilles slice type patch

* Tue Nov 04 2014 - Neil Horman <nhorman@tuxdriver.com> - 0.1.0-20141104gitdc530ce
- Initial Build