integ/base/lighttpd-config/centos/lighttpd-config.spec
Paul-Emile Element 082020ce89 preserve file signature when copying lighttpd config / init files
The lighttpd-config rpm was created to overwrite some configration
files from the stock lighttpd rpm.
However, the default behavior of the cp command does not
preserve extended attibutes. The result is that the IMA file
signatures were lost and the system generated IMA appraisal
failures when configured using the extended security profile.

This modification simply adds the required option to the
cp command to copy the extended attributes with the source files.

Closes-Bug: #1806433

Change-Id: I6811000b9bbd87004b371e8475359601f332a61a
Signed-off-by: Paul-Emile Element <Paul-Emile.Element@windriver.com>
2018-12-03 16:10:43 -05:00

65 lines
1.8 KiB
RPMSpec

Summary: StarlingX lighttpd Configuration File
Name: lighttpd-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: lighttpd
%define debug_package %{nil}
%description
StarlingX lighttpd configuration file
%prep
%setup
%build
%install
CONFDIR=%{buildroot}%{_sysconfdir}/lighttpd
ROOTDIR=%{buildroot}/www
install -d -m 1777 ${ROOTDIR}/tmp
install -d ${CONFDIR}/ssl
install -d ${ROOTDIR}/pages/dav
install -d %{buildroot}%{_datadir}/starlingx
install -m640 lighttpd.conf %{buildroot}%{_datadir}/starlingx/lighttpd.conf
install -m755 lighttpd.init %{buildroot}%{_datadir}/starlingx/lighttpd.init
install -m644 lighttpd-inc.conf ${CONFDIR}/lighttpd-inc.conf
install -m644 index.html.lighttpd ${ROOTDIR}/pages/index.html
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m644 lighttpd.logrotate %{buildroot}%{_datadir}/starlingx/lighttpd.logrotate
chmod 02770 %{buildroot}%{_sysconfdir}/lighttpd
%post
if [ $1 -eq 1 ] ; then
cp --preserve=xattr -f %{_datadir}/starlingx/lighttpd.conf %{_sysconfdir}/lighttpd/lighttpd.conf
chmod 640 %{_sysconfdir}/lighttpd/lighttpd.conf
cp --preserve=xattr -f %{_datadir}/starlingx/lighttpd.init %{_sysconfdir}/rc.d/init.d/lighttpd
chmod 755 %{_sysconfdir}/rc.d/init.d/lighttpd
cp --preserve=xattr -f %{_datadir}/starlingx/lighttpd.logrotate %{_sysconfdir}/logrotate.d/lighttpd
chmod 644 %{_sysconfdir}/logrotate.d/lighttpd
fi
%files
%defattr(-,root,root)
%license LICENSE
%{_datadir}/starlingx/lighttpd.conf
%{_datadir}/starlingx/lighttpd.logrotate
%{_datadir}/starlingx/lighttpd.init
%dir /www/pages/
/www/pages/*
%config(noreplace) %{_sysconfdir}/lighttpd/lighttpd-inc.conf
/www/pages/index.html