integ/config-files/syslog-ng-config/centos/syslog-ng-config.spec
slin14 fc4a7c9d49 refactor syslog-ng
Package syslog-ng-config is created to install customized
config file of syslog-ng. Since there is no source code change
in syslog-ng, we could replace the srpm with rpm directly.

syslog-ng-config is set to depends on syslog-ng. So syslog-ng
will be installed automatically.

Test:
Pass build and basic deploy test. Confirmed the related config
file is the same as before.

Story: 2003768
Task: 27599
Depends-On: https://review.openstack.org/616720

Change-Id: I2a4e15b9ffde92aa59072d590de2b56d239e29ad
Signed-off-by: slin14 <shuicheng.lin@intel.com>
2018-11-09 19:35:54 +08:00

65 lines
1.8 KiB
RPMSpec

Summary: StarlingX syslog-ng Configuration File
Name: syslog-ng-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
# systemd provides %{_unitdir}
BuildRequires: systemd
Requires: syslog-ng
Requires: syslog-ng-libdbi
%define debug_package %{nil}
%description
StarlingX syslog-ng configuration file
%prep
%setup
%build
%install
install -d %{buildroot}%{_datadir}/starlingx
install -D -m644 syslog-ng.conf %{buildroot}%{_datadir}/starlingx/syslog-ng.conf
install -D -m644 syslog-ng.logrotate %{buildroot}%{_datadir}/starlingx/syslog-ng.logrotate
install -D -m644 remotelogging.conf %{buildroot}%{_sysconfdir}/syslog-ng/remotelogging.conf
install -d %{buildroot}%{_sbindir}
install -D -m700 fm_event_syslogger %{buildroot}%{_sbindir}/fm_event_syslogger
install -D -m644 syslog-ng.service %{buildroot}%{_datadir}/starlingx/syslog-ng.service
%post
if [ $1 -eq 1 ] ; then
cp -f %{_datadir}/starlingx/syslog-ng.conf %{_sysconfdir}/syslog-ng/syslog-ng.conf
chmod 644 %{_sysconfdir}/syslog-ng/syslog-ng.conf
cp -f %{_datadir}/starlingx/syslog-ng.logrotate %{_sysconfdir}/logrotate.d/syslog
chmod 644 %{_sysconfdir}/logrotate.d/syslog
cp -f %{_datadir}/starlingx/syslog-ng.service %{_unitdir}/syslog-ng.service
chmod 644 %{_unitdir}/syslog-ng.service
fi
ldconfig
%systemd_post syslog-ng.service
%preun
%systemd_preun syslog-ng.service
%postun
ldconfig
%systemd_postun_with_restart syslog-ng.service
%files
%defattr(-,root,root)
%license LICENSE
%config(noreplace) %{_sysconfdir}/syslog-ng/remotelogging.conf
%{_datadir}/starlingx/syslog-ng.conf
%{_datadir}/starlingx/syslog-ng.logrotate
%{_datadir}/starlingx/syslog-ng.service
%{_sbindir}/fm_event_syslogger