audit-armada-app/stx-audit-helm/centos/stx-audit-helm.spec
Carmen Rata 52f6d68067 Logrotate configuration for auditd logs
This commit implements logrotate configuration for auditd logs.
The auditd log rotation configuration in auditd.conf is disabled,
as it gets replaced by linux logrotate configuration.

Story: 2008849
Task: 43157

Signed-off-by: Carmen Rata <carmen.rata@windriver.com>
Change-Id: Ifd8038d8dcc1364e59c9dce0fea22917dc4c9b35
2021-09-08 16:53:49 -04:00

82 lines
2.0 KiB
RPMSpec

# Application tunables (maps to metadata)
%global app_name auditd
%global helm_repo stx-platform
%global armada_folder /usr/lib/armada
# Install location
%global app_folder /usr/local/share/applications/helm
# Build variables
%global helm_folder /usr/lib/helm
%global toolkit_version 0.1.0
Summary: StarlingX AUDITD Armada Helm Charts
Name: stx-audit-helm
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: Wind River <info@windriver.com>
URL: unknown
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: helm
BuildRequires: python-k8sapp-auditd
BuildRequires: python-k8sapp-auditd-wheels
%description
StarlingX AUDITD Helm Charts
%prep
%setup -n %{name}-%{version}
%build
cd helm-charts
make
cd -
# Create a chart tarball compliant with sysinv kube-app.py
%define app_staging %{_builddir}/staging
%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz
# Setup staging
mkdir -p %{app_staging}
cp files/metadata.yaml %{app_staging}
cp manifests/*.yaml %{app_staging}
mkdir -p %{app_staging}/charts
cp helm-charts/*.tgz %{app_staging}/charts
cd %{app_staging}
# Populate metadata
sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml
sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p %{app_staging}/plugins
cp /plugins/%{app_name}/*.whl %{app_staging}/plugins
# package it up
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .
# Cleanup staging
rm -fr %{app_staging}
%install
install -d -m 755 %{buildroot}/%{app_folder}
install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder}
install -m 644 -p -D files/auditd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/auditd.logrotate
%files
%defattr(-,root,root,-)
%{app_folder}/*
# logfile config files
%{_sysconfdir}/logrotate.d/auditd.logrotate