Fluentd to 1.7.3, Elasticsearch to 7.4.0
[ta/caas-logging.git] / SPECS / fluentd.spec
1 # Copyright 2019 Nokia
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 %define COMPONENT fluentd
16 %define RPM_NAME caas-%{COMPONENT}
17 %define RPM_MAJOR_VERSION 1.7.3
18 %define RPM_MINOR_VERSION 0
19 %define IMAGE_TAG %{RPM_MAJOR_VERSION}-%{RPM_MINOR_VERSION}
20
21 Name:           %{RPM_NAME}
22 Version:        %{RPM_MAJOR_VERSION}
23 Release:        %{RPM_MINOR_VERSION}%{?dist}
24 Summary:        Containers as a Service Fluentd component
25 License:        %{_platform_license} and MIT license and Apache License and BSD 3-clause New or Revised License and Ruby License and BSD and Mozilla Public License and BSD 3-clause New or Revised License
26 URL:            https://github.com/fluent/fluentd
27 BuildArch:      %{_arch}
28 Vendor:         %{_platform_vendor} and fluent/fluentd unmodified
29 Source0:        %{name}-%{version}.tar.gz
30
31 Requires: docker-ce >= 18.09.2, rsync
32 BuildRequires: docker-ce >= 18.09.2, xz
33
34 %description
35 This RPM contains the Fluentd container image, and related deployment artifacts for the CaaS subsystem.
36
37 %prep
38 %autosetup
39
40 %build
41 docker build \
42   --network=host \
43   --no-cache \
44   --force-rm \
45   --build-arg HTTP_PROXY="${http_proxy}" \
46   --build-arg HTTPS_PROXY="${https_proxy}" \
47   --build-arg NO_PROXY="${no_proxy}" \
48   --build-arg http_proxy="${http_proxy}" \
49   --build-arg https_proxy="${https_proxy}" \
50   --build-arg no_proxy="${no_proxy}" \
51   --build-arg VERSION="%{version}" \
52   --tag %{COMPONENT}:%{IMAGE_TAG} \
53   %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-build/%{COMPONENT}/
54
55 mkdir -p %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/
56
57 docker save %{COMPONENT}:%{IMAGE_TAG} | xz -z -T2 > %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar
58
59 docker rmi -f %{COMPONENT}:%{IMAGE_TAG}
60
61 %install
62 mkdir -p %{buildroot}/%{_caas_container_tar_path}/
63 rsync -av %{_builddir}/%{RPM_NAME}-%{RPM_MAJOR_VERSION}/docker-save/%{COMPONENT}:%{IMAGE_TAG}.tar %{buildroot}/%{_caas_container_tar_path}/
64
65 %files
66 %{_caas_container_tar_path}/%{COMPONENT}:%{IMAGE_TAG}.tar
67
68 %preun
69 %post
70 %clean
71 rm -rf ${buildroot}