Wednesday, January 7, 2009

librelp RPM spec

If you are planning to use relp feature in rsyslog, then you must install librelp. Here is my configure line for rsyslog-4.1.3:


./configure RELP_LIBS=-L/usr/local/librelp/lib -lrelp -lrt RELP_CFLAGS=-I/usr/local/librelp/include --prefix=/usr/local/rsyslog --enable-gnutls --enable-relp


and librelp spec file.


%define product_name librelp
%define product_version 0.1.1
%define rpm_release 1%{?dist}

%define product_nameversion %{product_name}-%{product_version}
%define product_source_dir %{product_nameversion}
%define product_tarball %{product_nameversion}.tar.gz
%define product_prefix /usr/local/librelp

Summary: Rsyslog librelp support library
Name: %{product_name}
Version: %{product_version}
Release: %{rpm_release}
License: GPLv3
Packager: VVK
Group: System Environment/Libraries
URL: http://www.librelp.com
Source0: http://download.rsyslog.com/librelp/%{product_tarball}
BuildRoot: %{_tmppath}/%{product_nameversion}-build-root

%description
librelp is an easy to use library for the RELP protocol. RELP in turn provides reliable event logging over the network (and consequently RELP stands for Reliable Event Logging Protocol).
RELP (and hence) librelp assures that no message is lost, not even when connections break and a peer becomes unavailable. The current version of RELP has a minimal window of opportunity for message duplication after a session has been broken due to network problems. In this case, a few messages may be duplicated (a problem that also exists with plain tcp syslog). Future versions of RELP will address this shortcoming.

%prep
rm -rf ${RPM_BUILD_ROOT}
%setup -q -n %{product_nameversion}

%build
umask 022
./configure --prefix=%{product_prefix}
make

%install
umask 022
mkdir -p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d
make install DESTDIR=${RPM_BUILD_ROOT}
echo "/usr/local/librelp/lib" > ${RPM_BUILD_ROOT}/etc/ld.so.conf.d/librelp.conf
%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root,-)
%{product_prefix}
/etc/ld.so.conf.d

%changelog
* Sat Sep 01 2007 VVK - 0.1.1-1
- Initial build.
- Built on CentOS 5


I did not build an RPM for rsyslog, because I decided to go with the 2.x series, and there is already an RPM for it in the CentOS repo. I did not want to waste the effort I put into compiling rsyslog-4.1.3 and librelp, so I decided to turn it into a blog post...maybe someone out there will find it useful :-)

Cheers,
VVK

No comments:

Post a Comment