package podman-plugins

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar 2019-10-18 09:02:37 -04:00
parent dbe193624a
commit a3bb6c1370

View File

@ -30,6 +30,13 @@
%global commit0 24efb5e4ebb6fa96219afeac543d33299b6e1491 %global commit0 24efb5e4ebb6fa96219afeac543d33299b6e1491
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
%global repo_plugins dnsname
# https://github.com/containers/libpod
%global import_path_plugins %%{provider}.%{provider_tld}/%{project}/%{repo_plugins}
%global git_plugins https://%{import_path_plugins}
%global commit_plugins f5af33dedcfc5e707e5560baa4a72f8d96a968fe
%global shortcommit_plugins %(c=%{commit_plugins}; echo ${c:0:7})
# Used for comparing with latest upstream tag # Used for comparing with latest upstream tag
# to decide whether to autobuild (non-rawhide only) # to decide whether to autobuild (non-rawhide only)
%global built_tag v1.6.2 %global built_tag v1.6.2
@ -46,6 +53,7 @@ Summary: Manage Pods, Containers and Container Images
License: ASL 2.0 License: ASL 2.0
URL: https://%{name}.io/ URL: https://%{name}.io/
Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz Source0: %{git0}/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz
Source1: %{git_plugins}/archive/%{commit_plugins}/%{repo_plugins}-%{shortcommit_plugins}.tar.gz
# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: btrfs-progs-devel BuildRequires: btrfs-progs-devel
@ -70,6 +78,7 @@ Requires: containernetworking-plugins >= 0.7.5-1
Requires: iptables Requires: iptables
Requires: nftables Requires: nftables
Requires: conmon Requires: conmon
Requires: %{name}-plugins = %{epoch}:%{version}-%{release}
%if 0%{?fedora} %if 0%{?fedora}
Recommends: %{name}-manpages = %{epoch}:%{version}-%{release} Recommends: %{name}-manpages = %{epoch}:%{version}-%{release}
Recommends: container-selinux Recommends: container-selinux
@ -418,18 +427,33 @@ BuildArch: noarch
%description manpages %description manpages
Man pages for the %{name} commands Man pages for the %{name} commands
%package plugins
Summary: Plugins for %{name}
%description plugins
This plugin sets up the use of dnsmasq on a given CNI network so
that Pods can resolve each other by name. When configured,
the pod and its IP address are added to a network specific hosts file
that dnsmasq will read in. Similarly, when a pod
is removed from the network, it will remove the entry from the hosts
file. Each CNI network will have its own dnsmasq instance.
%prep %prep
%autosetup -Sgit -n %{repo}-%{commit0} %autosetup -Sgit -n %{repo}-%{commit0}
# untar dnsname
tar zxf %{SOURCE1}
%build %build
export GO111MODULE=off
export GOPATH=$(pwd)/_build:$(pwd)
mkdir _build mkdir _build
pushd _build pushd _build
mkdir -p src/%{provider}.%{provider_tld}/%{project} mkdir -p src/%{provider}.%{provider_tld}/%{project}
ln -s ../../../../ src/%{import_path} ln -s ../../../../ src/%{import_path}
popd popd
ln -s vendor src ln -s vendor src
export GOPATH=$(pwd)/_build:$(pwd)
export GO111MODULE=off
%gogenerate ./cmd/%{name}/varlink/... %gogenerate ./cmd/%{name}/varlink/...
# build %%{name} # build %%{name}
@ -443,6 +467,17 @@ export BUILDTAGS="remoteclient systemd varlink seccomp exclude_graphdriver_devic
%gobuild -o bin/%{name}-remote %{import_path}/cmd/%{name} %gobuild -o bin/%{name}-remote %{import_path}/cmd/%{name}
%endif %endif
pushd dnsname-%{commit_plugins}
mkdir _build
pushd _build
mkdir -p src/%{provider}.%{provider_tld}/%{project}
ln -s ../../../../ src/%{import_path_plugins}
popd
ln -s vendor src
export GOPATH=$(pwd)/_build:$(pwd)
%gobuild -o bin/dnsname %{import_path_plugins}/plugins/meta/dnsname
popd
%install %install
sed -s 's/^runtime[ =].*"runc/runtime = "crun/' libpod.conf -i sed -s 's/^runtime[ =].*"runc/runtime = "crun/' libpod.conf -i
sed -i 's/install.remote: podman-remote/install.remote:/' Makefile sed -i 's/install.remote: podman-remote/install.remote:/' Makefile
@ -467,6 +502,11 @@ mv pkg/hooks/README.md pkg/hooks/README-hooks.md
install -dp %{buildroot}%{_datadir}/containers install -dp %{buildroot}%{_datadir}/containers
install -p -m 644 %{repo}.conf %{buildroot}%{_datadir}/containers install -p -m 644 %{repo}.conf %{buildroot}%{_datadir}/containers
# install plugins
pushd dnsname-%{commit_plugins}
%{__make} PREFIX=%{_prefix} DESTDIR=%{buildroot} install
popd
# source codes for building projects # source codes for building projects
%if 0%{?with_devel} %if 0%{?with_devel}
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
@ -586,6 +626,11 @@ exit 0
%{_datadir}/%{name}/test %{_datadir}/%{name}/test
%endif %endif
%files plugins
%license dnsname-%{commit_plugins}/LICENSE
%doc dnsname-%{commit_plugins}/{README.md,README_PODMAN.md}
%{_libexecdir}/cni/dnsname
%changelog %changelog
* Thu Nov 07 2019 RH Container Bot <rhcontainerbot@fedoraproject.org> - 2:1.6.4-0.11.dev.git24efb5e * Thu Nov 07 2019 RH Container Bot <rhcontainerbot@fedoraproject.org> - 2:1.6.4-0.11.dev.git24efb5e
- autobuilt 24efb5e - autobuilt 24efb5e