9418ac2
%global debug_package   %{nil}
9418ac2
%global provider        github
9418ac2
%global provider_tld    com
9418ac2
%global project         coreos
9418ac2
%global repo            flannel
9418ac2
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
6fef40a
%global commit          52c3c4fb51109fdbb09a0d002ac35606f4a773ae
9418ac2
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
9418ac2
9418ac2
Name:           flannel 
6fef40a
Version:        0.2.0
ca1479d
Release:        3%{?dist}
9418ac2
Summary:        Etcd address management agent for overlay networks
9418ac2
License:        ASL 2.0 
9418ac2
URL:            https://%{import_path}
6fef40a
#Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
6fef40a
Source0:        https://%{import_path}/archive/v%{version}.tar.gz
9418ac2
Source1:        flanneld.service
9418ac2
Source2:        flanneld.sysconf
9418ac2
ExclusiveArch:  %{ix86} x86_64 %{arm}
9418ac2
John W. Linville 222bc00
Patch0: flannel-remove-third-party-dependency-on-Godeps.patch
9418ac2
9418ac2
BuildRequires:      golang >= 1.2.7
9418ac2
BuildRequires:      golang-cover
ca1479d
BuildRequires:      golang(github.com/coreos/go-systemd/daemon) >= 2-2
ca1479d
BuildRequires:      golang(github.com/coreos/go-etcd/etcd)
9418ac2
BuildRequires:      golang(github.com/golang/glog)
9418ac2
BuildRequires:      golang(github.com/vishvananda/netns)
9418ac2
BuildRequires:      golang(github.com/vishvananda/netlink)
9418ac2
BuildRequires:      pkgconfig(systemd)
6fef40a
Requires:           systemd
6fef40a
Requires(post):     systemd
6fef40a
Requires(preun):    systemd
6fef40a
Requires(postun):   systemd
9418ac2
9418ac2
%description
9418ac2
Flannel is an etcd driven address management agent. Most commonly it is used to
9418ac2
manage the ip addresses of overlay networks between systems running containers
9418ac2
that need to communicate with one another.
9418ac2
9418ac2
%package devel
9418ac2
BuildRequires:      golang >= 1.2.7
9418ac2
BuildRequires:      golang-cover
ca1479d
BuildRequires:      golang(github.com/coreos/go-systemd/daemon) >= 2-2
ca1479d
BuildRequires:      golang(github.com/coreos/go-etcd/etcd)
9418ac2
BuildRequires:      golang(github.com/golang/glog)
9418ac2
BuildRequires:      golang(github.com/vishvananda/netns)
9418ac2
BuildRequires:      golang(github.com/vishvananda/netlink)
9418ac2
BuildRequires:      pkgconfig(systemd)
9418ac2
Requires:           golang >= 1.2.7
9418ac2
Requires:           golang-cover
ca1479d
Requires:           golang(github.com/coreos/go-systemd/daemon) >= 2-2
ca1479d
Requires:           golang(github.com/coreos/go-etcd/etcd)
9418ac2
Requires:           golang(github.com/golang/glog)
9418ac2
Requires:           golang(github.com/vishvananda/netns)
9418ac2
Requires:           golang(github.com/vishvananda/netlink)
9418ac2
Summary:            %{summary}
9418ac2
Provides:           golang(%{import_path}/subnet) = %{version}-%{release}
9418ac2
Provides:           golang(%{import_path}/pkg/ip) = %{version}-%{release}
9418ac2
Provides:           golang(%{import_path}/backend) = %{version}-%{release}
9418ac2
Provides:           golang(%{import_path}/backend/vxlan) = %{version}-%{release}
9418ac2
Provides:           golang(%{import_path}/backend/udp) = %{version}-%{release}
9418ac2
Provides:           golang(%{import_path}/backend/alloc) = %{version}-%{release}
9418ac2
9418ac2
%description devel
9418ac2
Flannel is an etcd driven address management agent. Most commonly it is used to
9418ac2
manage the ip addresses of overlay networks between systems running containers
9418ac2
that need to communicate with one another.
9418ac2
9418ac2
This package contains library source intended for
9418ac2
building other packages which use %{project}/%{repo}.
9418ac2
9418ac2
%prep
6fef40a
%setup -q -n %{repo}-%{version}
9418ac2
%patch0 -p1
9418ac2
9418ac2
%build
9418ac2
rm -rf Godeps
9418ac2
9418ac2
mkdir _build
9418ac2
pushd _build
9418ac2
  mkdir -p src/github.com/coreos
9418ac2
  ln -s $(dirs +1 -l) src/github.com/coreos/flannel
9418ac2
popd
9418ac2
9418ac2
mkdir bin
9418ac2
GOPATH=${PWD}/_build:%{gopath} go build -o bin/flanneld .
9418ac2
9418ac2
%install
9418ac2
# package with binary
9418ac2
install -D -p -m 755 bin/flanneld %{buildroot}%{_bindir}/flanneld
9418ac2
install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/flanneld.service
9418ac2
install -D -p -m 644 %{SOURCE2} %{buildroot}/etc/sysconfig/flanneld
9418ac2
# devel package
9418ac2
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
9418ac2
cp -pav {backend,pkg,subnet} %{buildroot}/%{gopath}/src/%{import_path}/
9418ac2
9418ac2
%post
9418ac2
%systemd_post flanneld.service
9418ac2
9418ac2
%preun
9418ac2
# clean tempdir and workdir on removal or upgrade
9418ac2
%systemd_preun flanneld.service
9418ac2
9418ac2
%postun
9418ac2
%systemd_postun_with_restart flanneld.service
9418ac2
9418ac2
%files
9418ac2
%doc CONTRIBUTING.md  LICENSE MAINTAINERS README.md  DCO NOTICE
9418ac2
%{_bindir}/flanneld
9418ac2
%{_unitdir}/flanneld.service
9418ac2
%config(noreplace) %{_sysconfdir}/sysconfig/flanneld
9418ac2
9418ac2
%files devel
9418ac2
%doc CONTRIBUTING.md  LICENSE MAINTAINERS README.md  DCO NOTICE
9418ac2
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
9418ac2
%dir %{gopath}/src/%{import_path}/
9418ac2
%{gopath}/src/%{import_path}/
9418ac2
9418ac2
%changelog
ca1479d
* Fri Feb 20 2015 jchaloup <jchaloup@redhat.com> - 0.2.0-3
ca1479d
- Update [Build]Requires for go-etcd package and go-systemd
ca1479d
a4197d8
* Fri Jan 16 2015 Peter Lemenkov <lemenkov@gmail.com> - 0.2.0-2
a4197d8
- Change flannel service type to notify. See
a4197d8
  https://github.com/coreos/flannel/blob/v0.2.0/main.go#L213
a4197d8
6fef40a
* Tue Dec 23 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.2.0-1
6fef40a
- update to upstream v0.2.0
6fef40a
- append FLANNEL_OPTIONS variable to unitfile command
6fef40a
- systemd-units merged into systemd for fedora18+
6fef40a
John W. Linville 2652cfe
* Tue Dec  2 2014 John W. Linville <linville@redhat.com> - 0.1.0-8.gita7b435a
John W. Linville 2652cfe
- Remove patches related to out-of-tree slice backend
John W. Linville 2652cfe
- Update to latest upstream
John W. Linville 2652cfe
9418ac2
* Thu Nov 20 2014 jchaloup <jchaloup@redhat.com> - 0.1.0-7.git071d778
9418ac2
- Removing deps on Godeps and adding deps on golang-github packages
9418ac2
- Removing wait-online service and changing Type of flannel.service from simple to notify
9418ac2
- Adding README and other doc files
9418ac2
- Adding spec file header with commit, import_path, ...
9418ac2
- Adding devel subpackage
9418ac2
- spec polished based on Lokesh' notes (3 lines below)
9418ac2
- modify summary in specfile as in bug description (capitalize if needed)
9418ac2
- might need to enforce NVR for coreos/go-systemd in deps
9418ac2
- pkgconfig(systemd) is preferable to systemd in BR (I think)
9418ac2
  resolves: #1165688
9418ac2
9418ac2
* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
9418ac2
- Updating to latest upstream 
9418ac2
9418ac2
* Fri Nov 07 2014 - Neil Horman <nhoramn@tuxdriver.com> 
9418ac2
- Added wait-online service to sync with docker
9418ac2
9418ac2
* Thu Nov 06 2014 - Neil Horman <nhoramn@tuxdriver.com> 
9418ac2
- Fixed flanneld.service file
9418ac2
- Added linvilles slice type patch
9418ac2
9418ac2
* Tue Nov 04 2014 - Neil Horman <nhorman@tuxdriver.com> - 0.1.0-20141104gitdc530ce
9418ac2
- Initial Build
9418ac2