%define sbindir /sbin Name: syslog-ng Version: 2.0.10 Release: 1 Summary: Next generation system logging daemon Group: System Environment/Daemons License: GPL URL: http://www.balabit.com/products/syslog_ng/ Source0: http://www.balabit.com/downloads/%{name}/2.0/src/%{name}-%{version}.tar.gz Source1: http://www.balabit.com/downloads/%{name}/2.0/src/%{name}-%{version}.tar.gz.asc BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: flex BuildRequires: glib2-devel >= 2.2 BuildRequires: eventlog-devel >= 0.2.5 Requires: glib2 >= 2.2 Requires: eventlog >= 0.2.5 Provides: syslog %description syslog-ng, as the name shows, is a syslogd replacement, but with new functionality for the new generation. The original syslogd allows messages only to be sorted based on priority/facility pairs; syslog-ng adds the possibility to filter based on message contents using regular expressions. The new configuration scheme is intuitive and powerful. Forwarding logs over TCP and remembering all forwarding hops makes it ideal for firewalled environments. %prep %setup -q # xlc doesn't like the "-Wall" option, so remove it from configure cat configure | sed -e "s| -Wall -g||" > configure.tmp mv configure.tmp configure chmod 755 configure cat contrib/relogger.pl | \ %{__sed} -e 's|^#!/usr/local/bin/perl|#!%{__perl}|' contrib/relogger.pl > contrib/relogger.new mv contrib/relogger.new contrib/relogger.pl chmod a+x contrib/relogger.pl chmod a+x contrib/syslog2ng %build export CC=xlc export CFLAGS="-O" ./configure \ --prefix=%{_prefix} \ --sbindir=%{sbindir} \ --mandir=%{_prefix}/man \ --sysconfdir=/etc/%{name} \ --localstatedir=/var/lib/%{name} \ --disable-spoof-source \ --enable-dynamic-linking make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make DESTDIR=${RPM_BUILD_ROOT} install # strip the binaries/ libraries strip ${RPM_BUILD_ROOT}/%{sbindir}/%{name} ./install-sh -d ${RPM_BUILD_ROOT}/etc/%{name} ./install-sh -o root -g bin -m 0644 contrib/aix-packaging/%{name}.conf \ ${RPM_BUILD_ROOT}/etc/%{name}/%{name}.conf # # Post-Installation # %post echo "Checking whether the syslog-ng service is already registered... " if ! /usr/bin/lssrc -s syslogng >/dev/null 2>&1; then echo "NO" echo "Registering syslog-ng service... " if /usr/bin/mkssys -s syslogng -p /sbin/syslog-ng -u 0 \ -a '-p /etc/syslog-ng.pid' -O -d -Q -S -n 15 -f 9 -E 20 -G ras -w 2 \ >/dev/null 2>&1; then echo "SUCCESSFUL" else echo "FAILED" fi else echo "YES" fi echo "Checking whether the syslogd service is registered..." if /usr/bin/lssrc -s syslogd >/dev/null 2>&1; then echo "YES" if /usr/bin/lssrc -s syslogd|grep -E "^ syslogd.*active" > /dev/null 2>&1; then echo "Stopping the syslogd service..." if /usr/bin/stopsrc -s syslogd >/dev/null 2>&1; then echo "SUCCESSFUL" else echo "FAILED, continuing anyway" fi fi echo "Disabling syslogd service" if /usr/bin/rmssys -s syslogd >/dev/null 2>&1; then echo "SUCCESSFUL" else echo "FAILED" fi else echo "NO" fi if /usr/bin/lssrc -s syslogng|grep -E "^ syslogng.*active" >/dev/null 2>&1; then echo "Stopping syslog-ng" /usr/bin/stopsrc -s syslogng fi echo "Starting syslog-ng" /usr/bin/startsrc -s syslogng # # Pre-Uninstallation # %preun if /usr/bin/lssrc -s syslogng >/dev/null 2>&1; then if /usr/bin/lssrc -s syslogng|grep -E "^ syslogng.*active" > /dev/null 2>&1; then echo "Stopping syslog-ng" /usr/bin/stopsrc -s syslogng fi echo "Unregistering syslog-ng" if /usr/bin/rmssys -s syslogng >/dev/null 2>&1; then echo "SUCCESSFUL" else echo "FAILED" fi fi # re-enable the standard syslogd subsystem #subsysname:synonym:cmdargs:path:uid:auditid:standin:standout:standerr:action:multi:contact:svrkey:svrmtype:priority:sig norm:sigforce:display:waittime:grpname: # syslogd:::/usr/sbin/syslogd:0:0:/dev/console:/dev/console:/dev/console:-O:-Q:-K:0:0:20:0:0:-d:20:ras: if ! /usr/bin/lssrc -s syslogd >/dev/null 2>&1; then echo "Registering syslogd service" if /usr/bin/mkssys -s syslogd -p /usr/sbin/syslogd -u 0 -O -Q -K -E 20 -d -G ras >/dev/null 2>&1; then echo "SUCCESSFUL" else echo "FAILED" fi fi if /usr/bin/lssrc -s syslogd >/dev/null 2>&1; then if ! /usr/bin/lssrc -s syslogd | grep -E "^ syslogd.*active" >/dev/null 2>&1; then echo "Starting syslogd" /usr/bin/startsrc -s syslogd fi fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS ChangeLog COPYING NEWS README %doc doc/reference/syslog-ng.txt %doc doc/security/*.txt %doc doc/examples/syslog-ng.conf.sample %doc contrib/relogger.pl %doc contrib/syslog2ng %doc contrib/syslog-ng.conf.doc %{sbindir}/syslog-ng %dir /etc/%{name} %config(noreplace) /etc/%{name}/syslog-ng.conf %{_mandir}/man5/*.5* %{_mandir}/man8/*.8* %changelog * Fri Mar 20 2009 Michael Perzl - 2.0.10-1 - updated to version v2.0.10 * Fri Mar 20 2009 Michael Perzl - 2.0.8-2 - fixed a problem with mkssys on AIX 6.1 * Fri Feb 01 2008 Michael Perzl - 2.0.8-1 - updated to v2.0.8 * Mon Jan 08 2008 Michael Perzl - 2.0.7-1 - updated to v2.0.7 * Thu Nov 29 2007 Michael Perzl - 2.0.6-1 - updated to v2.0.6 * Mon Oct 01 2007 Michael Perzl - 2.0.5-1 - first version for AIX V5.1 and higher - adapted from syslog-ng.spec.bb