Summary: Calico CNI plugin Name: calico-cni Version: 2.0.3 Release: 1 License: ASL 2.0 URL: http://www.projectcalico.org # Download https://github.com/projectcalico/cni-plugin/archive/v2.0.3.tar.gz # Run glide install --strip-vendor Source0: cni-plugin-2.0.3+vendor.tar.gz Source1: https://github.com/containernetworking/plugins/archive/v0.6.0.tar.gz Patch0: cni-plugin-2.0.3-aix.patch Patch1: plugins-0.6.0-aix.patch Group: Applications/System BuildRequires: gcc-go >= 8.1.0 Requires: libgo >= 8.1.0-2 Requires: libgcc >= 8.1.0-2 Requires: criwpar >= 0.1.0 %description This plugin allows you to use Calico networking for any orchestrator which makes use of the CNI networking specification. %post mkwpari -e PATH=/usr/bin:/etc:/usr/sbin:/sbin:/opt/freeware/bin:/opt/cni/bin -c /opt/cni/bin/calico -w /opt/cni/bin /opt/freeware/share/kubernetes/calico-cni.bff ibmcom/calico-cni-aix:v2.0.3 >/dev/null rm -f /opt/freeware/share/kubernetes/calico-cni.bff exit 0 %postun rmwpari ibmcom/calico-cni-aix:v2.0.3 >/dev/null 2>&1 rm -f /opt/cni/bin/calico /opt/cni/bin/calico-ipam /opt/cni/bin/portmap exit 0 %prep %setup -q -c -a 1 cd cni-plugin-2.0.3/ %patch0 -p1 -b .aix cd ../plugins-0.6.0/ %patch1 -p1 -b .aix %build export PATH=/usr/bin:/etc:/usr/sbin:/sbin:/opt/freeware/bin mkdir -p ./_root mkdir -p ./_build/src/github.com/projectcalico/ ln -s $(pwd)/cni-plugin-2.0.3 ./_build/src/github.com/projectcalico/cni-plugin mkdir -p ./_build/src/github.com/containernetworking/ ln -s $(pwd)/plugins-0.6.0 ./_build/src/github.com/containernetworking/plugins export GOPATH=$(pwd)/_build export GOARCH=ppc export CGO_ENABLED=1 export GOROOT=$(pwd)/_root ulimit -d unlimited ulimit -m unlimited ulimit -s unlimited ulimit -f unlimited # calico go build -p=3 -v -gccgoflags="all=-mcmodel=large -static-libgo -static-libgcc" -o dist/calico $GOPATH/src/github.com/projectcalico/cni-plugin/calico.go strip -t dist/calico # calico-ipam go build -p=3 -v -gccgoflags="all=-mcmodel=large -static-libgo -static-libgcc" -o dist/calico-ipam $GOPATH/src/github.com/projectcalico/cni-plugin/ipam/calico-ipam.go strip -t dist/calico-ipam # portmap go build -p=3 -v -gccgoflags='all=-mcmodel=large -static-libgo -static-libgcc' -o dist/portmap github.com/containernetworking/plugins/plugins/meta/portmap strip -t dist/portmap # calico-cni.bff rm -rf dist/calico-cni-rootfs mkdir -p dist/calico-cni-rootfs cd dist/calico-cni-rootfs mkdir dev etc home tmp var ln -s /usr/bin/ bin ln -s /usr/lib/ lib ln -s /usr/lib/boot/unix_64 unix mkdir -p opt/cni/bin cp ../calico ../calico-ipam ../portmap opt/cni/bin/ cp $GOPATH/src/github.com/projectcalico/cni-plugin/k8s-install/scripts/install-cni.sh . cp $GOPATH/src/github.com/projectcalico/cni-plugin/k8s-install/scripts/calico.conf.default ./calico.conf.tmp find . | backup -iqf ../calico-cni.bff cd - %install mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/kubernetes /usr/bin/install -M 0644 -f ${RPM_BUILD_ROOT}%{_datadir}/kubernetes dist/calico-cni.bff %clean rm -rf ${RPM_BUILD_ROOT} %files %doc cni-plugin-2.0.3/LICENSE cni-plugin-2.0.3/README.md %config(missingok) %{_datadir}/kubernetes/calico-cni.bff %changelog * Tue Aug 21 2018 Damien Bergamini - 2.0.3-1 - Initial port of calico-cni 2.0.3 to AIX