7880e6f1a1
Package logrotate-config is created to config logrotate.conf and logrotate.cron for logrotate. Pass build and basic deploy test. And confirmed logrotate.conf and logrotate.cron is the same as before. Story: 2003768 Task: 27598 Change-Id: I4792366018f7c4d4960bf1182c8c2ffee5625676 Signed-off-by: slin14 <shuicheng.lin@intel.com>
45 lines
1012 B
RPMSpec
45 lines
1012 B
RPMSpec
Summary: StarlingX logrotate Configuration File
|
|
Name: logrotate-config
|
|
Version: 1.0
|
|
Release: %{tis_patch_ver}%{?_tis_dist}
|
|
License: Apache-2.0
|
|
Group: config-files
|
|
Packager: StarlingX
|
|
URL: unknown
|
|
Source: %name-%version.tar.gz
|
|
|
|
BuildArch: noarch
|
|
Requires: logrotate
|
|
|
|
%define debug_package %{nil}
|
|
|
|
%description
|
|
StarlingX logrotate configuration file
|
|
|
|
%prep
|
|
|
|
%setup
|
|
|
|
%build
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{_sysconfdir}/cron.d
|
|
install -m 644 logrotate-cron.d %{buildroot}%{_sysconfdir}/cron.d/logrotate
|
|
install -d %{buildroot}%{_datadir}/starlingx
|
|
install -m 644 logrotate.conf %{buildroot}%{_datadir}/starlingx/logrotate.conf
|
|
|
|
|
|
%post
|
|
if [ $1 -eq 1 ] ; then
|
|
cp -f %{_datadir}/starlingx/logrotate.conf %{_sysconfdir}/logrotate.conf
|
|
chmod 644 %{_sysconfdir}/logrotate.conf
|
|
mv %{_sysconfdir}/cron.daily/logrotate %{_sysconfdir}/logrotate.cron
|
|
chmod 700 %{_sysconfdir}/logrotate.cron
|
|
fi
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%license LICENSE
|
|
%{_sysconfdir}/cron.d/logrotate
|
|
%{_datadir}/starlingx/logrotate.conf
|