pen/pen.spec

118 lines
3.4 KiB
RPMSpec

#
# spec file for package pen
#
# Copyright (c) 2019 SUSE LINUX 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/
#
Name: pen
Summary: A simple load balancer for tcp based protocols
License: GPL-2.0+
Group: Productivity/Clustering/HA
Url: http://siag.nu/pen/
Version: 0.26.1
Release: 0
Source0: http://siag.nu/pub/pen/%{name}-%{version}.tar.gz
Source1: %{name}.cfg
Source2: init.%{name}
Source3: runpen.sh
Source4: pen.service
PreReq: %insserv_prereq %fillup_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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
mkdir -p $RPM_BUILD_ROOT/%_sbindir
#make DESTDIR="$RPM_BUILD_ROOT" install
%makeinstall
# Install pen init script
install -d $RPM_BUILD_ROOT%{_datadir}/pen/scripts
install -m 0744 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/pen/scripts/rcpen
install -d $RPM_BUILD_ROOT%{_unitdir}
install -m 0444 %SOURCE4 $RPM_BUILD_ROOT%{_unitdir}/pen.service
install -m 0744 %SOURCE3 $RPM_BUILD_ROOT/usr/bin/runpen.sh
install -d $RPM_BUILD_ROOT/etc
install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/etc/%{name}.cfg
ln -sf service $RPM_BUILD_ROOT/usr/sbin/rcpen
mkdir -p ${RPM_BUILD_ROOT}%{_docdir}
mv $RPM_BUILD_ROOT/usr/doc/pen ${RPM_BUILD_ROOT}%{_docdir}
%clean
rm -rf ${RPM_BUILD_ROOT}
%pre
%service_add_pre pen.service
%post
%service_add_post pen.service
%preun
%service_del_preun pen.service
%postun
%service_del_postun pen.service
%files
%defattr(-,root,root)
%{_docdir}/*
%{_mandir}/man1/*.1.gz
%{_datadir}/pen
%{_unitdir}/pen.service
/usr/bin/%{name}
/usr/bin/runpen.sh
/usr/bin/mergelogs
/usr/bin/penctl
/usr/bin/penlog
/usr/bin/penlogd
/usr/sbin/rc%{name}
%config(noreplace) /etc/%{name}.cfg
%changelog