File pen.spec of Package pen

#
# spec file for package pen
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           pen
Version:        0.18.0
Release:        0
Summary:        A simple load balancer for tcp based protocols
Group:          Productivity/Clustering/HA
Url:            http://siag.nu/pen/
License:        GPL-2.0+
Source:         ftp://siag.nu/pub/pen/pen-%{version}.tar.bz2
Source1:        pen.cfg
Source2:        init.pen
Source3:        runpen.sh
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc glibc-devel make
BuildRequires:  autoconf automake libtool

%description
Pen is a load balancer for "simple" tcp based protocols such as http or
smtp. It allows several servers to appear as one to the outside and
automatically detects servers that are down and distributes clients
among the available servers. This gives high availability and scalable
performance.

The load balancing algorithm keeps track of clients and will try to
send them back to the server they visited the last time. This is useful
for applications that maintain state between connections in the server,
including most modern web applications.

When pen detects that a server is unavailable, it scans for another
starting with the server after the most recently used one. That way we
get load balancing and "fair" failover for free.

Correctly configured, pen can ensure that a server farm is always
available, even when individual servers are brought down for
maintenance or reconfiguration.

The final single point of failure, pen itself, can be eliminated by
running pen on several servers, using vrrp to decide which is active.



Authors:
--------
    Ulric Eriksson  <ulric@siag.nu>

%prep
%setup -q

%build
%configure \
   --with-daemon
%__make %{?jobs:-j%{jobs}}

%install
%__install -d "%{buildroot}%{_sbindir}"
%makeinstall
%__rm -rf "%{buildroot}%{_prefix}/doc"

%__install -D -m0744 "%{SOURCE2}" "%{buildroot}/etc/init.d/pen"
%__install -D -m0744 "%{SOURCE3}" "%{buildroot}%{_bindir}/runpen.sh"
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_sysconfdir}/pen.cfg"
%__ln_s ../../etc/init.d/pen "%{buildroot}%{_sbindir}/rcpen"

%clean
%__rm -rf "%{buildroot}"

%post
%{fillup_and_insserv -n pen pen}

%postun
%restart_on_update %{name}
%insserv_cleanup

%preun
%stop_on_removal %{name}

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING HOWTO README
%doc penstats
%config(noreplace) %{_sysconfdir}/pen.cfg
%{_bindir}/pen
%{_bindir}/runpen.sh
%{_bindir}/mergelogs
%{_bindir}/penctl
%{_bindir}/penlog
%{_bindir}/penlogd
/etc/init.d/pen
%{_sbindir}/rcpen
%doc %{_mandir}/man1/pen.1*
%doc %{_mandir}/man1/penctl.1*
%doc %{_mandir}/man1/penlog.1*
%doc %{_mandir}/man1/penlogd.1*
%doc %{_mandir}/man1/mergelogs.1*

%changelog
openSUSE Build Service is sponsored by