]> git.pld-linux.org Git - packages/perl-Server-Starter.git/blob - perl-Server-Starter.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/perl-Server-Starter.git] / perl-Server-Starter.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4
5 %define         pdir    Server
6 %define         pnam    Starter
7 Summary:        Server::Starter - a superdaemon for hot-deploying server programs
8 Name:           perl-Server-Starter
9 Version:        0.35
10 Release:        1
11 # same as perl
12 License:        GPL v1+ or Artistic
13 Group:          Development/Languages/Perl
14 Source0:        http://www.cpan.org/modules/by-module/Server/%{pdir}-%{pnam}-%{version}.tar.gz
15 # Source0-md5:  10cc818382ff22b27d9af37344fbff18
16 URL:            http://search.cpan.org/dist/Server-Starter/
17 BuildRequires:  perl-devel >= 1:5.8.0
18 BuildRequires:  rpm-perlprov >= 4.1-13
19 %if %{with tests}
20 BuildRequires:  perl-List-MoreUtils
21 BuildRequires:  perl-Proc-Wait3
22 BuildRequires:  perl-Scope-Guard
23 %endif
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 It is often a pain to write a server program that supports graceful
29 restarts, with no resource leaks. Server::Starter, solves the problem
30 by splitting the task into two. One is start_server, a script provided
31 as a part of the module, which works as a superdaemon that binds to
32 zero or more TCP ports or unix sockets, and repeatedly spawns the
33 server program that actually handles the necessary tasks (for example,
34 responding to incoming commenctions). The spawned server programs
35 under Server::Starter call accept(2) and handle the requests.
36
37 To gracefully restart the server program, send SIGHUP to the
38 superdaemon. The superdaemon spawns a new server program, and if (and
39 only if) it starts up successfully, sends SIGTERM to the old server
40 program.
41
42 By using Server::Starter it is much easier to write a hot-deployable
43 server. Following are the only requirements a server program to be run
44 under Server::Starter should conform to:
45
46 - receive file descriptors to listen to through an environment
47   variable
48 - perform a graceful shutdown when receiving SIGTERM
49
50 A Net::Server personality that can be run under Server::Starter exists
51 under the name Net::Server::SS::PreFork.
52
53 %prep
54 %setup -q -n %{pdir}-%{pnam}-%{version}
55
56 %build
57 %{__perl} Build.PL \
58         --destdir=$RPM_BUILD_ROOT \
59         --installdirs=vendor
60 ./Build
61
62 %{?with_tests:./Build test}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66
67 ./Build install
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %files
73 %defattr(644,root,root,755)
74 %doc Changes README.md
75 %attr(755,root,root) %{_bindir}/start_server
76 %{_mandir}/man1/start_server.1p*
77 %dir %{perl_vendorlib}/Server/Starter
78 %{perl_vendorlib}/Server/Starter/Guard.pm
79 %{perl_vendorlib}/Server/*.pm
80 %{_mandir}/man3/*
This page took 0.120469 seconds and 4 git commands to generate.