debian/0000755000000000000000000000000011554314036007170 5ustar debian/control0000644000000000000000000000243711554313675010611 0ustar Source: libhttp-server-simple-perl Section: perl Priority: optional Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: perl, netbase, libtest-pod-perl, libtest-pod-coverage-perl Maintainer: Debian Perl Group Uploaders: Niko Tyni , Krzysztof Krzyzaniak (eloy) , Jonathan Yu , gregor herrmann , Martín Ferrari , Nicholas Bamber , Jose Luis Rivas , Ansgar Burchardt , Christine Spang Standards-Version: 3.9.2 Homepage: http://search.cpan.org/dist/HTTP-Server-Simple/ Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-server-simple-perl/ Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libhttp-server-simple-perl/ Package: libhttp-server-simple-perl Architecture: all Depends: ${perl:Depends}, ${misc:Depends} Description: simple stand-alone HTTP server HTTP::Server::Simple is a simple standalone HTTP server. By default, it does not thread or fork. It does, however, act as a simple frontend which can be used to build a standalone web-based application or turn a CGI into one. (It is possible to use Net::Server to get threading, forking, preforking, etc.) debian/copyright0000644000000000000000000000334611554313661011134 0ustar Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Maintainer: Jesse Vincent Source: http://search.cpan.org/dist/HTTP-Server-Simple/ Name: HTTP-Server-Simple Files: * Copyright: 2004-2008, Jesse Vincent License: Artistic or GPL-1+ Files: inc/Module/* Copyright: 2002-2010, Adam Kennedy 2002-2010, Audrey Tang 2002-2010, Brian Ingerson License: Artistic or GPL-1+ Files: debian/* Copyright: 2005, Chip Salzenberg 2006-2007, Krzysztof Krzyzaniak (eloy) 2006, Don Armstrong 2006, Niko Tyni 2008-2009, Ansgar Burchardt 2008, Jose Luis Rivas 2008, Martín Ferrari 2008, Roberto C. Sanchez 2009-2010, Jonathan Yu 2009, Christine Spang 2006-2010, gregor herrmann 2011, Nicholas Bamber License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. debian/watch0000644000000000000000000000020011212456152010206 0ustar version=3 http://search.cpan.org/dist/HTTP-Server-Simple/ \ .*/HTTP-Server-Simple-v?(\d[\d.]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip) debian/libhttp-server-simple-perl.examples0000644000000000000000000000002111067267057016133 0ustar ex/sample_server debian/patches/0000755000000000000000000000000011554314036010617 5ustar debian/patches/0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch0000644000000000000000000000447711554313472023376 0ustar Author: Niko Tyni Subject: Pipe version: parent waits for the child to say "OK" via a pipe Forwarded: http://rt.cpan.org/Public/Bug/Display.html?id=28122 Bug: http://rt.cpan.org/Public/Bug/Display.html?id=28122 Bug-Debian: #439724, #477227 Last-Update: 2011-04-22 Reviewed-by: Nicholas Bamber --- a/lib/HTTP/Server/Simple.pm +++ b/lib/HTTP/Server/Simple.pm @@ -5,6 +5,7 @@ use FileHandle; use Socket; use Carp; +use IO::Select; use vars qw($VERSION $bad_request_doc); $VERSION = '0.44'; @@ -205,9 +206,30 @@ sub background { my $self = shift; + + # set up a pipe so the child can tell the parent when it's ready + # to accept requests + my ($readfh, $writefh) = FileHandle::pipe; + my $child = fork; croak "Can't fork: $!" unless defined($child); - return $child if $child; + + if ($child) { # parent + my $s = IO::Select->new; + $s->add($readfh); + my $now = time; my $left = 0; + my @ready; + while(not @ready and $left < 5) { + @ready = $s->can_read($left); + $left = time - $now; + } + die("child unresponsive for 5 seconds") if(not @ready); + my $response = <$readfh>; + chomp $response; + die("child is confused: answer '$response' != 'OK'") + if $response ne "OK"; + return $child; + } srand(); # after a fork, we need to reset the random seed # or we'll get the same numbers in both branches @@ -216,6 +238,8 @@ POSIX::setsid() or croak "Can't start a new session: $!"; } + + $self->{_parent_handle} = $writefh; $self->run(@_); # should never return exit; # just to be sure } @@ -265,6 +289,7 @@ $self->after_setup_listener(); *{"$pkg\::run"} = $self->_default_run; } + $self->_maybe_tell_parent(); local $SIG{HUP} = sub { $SERVER_SHOULD_RUN = 0; }; @@ -403,6 +428,16 @@ } } +sub _maybe_tell_parent { + # inform the parent process that we're ready, if applicable + my $self = shift; + my $handle = $self->{_parent_handle}; + return if !$handle; + print $handle "OK\n"; + close $handle; + delete $self->{_parent_handle}; +} + =head2 stdio_handle [FILEHANDLE] When called with an argument, sets the socket to the server to that arg. debian/patches/series0000644000000000000000000000007511130236333012027 0ustar 0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch debian/compat0000644000000000000000000000000211337524150010365 0ustar 7 debian/changelog0000644000000000000000000002173711554313641011055 0ustar libhttp-server-simple-perl (0.44-1) unstable; urgency=low [ Ansgar Burchardt ] * Email change: Ansgar Burchardt -> ansgar@debian.org [ Nicholas Bamber ] * Added myseld to Uploaders * New upstream release * Upped standards version to 3.9.2 and reviewed dependencies * Refreshed patch * Fixed permissions on example server script * Refreshed copyright [ gregor herrmann ] * Email change: Jose Luis Rivas -> ghostbar@debian.org -- Nicholas Bamber Fri, 22 Apr 2011 15:54:12 +0100 libhttp-server-simple-perl (0.43-1) unstable; urgency=low [ Jonathan Yu ] * New upstream release * Refresh Pipe handling patch * Remove old Signal patch (no longer applies, patch was missing from series file, and similar functionality seems to have been added in version 0.28 or so) [ gregor herrmann ] * debian/copyright: update years of copyright for inc/Module/*. -- Jonathan Yu Sun, 02 May 2010 10:30:15 -0400 libhttp-server-simple-perl (0.42-1) unstable; urgency=low [ Jonathan Yu ] * New upstream release * Standards-Version 3.8.4 (no changes) [ gregor herrmann ] * Refresh patch. * Convert to source format 3.0 (quilt). Remove quilt framework. * Remove build and runtime dependency on liburi-perl. * Refresh debian/copyright formatting. -- gregor herrmann Sun, 28 Mar 2010 15:21:47 +0200 libhttp-server-simple-perl (0.41-1) unstable; urgency=low [ Jonathan Yu ] * New upstream release * Added myself to Uploaders and Copyright * Standards-Version 3.8.3 (no changes) * Use new short debhelper rules format * Added a line to deal with shebang lines * Refresh quilt patch [ gregor herrmann ] * Change my email address. -- Jonathan Yu Tue, 29 Sep 2009 19:27:18 -0400 libhttp-server-simple-perl (0.40-1) unstable; urgency=low [ Nathan Handler ] * debian/watch: Update to ignore development releases. [ Christine Spang ] * New upstream release + win32 fixes + Specify an HTTP version for our GETs should get escaping to work + After a fork, we need to reset the random seed lest we have duplicated random numbers in both forks. * Bump to Standards-Version 3.8.2 * Drop versioning in perl dependency; perl in oldstable meets the requirement. * Add myself to Uploaders * Refresh 0002-Pipe-version-parent-waits-for-the-child-to-say-OK.patch -- Christine Spang Tue, 18 Aug 2009 10:29:39 -0400 libhttp-server-simple-perl (0.38-1) unstable; urgency=low * New upstream release. -- Ansgar Burchardt Mon, 12 Jan 2009 14:30:17 +0100 libhttp-server-simple-perl (0.37-1) unstable; urgency=low * New upstream release. + Refresh patches. + Drop 0001-Un-TODO-tests.patch: changed upstream. -- Ansgar Burchardt Sun, 04 Jan 2009 12:16:55 +0100 libhttp-server-simple-perl (0.36-1) unstable; urgency=low [ Ansgar Burchardt ] * debian/copyright: Replace with spaces * New upstream release. + Refresh patches. [ gregor herrmann ] * debian/control: Changed: Switched Vcs-Browser field to ViewSVN (source stanza). -- Ansgar Burchardt Mon, 24 Nov 2008 12:39:36 +0100 libhttp-server-simple-perl (0.35-1) unstable; urgency=low * New upstream release. + Refresh patches * Refresh debian/rules for debhelper 7 * Add myself to Uploaders. * Replace debian/README.source with slightly longer version * debian/copyright: Update to rev. 228 of proposed format * debian/copyright: do not list Debian Perl Group as copyright holder, instead list all contributors (taken from debian/changelog) -- Ansgar Burchardt Sat, 27 Sep 2008 01:13:09 +0200 libhttp-server-simple-perl (0.34-1) unstable; urgency=low [ Jose Luis Rivas ] * New upstream release * debian/control: + Bumped to Standards-Version 3.8.0, no further changes needed * Added me as co-maintainer [ gregor herrmann ] * Add debian/README.source for compliance with Policy 3.8.0. * debian/rules: remove obsolete source and diff targets, add install to .PHONY. * Refresh patches. * debian/control: change my email address. -- Jose Luis Rivas Sun, 29 Jun 2008 00:27:46 -0430 libhttp-server-simple-perl (0.33-2) unstable; urgency=low * Try again with the patch: make provisions for interrupted select() call to be manually restarted. -- Martín Ferrari Mon, 12 May 2008 01:50:02 -0300 libhttp-server-simple-perl (0.33-1) unstable; urgency=low [ gregor herrmann ] * Use newer patch for the background() problem (cf. #439724), also written by Niko Tyni (taken from CPAN#28122) -- closes: #477227. * debian/control: - small fixes - add missing dependency on liburi-perl [ Martín Ferrari ] * debian/control: updated my mail address. * debian/patches: remove old patches as they are the same as the newer 000* patches. * New upstream release 0.33. * debian/patches: refresh patches to new code, remove 0001-add-testcase-for-CPAN-28122.patch as it was already added upstream, added new 0001-Un-TODO-tests.patch to make the upstream tests fail harder. -- Martín Ferrari Sun, 04 May 2008 19:07:14 -0300 libhttp-server-simple-perl (0.31-1) unstable; urgency=low * New upstream release. * Adjust and refresh patches. * debian/control: make the build dependency on quilt versioned. * debian/rules: don't install (almost empty) README anymore. -- gregor herrmann Tue, 18 Mar 2008 04:58:22 +0100 libhttp-server-simple-perl (0.30-1) unstable; urgency=low * New upstream release. * debian/rules: cleaned some unuseful stuff, moved tests to build, add quilt support. * debian/copyright: added obligatory © symbol. * debian/control: add quilt B-D, add myself to Uploaders. * debian/patches: add Niko Tyni patch that properly closes: #439724, as upstream hasn't solved it (CPAN#28122) in the new release. -- Martín Ferrari Sat, 15 Mar 2008 04:43:39 -0200 libhttp-server-simple-perl (0.29-1) unstable; urgency=low * New upstream release. * debian/copyright: - update years of copyright - add copyright information about packaging - add upstream source location - convert to new format * Add /me to Uploaders. -- gregor herrmann Sun, 17 Feb 2008 02:41:58 +0100 libhttp-server-simple-perl (0.28-1) unstable; urgency=low [ gregor herrmann ] * New upstream release. * debian/control: - add Vcs-Svn field (source stanza); Vcs-Browser field (source stanza); Homepage field (source stanza). - remove XS-Vcs-Svn fields - wrap long lines * Set Standards-Version to 3.7.3 (no changes needed). * Set debhelper compatibility level to 6. * debian/watch: use dist-based URL. * debian/rules: - delete /usr/lib/perl5 only if it exists - move dh_clean before make distclean - let install-stamp target depend on build-stamp - remove OPTIMIZE, this package is architecture-independent - install example script - remove unused/unneeded/commented out dh_* calls - remove some comments and empty lines -- Roberto C. Sanchez Mon, 21 Jan 2008 14:09:56 -0500 libhttp-server-simple-perl (0.27-1) unstable; urgency=low * New upstream release -- Krzysztof Krzyzaniak (eloy) Fri, 13 Apr 2007 10:49:47 +0200 libhttp-server-simple-perl (0.26-1) unstable; urgency=low * New upstream release * debian/control: + Added me to uploaders -- Krzysztof Krzyzaniak (eloy) Tue, 28 Nov 2006 16:57:07 +0100 libhttp-server-simple-perl (0.24-1) unstable; urgency=low * New upstream release. * Add liburi-perl to build dependencies. -- gregor herrmann Sun, 19 Nov 2006 19:50:13 +0100 libhttp-server-simple-perl (0.20-1) unstable; urgency=low * New upstream release. * Set Standards-Version to 3.7.2 (no changes). * Set Debhelper Compatibility Level to 5. -- gregor herrmann Sat, 17 Jun 2006 16:35:50 +0200 libhttp-server-simple-perl (0.18-1) unstable; urgency=low * New upstream release. * Adopted for the Debian Perl Group. (Closes: #357078) * Acknowledge the previous NMU. (Closes: #329558, #304093) * Don't ignore the return value of 'make distclean' * Upgrade to Standards-Version 3.6.2. No changes needed. * Fixed debian/watch. -- Niko Tyni Sat, 18 Mar 2006 00:47:38 +0200 libhttp-server-simple-perl (0.16-0.1) unstable; urgency=low * NMU (blessed by maintainer) * New upstream release (Closes: #329558) * Add Build-Depends-Indep on netbase (Closes: #304093) * Add libtest-pod-perl and libtest-pod-coverage-perl to enable the rest of the tests to run -- Don Armstrong Thu, 5 Jan 2006 02:30:15 -0800 libhttp-server-simple-perl (0.04-1) unstable; urgency=low * Initial Release. -- Chip Salzenberg Fri, 8 Apr 2005 17:26:09 -0400 debian/source/0000755000000000000000000000000011554314036010470 5ustar debian/source/format0000644000000000000000000000001411353653027011701 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000051611554313035010250 0ustar #!/usr/bin/make -f PACKAGE = $(shell dh_listpackages) TMP = $(CURDIR)/debian/$(PACKAGE) %: dh $@ override_dh_installexamples: dh_installexamples sed -i '1s|^#!perl|#!/usr/bin/perl|' $(TMP)/usr/share/doc/libhttp-server-simple-perl/examples/* chmod a+x $(TMP)/usr/share/doc/libhttp-server-simple-perl/examples/sample_server