3 %bcond_without tests # do not perform "make test"
7 %include /usr/lib/rpm/macros.perl
8 Summary: Server::Starter - a superdaemon for hot-deploying server programs
10 Name: perl-Server-Starter
14 License: GPL v1+ or Artistic
15 Group: Development/Languages/Perl
16 Source0: http://www.cpan.org/modules/by-module/Server/%{pdir}-%{pnam}-%{version}.tar.gz
17 # Source0-md5: 037d75831a23ca76cd306d678b20332e
18 #URL: http://search.cpan.org/dist/Server-Starter/
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
21 # generic URL, check or change before uncommenting
23 BuildRequires: perl-List-MoreUtils
24 BuildRequires: perl-Proc-Wait3
25 BuildRequires: perl-Scope-Guard
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 It is often a pain to write a server program that supports graceful
32 restarts, with no resource leaks. Server::Starter, solves the problem
33 by splitting the task into two. One is start_server, a script provided
34 as a part of the module, which works as a superdaemon that binds to
35 zero or more TCP ports or unix sockets, and repeatedly spawns the
36 server program that actually handles the necessary tasks (for example,
37 responding to incoming commenctions). The spawned server programs
38 under Server::Starter call accept(2) and handle the requests.
40 To gracefully restart the server program, send SIGHUP to the
41 superdaemon. The superdaemon spawns a new server program, and if (and
42 only if) it starts up successfully, sends SIGTERM to the old server
45 By using Server::Starter it is much easier to write a hot-deployable
46 server. Following are the only requirements a server program to be run
47 under Server::Starter should conform to:
49 - receive file descriptors to listen to through an environment
51 - perform a graceful shutdown when receiving SIGTERM
53 A Net::Server personality that can be run under Server::Starter exists
54 under the name Net::Server::SS::PreFork.
58 # %description -l pl.UTF-8 # TODO
61 %setup -q -n %{pdir}-%{pnam}-%{version}
64 %{__perl} Makefile.PL \
68 %{?with_tests:%{__make} test}
71 rm -rf $RPM_BUILD_ROOT
73 %{__make} pure_install \
74 DESTDIR=$RPM_BUILD_ROOT
77 rm -rf $RPM_BUILD_ROOT
80 %defattr(644,root,root,755)
82 %attr(755,root,root) %{_bindir}/start_server
83 %{_mandir}/man1/start_server.1p*
84 %{perl_vendorlib}/Server/*.pm