X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=SPECS%2Fcaas-sriovdp.spec;fp=SPECS%2Fcaas-sriovdp.spec;h=498f3d4c8e30f9eba977f0d113dadf7f37b701dd;hb=8e53059aed6a7fdde34149893f05552aca3ed89a;hp=0000000000000000000000000000000000000000;hpb=7932e11f4f9ccbf0a5203d8a481c052f31ed1327;p=ta%2Fcaas-danm.git diff --git a/SPECS/caas-sriovdp.spec b/SPECS/caas-sriovdp.spec new file mode 100644 index 0000000..498f3d4 --- /dev/null +++ b/SPECS/caas-sriovdp.spec @@ -0,0 +1,75 @@ +# Copyright 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +%define COMPONENT sriovdp +%define RPM_NAME caas-%{COMPONENT} +%define RPM_MAJOR_VERSION 2.0.0 +%define RPM_MINOR_VERSION 1 +%define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION} + +Name: %{RPM_NAME} +Version: %{RPM_MAJOR_VERSION} +Release: %{RPM_MINOR_VERSION}%{?dist} +Summary: Containers as a Service sriov network device plugin component +License: %{_platform_license} and Apache License 2.0 +URL: https://github.com/intel/sriov-network-device-plugin/ +BuildArch: x86_64 +Vendor: %{_platform_vendor} and intel/sriov-network-device-plugin unmodified +Source0: %{name}-%{version}.tar.gz + +Requires: docker-ce >= 18.09.2 +BuildRequires: docker-ce >= 18.09.2 + +%description +This RPM contains the sriov network device plugin container for CaaS subsystem. + +%prep +%autosetup + +%build +docker build \ + --network=host \ + --no-cache \ + --force-rm \ + --build-arg HTTP_PROXY="${http_proxy}" \ + --build-arg HTTPS_PROXY="${https_proxy}" \ + --build-arg NO_PROXY="${no_proxy}" \ + --build-arg http_proxy="${http_proxy}" \ + --build-arg https_proxy="${https_proxy}" \ + --build-arg no_proxy="${no_proxy}" \ + --build-arg SRIOV="%{RPM_MAJOR_VERSION}" \ + --tag %{COMPONENT}:%{IMAGE_TAG} \ + %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/ + +mkdir -p %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/ + +docker save %{COMPONENT}:%{IMAGE_TAG} | gzip -c > %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar + +docker rmi -f %{COMPONENT}:%{IMAGE_TAG} + +%install +mkdir -p %{buildroot}/%{_caas_container_tar_path}/ +rsync -av %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar %{buildroot}/%{_caas_container_tar_path}/ + +%files +%{_caas_container_tar_path}/%{COMPONENT}:%{IMAGE_TAG}.tar + +%preun + +%post + +%postun + +%clean +rm -rf ${buildroot}