LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > unSpawn
User Name
Password

Notices


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):

Code:
%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}

%description 
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.

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

%build
	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


%install
if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then
	rm -rf ${RPM_BUILD_ROOT}
	rm -f %{_tmppath}/%{name}_contents.txt
	make DESTDIR=$RPM_BUILD_ROOT install
	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}
fi
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
						
%clean
if [ "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}-%{ver}" ]; then
	rm -rf ${RPM_BUILD_ROOT}
	rm -f %{_tmppath}/%{name}_contents.txt
fi

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

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

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


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

%changelog
* 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 2239 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 11:00 PM.

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