LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File logwatch.spec of Package logwatch (Project home:stefjakobs)

#
# spec file for package logwatch (Version 7.4.2)
#
# Copyright (c) 2014 Stefan Jakobs 
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# norootforbuild


Name:           logwatch
Summary:        Analyzes and Reports on system logs
Version:        7.4.2
Release:        1
License:        MIT
Group:          System/Monitoring
Url:            http://logwatch.sourceforge.net
BuildArch:      noarch
Source0:        logwatch-%{version}.tar.gz
Source1:        Logwatch_Dmeventd_Setup_Files.tgz
Patch0:         logwatch-timestamp_in_var.patch
Requires:       perl textutils sh-utils grep mailx cron perl-Date-Manip
BuildRequires:  dos2unix
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Logwatch is a customizable, pluggable log-monitoring system. It will go
through your logs for a given period of time and make a report in the
areas that you wish with the detail that you wish.



Authors:
--------
    Kirk Bauer <kirk@kaybee.org>

%prep
%setup -q -a 1
chmod u+w Logwatch_Setup_Files/*
%patch0
dos2unix scripts/services/courier

%build

%install
install -m 0755 -d %{buildroot}%{_var}/cache/logwatch
install -m 0755 -d %{buildroot}%{_sysconfdir}/logwatch/scripts
install -m 0755 -d %{buildroot}%{_sysconfdir}/logwatch/conf
install -m 0755 -d %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles
install -m 0755 -d %{buildroot}%{_sysconfdir}/logwatch/conf/services
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/default.conf/logfiles
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/default.conf/services
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/default.conf/html
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/dist.conf/logfiles
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/dist.conf/services
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/scripts/services
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/scripts/shared
install -m 0755 -d %{buildroot}%{_datadir}/logwatch/lib
install -m 0755 -d %{buildroot}/var/lib/logwatch
install -m 0755 scripts/logwatch.pl %{buildroot}%{_datadir}/logwatch/scripts/logwatch.pl
for i in scripts/logfiles/* ; do
   if [ $(ls $i | wc -l) -ne 0 ] ; then
      install -m 0755 -d %{buildroot}%{_datadir}/logwatch/$i
      install -m 0644 $i/* %{buildroot}%{_datadir}/logwatch/$i
   fi
done
install -m 0644 scripts/services/* %{buildroot}%{_datadir}/logwatch/scripts/services
install -m 0644 Logwatch_Setup_Files/dmeventd %{buildroot}%{_datadir}/logwatch/scripts/services
install -m 0644 scripts/shared/* %{buildroot}%{_datadir}/logwatch/scripts/shared
install -m 0644 lib/* %{buildroot}%{_datadir}/logwatch/lib
install -m 0644 conf/*.conf %{buildroot}%{_datadir}/logwatch/default.conf
install -m 0644 conf/logfiles/* %{buildroot}%{_datadir}/logwatch/default.conf/logfiles
install -m 0644 conf/services/* %{buildroot}%{_datadir}/logwatch/default.conf/services
install -m 0644 Logwatch_Setup_Files/dmeventd.conf %{buildroot}%{_datadir}/logwatch/default.conf/services
install -m 0644 conf/html/* %{buildroot}%{_datadir}/logwatch/default.conf/html
install -m 0755 -d %{buildroot}%{_mandir}/man8
install -m 0755 -d %{buildroot}%{_mandir}/man5
install -m 0644 logwatch.8 %{buildroot}%{_mandir}/man8
install -m 0644 logwatch.conf.5 %{buildroot}%{_mandir}/man5
install -m 0644 ignore.conf.5 %{buildroot}%{_mandir}/man5
install -m 0644 override.conf.5 %{buildroot}%{_mandir}/man5
rm -f   %{buildroot}%{_sysconfdir}/cron.daily/logwatch \
   %{buildroot}%{_sbindir}/logwatch
install -m 0755 -d %{buildroot}%{_sysconfdir}/cron.daily
ln -s %{_datadir}/logwatch/scripts/logwatch.pl %{buildroot}%{_sysconfdir}/cron.daily/0logwatch
install -m 0755 -d %{buildroot}%{_sbindir}
install -m 0755 -d %{buildroot}%{_sysconfdir}/cron.d
install -m 0644 Logwatch_Setup_Files/dmeventd_cronjob.txt %{buildroot}%{_sysconfdir}/cron.d/dmeventd
ln -s %{_datadir}/logwatch/scripts/logwatch.pl %{buildroot}%{_sbindir}/logwatch
echo "###### REGULAR EXPRESSIONS IN THIS FILE WILL BE TRIMMED FROM REPORT OUTPUT #####" > %{buildroot}%{_sysconfdir}/logwatch/conf/ignore.conf
echo "# Local configuration options go here (defaults are in %{_datadir}/logwatch/default.conf/logwatch.conf)" > %{buildroot}%{_sysconfdir}/logwatch/conf/logwatch.conf
echo "# Configuration overrides for specific logfiles/services may be placed here." > %{buildroot}%{_sysconfdir}/logwatch/conf/override.conf
#
rpm -qa --queryformat='%%{name}/%%{version}/%%{release}/%%{arch}\n'| sort | bzip2 -9 > USEDFORBUILD.bz2
#

## remove shebangs
for script in puppet cisco http-error spamassassin zypp postfix amavis \
   mod_security2 rsyslogd stunnel tivoli-smc; do
  sed -i '1d' "%{buildroot}%{_datadir}/logwatch/scripts/services/${script}"
done

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc LICENSE README HOWTO-Customize-LogWatch
%dir %{_var}/cache/logwatch
%dir %{_sysconfdir}/logwatch
%dir %{_sysconfdir}/logwatch/scripts
%dir %{_sysconfdir}/logwatch/conf
%dir %{_sysconfdir}/logwatch/conf/logfiles
%dir %{_sysconfdir}/logwatch/conf/services
%dir %{_datadir}/logwatch
%dir %{_datadir}/logwatch/default.conf
%dir %{_datadir}/logwatch/default.conf/services
%dir %{_datadir}/logwatch/default.conf/logfiles
%dir %{_datadir}/logwatch/default.conf/html
%dir %{_datadir}/logwatch/dist.conf
%dir %{_datadir}/logwatch/dist.conf/services
%dir %{_datadir}/logwatch/dist.conf/logfiles
%dir %{_datadir}/logwatch/scripts
%dir %{_datadir}/logwatch/scripts/logfiles
%dir %{_datadir}/logwatch/scripts/services
%dir %{_datadir}/logwatch/scripts/shared
%dir %{_datadir}/logwatch/scripts/logfiles/*
%dir %{_datadir}/logwatch/lib
%dir /var/lib/logwatch
%config %{_sysconfdir}/cron.d/dmeventd
%{_datadir}/logwatch/scripts/logwatch.pl
%{_sbindir}/logwatch
%{_datadir}/logwatch/scripts/shared/*
%{_datadir}/logwatch/scripts/services/*
%{_datadir}/logwatch/scripts/logfiles/*/*
%{_datadir}/logwatch/lib/Logwatch.pm
%{_datadir}/logwatch/default.conf/*.conf
%{_datadir}/logwatch/default.conf/services/*.conf
%{_datadir}/logwatch/default.conf/logfiles/*.conf
%{_datadir}/logwatch/default.conf/html/*.html
%{_sysconfdir}/cron.daily/0logwatch
%doc %{_mandir}/man8/logwatch.8*
%doc %{_mandir}/man5/logwatch.conf.5*
%doc %{_mandir}/man5/ignore.conf.5*
%doc %{_mandir}/man5/override.conf.5*
%config(noreplace) %{_sysconfdir}/logwatch/conf/*.conf

%changelog
* Sat Feb 27 2016 Stefan Jakobs <stefan.jakobs@rus.uni-stuttgart.de> - 7.4.2
- Update to version 7.4.2
* Wed Jan 06 2016 Stefan Jakobs <stefan.jakobs@rus.uni-stuttgart.de> - 7.4.2
- Update to version 7.4.2 beta2
* Sun Feb 01 2014 Stefan Jakobs <stefan.jakobs@rus.uni-stuttgart.de> - 7.4.2
- Update to version 7.4.2 beta1
* Wed Mar 02 2011 Stefan Jakobs <stefan.jakobs@rus.uni-stuttgart.de> - 2
- Update to version 7.4.0 stable
* Wed Feb 02 2011 Stefan Jakobs <stefan.jakobs@rus.uni-stuttgart.de> - 1
- Initial release, version 7.3.6.r25