[syslog-ng]Syslog-ng 1.6.0rc2 specfile (20030412 snapshot)
Jose Pedro Oliveira
syslog-ng@lists.balabit.hu
Sat, 12 Apr 2003 18:05:25 +0100
This is a multi-part message in MIME format.
--------------090308000104060000030808
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Balazs Scheidler,
The attached patch does the following:
- creates two new files in the contrib directory
* a logrotate file for Red Hat systems
* a sysconfig file also for Red Hat systems
- reorganizes the spec file
- corrects the %post, %postun, and %preun scripts
- pumps the libol version to 0.3.10
- creates an option for future inclusion of mysql related files
(commented all the files containing references
Requirements:
Apply first the patch in this email (still not included in the
latest snapshots)
https://lists.balabit.hu/pipermail/syslog-ng/2003-April/004896.html
Regards,
jpo
--
José Pedro Oliveira
mailto: jpo@di.uminho.pt * http://gsd.di.uminho.pt/~jpo
--------------090308000104060000030808
Content-Type: text/plain;
name="specfile_related.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="specfile_related.patch"
diff -ruN syslog-ng-1.6.0rc2+20030412manual-original/contrib/syslog-ng.logrotate syslog-ng-1.6.0rc2+20030412manual-modified/contrib/syslog-ng.logrotate
--- syslog-ng-1.6.0rc2+20030412manual-original/contrib/syslog-ng.logrotate Thu Jan 1 01:00:00 1970
+++ syslog-ng-1.6.0rc2+20030412manual-modified/contrib/syslog-ng.logrotate Tue Mar 18 20:51:55 2003
@@ -0,0 +1,6 @@
+/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
+ sharedscripts
+ postrotate
+ /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` 2> /dev/null || true
+ endscript
+}
diff -ruN syslog-ng-1.6.0rc2+20030412manual-original/contrib/syslog-ng.sysconfig syslog-ng-1.6.0rc2+20030412manual-modified/contrib/syslog-ng.sysconfig
--- syslog-ng-1.6.0rc2+20030412manual-original/contrib/syslog-ng.sysconfig Thu Jan 1 01:00:00 1970
+++ syslog-ng-1.6.0rc2+20030412manual-modified/contrib/syslog-ng.sysconfig Tue Mar 18 21:42:33 2003
@@ -0,0 +1,15 @@
+#----------------------------------------------------------------------
+# Options
+#----------------------------------------------------------------------
+# -C - <chroot-dir>
+# -d - Set "debug mode". Prints out various messages to aid in
+# debugging and stops it from becoming a daemon. To activate
+# debugging in the yacc parser, either use this option twice or
+# combine with -v.
+# -p - <filename> Write the current PID information to the specified
+# file.
+# -v - Enable verbose mode. Process will not become a daemon. Prints
+# out fewer messages, compared to -d.
+# -V - Print the version number.
+#----------------------------------------------------------------------
+SYSLOGNG_OPTIONS=""
diff -ruN syslog-ng-1.6.0rc2+20030412manual-original/syslog-ng.spec.in syslog-ng-1.6.0rc2+20030412manual-modified/syslog-ng.spec.in
--- syslog-ng-1.6.0rc2+20030412manual-original/syslog-ng.spec.in Thu Apr 10 11:51:00 2003
+++ syslog-ng-1.6.0rc2+20030412manual-modified/syslog-ng.spec.in Sat Apr 12 18:40:15 2003
@@ -1,44 +1,31 @@
-#--------------------------------------------------------------------------------
-# Program: syslog-ng.spec
-#
-# Purpose: This is the data file user to genertae RPM files so that we can
-# distrbute 'canned' versions of what we have done more easily.
-#--------------------------------------------------------------------------------
-# 08-Dec-02 - REP - Initial version
-
-#--------------------------------------------------------------------------------
-# Some basic definitions for use to use later in the file. We really only want
-# to define things once, and have to change things in only one place.
-#--------------------------------------------------------------------------------
-%define name syslog-ng
-%define version @VERSION@
-%define release 1
-%define libver 0.3.9
-%define mandir /usr/share/man
-%define sbindir /sbin
-
-#--------------------------------------------------------------------------------
-# Basic package information
-#--------------------------------------------------------------------------------
+%define libver 0.3.10
+%define sbindir /sbin
+
+%define con_mysql 0
+
+# Overriding default with --define:
+# rpm -ba --define 'with_mysql 1'
+%{?with_mysql:%define con_mysql 1}
+
+
Summary: Syslog replacement daemon
-Name: %{name}
-Version: %{version}
-Release: %{release}
-Group: System/Kernel and hardware
+Name: syslog-ng
+Version: @VERSION@
+Release: 1
+Group: System Environment/Daemons
License: GPL
Url: http://www.balabit.com/products/syslog_ng/
-Source0: %{name}-%{version}.tar.gz
-Source1: syslog-ng.conf
-Source2: syslog-ng.init
-Source3: mysql-syslog.pipe
-Source4: mysql-syslog.buffer
-Source5: syslog-ng.sysconfig
-Requires: libol >= %{libver}
-Buildroot: %{_tmppath}/%{name}-buildroot
-
-#--------------------------------------------------------------------------------
-# Description of the package
-#--------------------------------------------------------------------------------
+Source: http://www.balabit.hu/downloads/syslog-ng/1.6/%{name}-%{version}.tar.gz
+#Source1: mysql-syslog.pipe
+#Source2: mysql-syslog.buffer
+Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
+BuildRequires: libol-devel >= %{libver}
+BuildRequires: tcp_wrappers
+Requires(post,preun): chkconfig
+Requires(postun,preun): initscripts
+Conflicts: sysklogd
+
+
%description
syslog-ng, as the name shows, is a syslogd replacement, but with new
functionality for the new generation. The original syslogd allows
@@ -48,95 +35,88 @@
Forwarding logs over TCP and remembering all forwarding hops makes it
ideal for firewalled environments.
-#--------------------------------------------------------------------------------
-# What things to do in preperation of making the package
-#--------------------------------------------------------------------------------
%prep
-%setup
+%setup -q
-#--------------------------------------------------------------------------------
-# The build process for the package
-#--------------------------------------------------------------------------------
%build
-
-#--------------------------------------------------------------------------------
-# Configuration process for the package
-#--------------------------------------------------------------------------------
-%configure --prefix=%{_prefix} \
- --sbindir=%{sbindir} \
- --sysconfdir=%{_sysconfdir} \
- --mandir=%{mandir} \
+%configure --sbindir=%{sbindir} \
--enable-tcp-wrapper
make
-#--------------------------------------------------------------------------------
-# The install process for the package
-#--------------------------------------------------------------------------------
%install
-[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_initrddir}
-mkdir -p %{buildroot}%{_sysconfdir}/%{name}
-mkdir -p %{buildroot}/etc/sysconfig
-
-make DESTDIR=%{buildroot} mandir=%{_mandir} install-strip
-
-install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/syslog-ng.conf
-install -m755 %{SOURCE2} %{buildroot}%{_initrddir}/syslog-ng
-install -m700 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/mysql-syslog.pipe
-install -m700 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}/mysql-syslog.buffer
-install -m700 %{SOURCE5} %{buildroot}/etc/sysconfig/syslog-ng
-
-#--------------------------------------------------------------------------------
-# Things to run after it has been installed. We will be adding syslog-ng to the
-# startup, and shutting down the old syslog
-#--------------------------------------------------------------------------------
+rm -rf ${RPM_BUILD_ROOT}
+
+#make DESTDIR=%{RPM_BUILD_ROOT} mandir=%{_mandir} install-strip
+%makeinstall sbindir=$RPM_BUILD_ROOT%{sbindir}
+#
+# Problem: the binary RPM is being assembled with an unstripped
+# version of syslog-ng.
+# Solution: strip file manually.
+#
+strip $RPM_BUILD_ROOT%{sbindir}/%{name}
+
+install -d $RPM_BUILD_ROOT%{_initrddir}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
+
+install -m755 contrib/init.d.RedHat-7.3 $RPM_BUILD_ROOT%{_initrddir}/syslog-ng
+install -m644 contrib/syslog-ng.conf.RedHat $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/syslog-ng.conf
+install -m644 contrib/syslog-ng.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/syslog-ng
+install -m644 contrib/syslog-ng.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/syslog-ng
+%if %{con_mysql}
+#install -m700 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mysql-syslog.pipe
+#install -m700 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/mysql-syslog.buffer
+%endif
+
+
%post
+# rpm {-i|-U|-F}
/sbin/chkconfig --add syslog-ng
-/sbin/chkconfig --del syslog
-sed -e "s/syslogd/syslog-ng/g" /etc/logrotate.d/syslog > /tmp/syslog-ng.tmp.$$
-cp -f /tmp/syslog-ng.tmp.$$ /etc/logrotate.d/syslog
-rm -f /tmp/syslog-ng.tmp.$$
-
-#--------------------------------------------------------------------------------
-# Well, if we uninstall, then we need to put some syslog in place to run for
-# this system.
-#--------------------------------------------------------------------------------
+
%preun
-/sbin/chkconfig --del syslog-ng
-/sbin/chkconfig --add syslog
-sed -e "s/syslog-ng/syslogd/g" /etc/logrotate.d/syslog > /tmp/syslog-ng.tmp.$$
-cp -f /tmp/syslog-ng.tmp.$$ /etc/logrotate.d/syslog
-rm -f /tmp/syslog-ng.tmp.$$
-
-#--------------------------------------------------------------------------------
-# What files and permissions are included in the package
-#--------------------------------------------------------------------------------
+# only rpm -e (not rpm {-U|-F})
+if [ $1 = 0 ]; then
+ /sbin/service syslog-ng stop > /dev/null 2>&1
+ /sbin/chkconfig --del syslog-ng
+fi
+
+%postun
+# only rpm {-U|-F} (not rpm -e)
+if [ $1 = 1 ]; then
+ /sbin/service syslog-ng condrestart > /dev/null 2>&1
+fi
+
+
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README ChangeLog INSTALL NEWS PORTS
-%doc doc/sgml/syslog-ng.txt
+%doc doc/sgml/syslog-ng.txt doc/sgml/syslog-ng.ps
%doc doc/*.demo doc/*.sample doc/*.solaris
-%config(noreplace) %{_sysconfdir}/%{name}/syslog-ng.conf
-%config(noreplace) %{_sysconfdir}/%{name}/mysql-syslog.pipe
-%config(noreplace) %{_sysconfdir}/%{name}/mysql-syslog.buffer
+%doc contrib/syslog2ng doc/stresstest.sh
%config(noreplace) %{_initrddir}/syslog-ng
-%config(noreplace) /etc/sysconfig/syslog-ng
+%config(noreplace) %{_sysconfdir}/%{name}/syslog-ng.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/syslog-ng
+%config(noreplace) %{_sysconfdir}/logrotate.d/syslog-ng
+%if %{con_mysql}
+#%config(noreplace) %{_sysconfdir}/%{name}/mysql-syslog.pipe
+#%config(noreplace) %{_sysconfdir}/%{name}/mysql-syslog.buffer
+%endif
%{sbindir}/syslog-ng
-%{_mandir}/man5/syslog-ng.conf.5*
-%{_mandir}/man8/syslog-ng.8*
+%{_mandir}/man5/*
+%{_mandir}/man8/*
+
-#--------------------------------------------------------------------------------
-# What final cleanup should occur after the package construction has been
-# completed
-#--------------------------------------------------------------------------------
%clean
-[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot}
-rm -r $RPM_BUILD_DIR/%{name}-%{version}
+rm -rf ${RPM_BUILD_ROOT}
+
-#--------------------------------------------------------------------------------
-# Changelog
-#--------------------------------------------------------------------------------
%changelog
+* Sat Apr 12 2003 Jose Pedro Oliveira <jpo@di.uminho.pt> 1.6.0rc2 snapshot
+ - Reorganized specfile
+ - Corrected the scripts (%post, %postun, and %preun)
+ - Commented the mysql related lines; create an option for future inclusion
+
* Thu Feb 27 2003 Richard E. Perlotto II <richard@perlotto.com> 1.6.0rc1-1
- Updated for new version
--------------090308000104060000030808--