View the Most Wanted LQ Wiki articles.
Go Back > Blogs > unSpawn
User Name


Rate this Entry

Rsyslog-4.6.3 .spec

Posted 07-28-2010 at 11:59 PM by unSpawn

Rsyslog is a Syslog replacement. Centos5U5 provides rsyslog-3.22.1-3.el5.i386 but the development branch is at 5.5.6 and the stable release is 4.6.3. Here's a .spec file that will build 4.6.3-1 (this wasn't derived from the 3.22.1 .src.rpm .spec so YMMV(VM) as usual):

%define debug_packages	%{nil}
%define debug_package %{nil}
%define name rsyslog
%define ver 4.6.3
%define rel 1

Name: %{name}
Summary: Enhanced system logging and kernel message trapping daemons
Version: %{ver}
Release: %{rel}
License: GPL
Group: System Environment/Daemons
Source0: %{name}-%{ver}.tar.gz
Source1: init.%{name}
Source2: sysconfig.%{name}
Prereq: /sbin/chkconfig
Provides: %{name}
BuildRoot: %{_tmppath}/%{name}-%{version}

Rsyslog is an enhanced multi-threaded syslogd supporting, among others, MySQL,
syslog/tcp, RFC 3195, permitted sender lists, filtering on any message part,
and fine grain output format control. It is quite compatible to stock sysklogd
and can be used as a drop-in replacement. Its advanced features make it
suitable for enterprise-class, encryption protected syslog relay chains while
at the same time being very easy to setup for the novice user.

%setup -n %{name}-%{ver}

	CFLAGS="$RPM_OPT_FLAGS -O3 -march=i686"
	export CFLAGS
	export make="make -j3"

%configure --prefix=/usr --sbindir=/sbin --sysconfdir=/etc 2>&1 | egrep "^.*:.*[[:blank:]](no|yes)$" > BUILDOPTIONS.log
make >/dev/null

if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then
	rm -rf ${RPM_BUILD_ROOT}
	rm -f %{_tmppath}/%{name}_contents.txt
	mkdir -p %{_tmppath}/%{name}-%{ver}/etc/rc.d/init.d
	install -m 0750 ${RPM_SOURCE_DIR}/init.%{name} %{_tmppath}/%{name}-%{ver}/etc/rc.d/init.d/%{name}
	mkdir -p %{_tmppath}/%{name}-%{ver}/etc/sysconfig
	install -m 0640 ${RPM_SOURCE_DIR}/sysconfig.%{name} %{_tmppath}/%{name}-%{ver}/etc/sysconfig/%{name}
find $RPM_BUILD_ROOT -not -type d -printf "%%%attr(%%m,root,root) %%p\n" | sed -e "s|$RPM_BUILD_ROOT||g" -e "s|.*/man/.*$|\0.gz|g" > %{_tmppath}/%{name}_contents.txt
if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then
	rm -rf ${RPM_BUILD_ROOT}
	rm -f %{_tmppath}/%{name}_contents.txt

/sbin/chkconfig --add rsyslog
for n in /var/log/{messages,secure,maillog,spooler}
        [ -f $n ] && continue
        umask 066 && touch $n

if [ $1 = 0 ]; then
        service rsyslog stop >/dev/null 2>&1 ||:
        /sbin/chkconfig --del rsyslog

if [ "$1" -ge "1" ]; then
        service rsyslog condrestart > /dev/null 2>&1 ||:

%files -f %{_tmppath}/%{name}_contents.txt
%doc README ChangeLog doc/* BUILDOPTIONS.log

* Wed Jul 28 2010 %{packager} - %{ver}
- Packaging for %{ver}
* Note %Source2 basically the same as /etc/sysconfig/syslog (add a "-cn" to SYSLOGD_OPTIONS and remove "-m 0") and %Source1 is a standard SysV init script. The version attached has a "test" argument added to check directive validity.
Attached Files
File Type: txt init.rsyslog.txt (2.5 KB, 5 views)
Posted in Uncategorized
Views 1332 Comments 0
« Prev     Main     Next »


All times are GMT -5. The time now is 04:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration