CatalystX-Restarter-GTK/0000700000175000017500000000000012114673140014633 5ustar dhavaldhavalCatalystX-Restarter-GTK/gitignore0000600000175000017500000000014012033752677016557 0ustar dhavaldhavalcover_db META.yml Makefile blib inc pm_to_blib MANIFEST Makefile.old CatalystX-Restarter-GTK-* CatalystX-Restarter-GTK/Makefile.PL0000664000175000017500000000107512114670251016624 0ustar dhavaldhavaluse strict; use warnings; use inc::Module::Install 0.91; name 'CatalystX-Restarter-GTK'; all_from 'lib/CatalystX/Restarter/GTK.pm'; requires 'Moose'; requires 'MooseX::Types'; requires 'namespace::autoclean'; requires 'Catalyst::Runtime' => '5.80032'; requires 'Catalyst::Devel'; requires 'Try::Tiny'; requires 'Object::Destroyer'; requires 'AnyEvent'; requires 'Gtk2'; requires 'IPC::SysV'; requires 'IO::Handle'; build_requires 'Test::More' => '0.88'; resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/CatalystX-Restarter-GTK/trunk'; WriteAll(); CatalystX-Restarter-GTK/inc/0000755000175000017500000000000012114671441015420 5ustar dhavaldhavalCatalystX-Restarter-GTK/inc/Module/0000755000175000017500000000000012114671441016645 5ustar dhavaldhavalCatalystX-Restarter-GTK/inc/Module/Install.pm0000644000175000017500000003013512114671441020613 0ustar dhavaldhaval#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.005; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.06'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::cwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::cwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split //, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version ($) { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp ($$) { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS ($) { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. CatalystX-Restarter-GTK/inc/Module/Install/0000755000175000017500000000000012114671441020253 5ustar dhavaldhavalCatalystX-Restarter-GTK/inc/Module/Install/Fetch.pm0000644000175000017500000000462712114671441021653 0ustar dhavaldhaval#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; CatalystX-Restarter-GTK/inc/Module/Install/Can.pm0000644000175000017500000000615712114671441021323 0ustar dhavaldhaval#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 236 CatalystX-Restarter-GTK/inc/Module/Install/Makefile.pm0000644000175000017500000002743712114671441022343 0ustar dhavaldhaval#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-seperated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 CatalystX-Restarter-GTK/inc/Module/Install/Metadata.pm0000644000175000017500000004327712114671441022346 0ustar dhavaldhaval#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) \s* ; /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashs delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; CatalystX-Restarter-GTK/inc/Module/Install/Win32.pm0000644000175000017500000000340312114671441021513 0ustar dhavaldhaval#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; CatalystX-Restarter-GTK/inc/Module/Install/Base.pm0000644000175000017500000000214712114671441021467 0ustar dhavaldhaval#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.06'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 CatalystX-Restarter-GTK/inc/Module/Install/WriteAll.pm0000644000175000017500000000237612114671441022344 0ustar dhavaldhaval#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.06'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; CatalystX-Restarter-GTK/inc/.author/0000755000175000017500000000000012114671441017000 5ustar dhavaldhavalCatalystX-Restarter-GTK/MYMETA.json0000644000175000017500000000244612114671441016544 0ustar dhavaldhaval{ "abstract" : "GTK based Catalyst server restarter.", "author" : [ "Dhaval Dhanani L" ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "CatalystX-Restarter-GTK", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "6.59", "Test::More" : "0.88" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "AnyEvent" : "0", "Catalyst::Devel" : "0", "Catalyst::Runtime" : "5.80032", "Gtk2" : "0", "IO::Handle" : "0", "IPC::SysV" : "0", "Moose" : "0", "MooseX::Types" : "0", "Object::Destroyer" : "0", "Try::Tiny" : "0", "namespace::autoclean" : "0", "perl" : "5.008" } } }, "release_status" : "stable", "version" : "0.06" } CatalystX-Restarter-GTK/Changes0000600000175000017500000000000012033752677016133 0ustar dhavaldhavalCatalystX-Restarter-GTK/MANIFEST.SKIP0000600000175000017500000000017212033752677016550 0ustar dhavaldhaval.git/ blib pm_to_blib MANIFEST.bak MANIFEST.SKIP~ cover_db Makefile$ Makefile.old$ ^CatalystX-Restarter-GTK- ^.gitignore CatalystX-Restarter-GTK/README0000600000175000017500000000313212033752677015531 0ustar dhavaldhavalNAME CatalystX::Restarter::GTK - GTK based Catalyst server restarter. SYNOPSIS Set environment variable CATALYST_RESTARTER to CatalystX::Restarter::GTK. Then start server with -r (auto restart on file changes) option. export CATALYST_RESTARTER=CatalystX::Restarter::GTK perl script/myapp_server -r You can also create a shell script and add a shortcut to panel. This avoids need of starting terminal. #!/bin/bash cd /home/username/myapp/trunk/ perl script/myapp_server.pl -r To use this restarter for specific application only, set appropirate envioronment variable. MYAPP_RESTARTER=CatalystX::Restarter::GTK DESCRIPTION This module provides GUI interface for controlling Catalyst server and viewing console output generated. It captures both STDOUT and STDERR. It shows a very small GUI window on desktop. It is set always on to by default. You can drag window to any screen corner for convenience. The window displays server status. User can view console output and manually restart server from menu. Whenever any file of project is updated, developer can immediately check server status without switching to console. NOTES This module extends Catalyst::Restarter and depends on its _watcher and _handle_events. AUTHOR Dhaval Dhanani LICENCE This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. COPYRIGHT This library is copyright (c) 2011 the above named AUTHOR and CONSTRIBUTOR(s). CatalystX-Restarter-GTK/t/0000700000175000017500000000000012114673167015107 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/live-test.t0000600000175000017500000000070112033752700017177 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use Test::More; # setup library path use FindBin qw($Bin); use lib "$Bin/lib"; # make sure testapp works use ok 'TestApp'; # a live test against TestApp, the test application use Test::WWW::Mechanize::Catalyst 'TestApp'; my $mech = Test::WWW::Mechanize::Catalyst->new; $mech->get_ok('http://localhost/', 'get main page'); $mech->content_like(qr/it works/i, 'see if it has our text'); done_testing; CatalystX-Restarter-GTK/t/00-load.t0000600000175000017500000000016212033752700016420 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use Test::More; use_ok 'CatalystX::Restarter::GTK'; done_testing; CatalystX-Restarter-GTK/t/lib/0000700000175000017500000000000012114673167015655 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/lib/Makefile.PL0000600000175000017500000000000012033752703017611 0ustar dhavaldhavalCatalystX-Restarter-GTK/t/lib/TestApp.pm0000600000175000017500000000016312033752703017567 0ustar dhavaldhavalpackage TestApp; use Moose; use namespace::autoclean; use Catalyst; extends 'Catalyst'; __PACKAGE__->setup; 1; CatalystX-Restarter-GTK/t/lib/script/0000700000175000017500000000000012114673167017161 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/lib/script/testapp_test.pl0000600000175000017500000000024512033752705022234 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use FindBin; use lib "$FindBin::Bin/.."; use Catalyst::Test 'TestApp'; print request($ARGV[0])->content . "\n"; 1; CatalystX-Restarter-GTK/t/lib/script/testapp_server.pl0000600000175000017500000000022612033752705022562 0ustar dhavaldhaval#!/usr/bin/env perl BEGIN { $ENV{CATALYST_SCRIPT_GEN} = 40; } use Catalyst::ScriptRunner; Catalyst::ScriptRunner->run('TestApp', 'Server'); 1; CatalystX-Restarter-GTK/t/lib/TestApp/0000700000175000017500000000000012114673167017235 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/lib/TestApp/Controller/0000700000175000017500000000000012114673167021360 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/lib/TestApp/Controller/Root.pm0000600000175000017500000000062012033752711022632 0ustar dhavaldhavalpackage TestApp::Controller::Root; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller' } __PACKAGE__->config(namespace => q{}); sub base : Chained('/') PathPart('') CaptureArgs(0) {} # your actions replace this one sub main : Chained('base') PathPart('') Args(0) { my ($self, $ctx) = @_; $ctx->res->body('

It works

'); } __PACKAGE__->meta->make_immutable; CatalystX-Restarter-GTK/t/00-basic.t0000600000175000017500000000153212033752700016564 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use Test::More; use_ok 'CatalystX::Restarter::GTK'; use_ok 'Catalyst', '5.80032'; use_ok 'MooseX::Types::Moose'; use_ok 'Try::Tiny'; use_ok 'POSIX'; use_ok 'IPC::Semaphore'; use_ok 'IPC::SysV'; use_ok 'Object::Destroyer'; use_ok 'Carp'; use_ok 'Socket'; use_ok 'IO::Handle'; use_ok 'AnyEvent::Socket'; use_ok 'Catalyst::Restarter'; use_ok 'Gtk2'; use_ok 'Glib'; ok($^O ne 'MSWin32', 'Linux required'); use Catalyst::Restarter; can_ok('Catalyst::Restarter', '_handle_events'); ok(Catalyst::Restarter->meta->has_attribute('_watcher')); use Socket qw(AF_UNIX SOCK_STREAM); ok(socketpair(my $parent, my $child, AF_UNIX, SOCK_STREAM, 0)); my $restarter = Catalyst::Restarter->new(start_sub => sub {}, argv => []); can_ok($restarter->_watcher, 'new_events'); $restarter = undef; done_testing; CatalystX-Restarter-GTK/t/author/0000700000175000017500000000000012114673167016411 5ustar dhavaldhavalCatalystX-Restarter-GTK/t/author/pod.t0000600000175000017500000000014712033752703017356 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Pod 1.14; all_pod_files_ok(); CatalystX-Restarter-GTK/t/author/pod-coverage.t0000600000175000017500000000016412033752703021146 0ustar dhavaldhaval#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Pod::Coverage 1.04; all_pod_coverage_ok(); CatalystX-Restarter-GTK/Makefile0000644000175000017500000006053312114671441016316 0ustar dhavaldhaval# This Makefile is for the CatalystX::Restarter::GTK extension to perl. # # It was generated automatically by MakeMaker version # 6.62 (Revision: 66200) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # ABSTRACT => q[GTK based Catalyst server restarter.] # AUTHOR => [q[Dhaval Dhanani L]] # BUILD_REQUIRES => { Test::More=>q[0.88], ExtUtils::MakeMaker=>q[6.59] } # CONFIGURE_REQUIRES => { } # DISTNAME => q[CatalystX-Restarter-GTK] # LICENSE => q[perl] # MIN_PERL_VERSION => q[5.008] # NAME => q[CatalystX::Restarter::GTK] # NO_META => q[1] # PREREQ_PM => { Try::Tiny=>q[0], namespace::autoclean=>q[0], AnyEvent=>q[0], ExtUtils::MakeMaker=>q[6.59], Catalyst::Devel=>q[0], IO::Handle=>q[0], Test::More=>q[0.88], Object::Destroyer=>q[0], MooseX::Types=>q[0], IPC::SysV=>q[0], Catalyst::Runtime=>q[5.80032], Gtk2=>q[0], Moose=>q[0] } # VERSION => q[0.06] # VERSION_FROM => q[lib/CatalystX/Restarter/GTK.pm] # dist => { PREOP=>q[$(PERL) -I. "-MModule::Install::Admin" -e "dist_preop(q($(DISTVNAME)))"] } # realclean => { FILES=>q[MYMETA.yml] } # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /usr/lib/perl/5.14/Config.pm). # They may have been overridden via Makefile.PL or on the command line. AR = ar CC = cc CCCDLFLAGS = -fPIC CCDLFLAGS = -Wl,-E DLEXT = so DLSRC = dl_dlopen.xs EXE_EXT = FULL_AR = /usr/bin/ar LD = cc LDDLFLAGS = -shared -O2 -g -L/usr/local/lib -fstack-protector LDFLAGS = -fstack-protector -L/usr/local/lib LIBC = LIB_EXT = .a OBJ_EXT = .o OSNAME = linux OSVERS = 2.6.42-23-generic RANLIB = : SITELIBEXP = /usr/local/share/perl/5.14.2 SITEARCHEXP = /usr/local/lib/perl/5.14.2 SO = so VENDORARCHEXP = /usr/lib/perl5 VENDORLIBEXP = /usr/share/perl5 # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = / DFSEP = $(DIRFILESEP) NAME = CatalystX::Restarter::GTK NAME_SYM = CatalystX_Restarter_GTK VERSION = 0.06 VERSION_MACRO = VERSION VERSION_SYM = 0_06 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 0.06 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = blib/arch INST_SCRIPT = blib/script INST_BIN = blib/bin INST_LIB = blib/lib INST_MAN1DIR = blib/man1 INST_MAN3DIR = blib/man3 MAN1EXT = 1p MAN3EXT = 3pm INSTALLDIRS = site DESTDIR = PREFIX = $(SITEPREFIX) PERLPREFIX = /usr SITEPREFIX = /usr/local VENDORPREFIX = /usr INSTALLPRIVLIB = /usr/share/perl/5.14 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /usr/local/share/perl/5.14.2 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /usr/share/perl5 DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /usr/lib/perl/5.14 DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /usr/local/lib/perl/5.14.2 DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /usr/lib/perl5 DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/local/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLSITESCRIPT = /usr/local/bin DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) INSTALLVENDORSCRIPT = /usr/bin DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/local/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/local/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = PERL_ARCHLIB = /usr/lib/perl/5.14 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKEFILE_OLD = Makefile.old MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /usr/lib/perl/5.14/CORE PERL = /usr/bin/perl "-Iinc" FULLPERL = /usr/bin/perl "-Iinc" ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-Iinc" "-I$(INST_LIB)" PERL_CORE = 0 PERM_DIR = 755 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = /usr/share/perl/5.14/ExtUtils/MakeMaker.pm MM_VERSION = 6.62 MM_REVISION = 66200 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. MAKE = make FULLEXT = CatalystX/Restarter/GTK BASEEXT = GTK PARENT_NAME = CatalystX::Restarter DLBASE = $(BASEEXT) VERSION_FROM = lib/CatalystX/Restarter/GTK.pm OBJECT = LDFROM = $(OBJECT) LINKTYPE = dynamic BOOTDEP = # Handy lists of source code files: XS_FILES = C_FILES = O_FILES = H_FILES = MAN1PODS = MAN3PODS = lib/CatalystX/Restarter/GTK.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)/CatalystX/Restarter INST_ARCHLIBDIR = $(INST_ARCHLIB)/CatalystX/Restarter INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = INST_DYNAMIC = INST_BOOT = # Extra linker info EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVE_AFTER = TO_INST_PM = lib/CatalystX/Restarter/GTK.pm \ lib/CatalystX/Restarter/started.png \ lib/CatalystX/Restarter/starting.png \ lib/CatalystX/Restarter/stopped.png PM_TO_BLIB = lib/CatalystX/Restarter/GTK.pm \ blib/lib/CatalystX/Restarter/GTK.pm \ lib/CatalystX/Restarter/stopped.png \ blib/lib/CatalystX/Restarter/stopped.png \ lib/CatalystX/Restarter/starting.png \ blib/lib/CatalystX/Restarter/starting.png \ lib/CatalystX/Restarter/started.png \ blib/lib/CatalystX/Restarter/started.png # --- MakeMaker platform_constants section: MM_Unix_VERSION = 6.62 PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' -- # --- MakeMaker tool_xsubpp section: # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp MV = mv NOOP = $(TRUE) NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- FALSE = false TRUE = true ECHO = echo ECHO_N = echo -n UNINST = 0 VERBINST = 0 MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- MACROSTART = MACROEND = USEMAKEFILE = -f FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- # --- MakeMaker makemakerdflt section: makemakerdflt : all $(NOECHO) $(NOOP) # --- MakeMaker dist section: TAR = tar TARFLAGS = cvf ZIP = zip ZIPFLAGS = -r COMPRESS = gzip --best SUFFIX = .gz SHAR = shar PREOP = $(PERL) -I. "-MModule::Install::Admin" -e "dist_preop(q($(DISTVNAME)))" POSTOP = $(NOECHO) $(NOOP) TO_UNIX = $(NOECHO) $(NOOP) CI = ci -u RCS_LABEL = rcs -Nv$(VERSION_SYM): -q DIST_CP = best DIST_DEFAULT = tardist DISTNAME = CatalystX-Restarter-GTK DISTVNAME = CatalystX-Restarter-GTK-0.06 # --- MakeMaker macro section: # --- MakeMaker depend section: # --- MakeMaker cflags section: # --- MakeMaker const_loadlibs section: # --- MakeMaker const_cccmd section: # --- MakeMaker post_constants section: # --- MakeMaker pasthru section: PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ PREFIX="$(PREFIX)" # --- MakeMaker special_targets section: .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir # --- MakeMaker c_o section: # --- MakeMaker xs_c section: # --- MakeMaker xs_o section: # --- MakeMaker top_targets section: all :: pure_all manifypods $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs $(NOECHO) $(NOOP) help : perldoc ExtUtils::MakeMaker # --- MakeMaker blibdirs section: blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists $(NOECHO) $(NOOP) # Backwards compat with 6.18 through 6.25 blibdirs.ts : blibdirs $(NOECHO) $(NOOP) $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHLIB) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_BIN) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_SCRIPT) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN1DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists # --- MakeMaker linkext section: linkext :: $(LINKTYPE) $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_bs section: BOOTSTRAP = # --- MakeMaker dynamic_lib section: # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all \ lib/CatalystX/Restarter/GTK.pm $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \ lib/CatalystX/Restarter/GTK.pm $(INST_MAN3DIR)/CatalystX::Restarter::GTK.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # none # --- MakeMaker clean_subdirs section: clean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs - $(RM_F) \ *$(LIB_EXT) core \ core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \ core.[0-9][0-9] $(BASEEXT).bso \ pm_to_blib.ts MYMETA.json \ core.[0-9][0-9][0-9][0-9] MYMETA.yml \ $(BASEEXT).x $(BOOTSTRAP) \ perl$(EXE_EXT) tmon.out \ *$(OBJ_EXT) pm_to_blib \ $(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \ core.[0-9][0-9][0-9][0-9][0-9] *perl.core \ core.*perl.*.? $(MAKE_APERL_FILE) \ $(BASEEXT).def perl \ core.[0-9][0-9][0-9] mon.out \ lib$(BASEEXT).def perlmain.c \ perl.exe so_locations \ $(BASEEXT).exp - $(RM_RF) \ blib - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) # --- MakeMaker realclean_subdirs section: realclean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete dist files realclean purge :: clean realclean_subdirs - $(RM_F) \ $(MAKEFILE_OLD) $(FIRST_MAKEFILE) - $(RM_RF) \ MYMETA.yml $(DISTVNAME) # --- MakeMaker metafile section: metafile : $(NOECHO) $(NOOP) # --- MakeMaker signature section: signature : cpansign -s # --- MakeMaker dist_basics section: distclean :: realclean distcheck $(NOECHO) $(NOOP) distcheck : $(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck skipcheck : $(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck manifest : $(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest veryclean : realclean $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old # --- MakeMaker dist_core section: dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) $(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' -- tardist : $(DISTVNAME).tar$(SUFFIX) $(NOECHO) $(NOOP) uutardist : $(DISTVNAME).tar$(SUFFIX) uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu $(DISTVNAME).tar$(SUFFIX) : distdir $(PREOP) $(TO_UNIX) $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(COMPRESS) $(DISTVNAME).tar $(POSTOP) zipdist : $(DISTVNAME).zip $(NOECHO) $(NOOP) $(DISTVNAME).zip : distdir $(PREOP) $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(POSTOP) shdist : distdir $(PREOP) $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar $(RM_RF) $(DISTVNAME) $(POSTOP) # --- MakeMaker distdir section: create_distdir : $(RM_RF) $(DISTVNAME) $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" distdir : create_distdir $(NOECHO) $(NOOP) # --- MakeMaker dist_test section: disttest : distdir cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL cd $(DISTVNAME) && $(MAKE) $(PASTHRU) cd $(DISTVNAME) && $(MAKE) test $(PASTHRU) # --- MakeMaker dist_ci section: ci : $(PERLRUN) "-MExtUtils::Manifest=maniread" \ -e "@all = keys %{ maniread() };" \ -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" # --- MakeMaker distmeta section: distmeta : create_distdir metafile $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' -- $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ -e ' or print "Could not add META.json to MANIFEST: $${'\''@'\''}\n"' -- # --- MakeMaker distsignature section: distsignature : create_distdir $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) } ' \ -e ' or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"' -- $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE cd $(DISTVNAME) && cpansign -s # --- MakeMaker install section: install :: pure_install doc_install $(NOECHO) $(NOOP) install_perl :: pure_perl_install doc_perl_install $(NOECHO) $(NOOP) install_site :: pure_site_install doc_site_install $(NOECHO) $(NOOP) install_vendor :: pure_vendor_install doc_vendor_install $(NOECHO) $(NOOP) pure_install :: pure_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) doc_install :: doc_$(INSTALLDIRS)_install $(NOECHO) $(NOOP) pure__install : pure_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site doc__install : doc_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_perl_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLPRIVLIB) \ $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ $(INST_BIN) $(DESTINSTALLBIN) \ $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(SITEARCHEXP)/auto/$(FULLEXT) pure_site_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLSITELIB) \ $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ $(INST_BIN) $(DESTINSTALLSITEBIN) \ $(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(PERL_ARCHLIB)/auto/$(FULLEXT) pure_vendor_install :: all $(NOECHO) $(MOD_INSTALL) \ read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \ write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \ $(INST_LIB) $(DESTINSTALLVENDORLIB) \ $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ $(INST_BIN) $(DESTINSTALLVENDORBIN) \ $(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \ $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) doc_perl_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLPRIVLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod doc_site_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod doc_vendor_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLVENDORLIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ >> $(DESTINSTALLARCHLIB)/perllocal.pod uninstall :: uninstall_from_$(INSTALLDIRS)dirs $(NOECHO) $(NOOP) uninstall_from_perldirs :: $(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist uninstall_from_sitedirs :: $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist uninstall_from_vendordirs :: $(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE : $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: # --- MakeMaker makefile section: # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" $(FALSE) # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = perl FULLPERL = /usr/bin/perl $(MAP_TARGET) :: static $(MAKE_APERL_FILE) $(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR= \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t/*.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) test :: $(TEST_TYPE) subdirs-test subdirs-test :: $(NOECHO) $(NOOP) test_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), 'inc', '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-Iinc" "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) test_ : test_dynamic test_static :: test_dynamic testdb_static :: testdb_dynamic # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd $(NOECHO) $(ECHO) ' GTK based Catalyst server restarter.' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' Dhaval Dhanani L<mailto:dhaval070@gmail.com>' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd # --- MakeMaker pm_to_blib section: pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ lib/CatalystX/Restarter/GTK.pm blib/lib/CatalystX/Restarter/GTK.pm \ lib/CatalystX/Restarter/stopped.png blib/lib/CatalystX/Restarter/stopped.png \ lib/CatalystX/Restarter/starting.png blib/lib/CatalystX/Restarter/starting.png \ lib/CatalystX/Restarter/started.png blib/lib/CatalystX/Restarter/started.png $(NOECHO) $(TOUCH) pm_to_blib # --- MakeMaker selfdocument section: # --- MakeMaker postamble section: # End. # Postamble by Module::Install 1.06 # --- Module::Install::Admin::Makefile section: realclean purge :: $(RM_F) $(DISTVNAME).tar$(SUFFIX) $(RM_F) MANIFEST.bak _build $(PERL) "-Ilib" "-MModule::Install::Admin" -e "remove_meta()" $(RM_RF) inc reset :: purge upload :: test dist cpan-upload -verbose $(DISTVNAME).tar$(SUFFIX) grok :: perldoc Module::Install distsign :: cpansign -s CatalystX-Restarter-GTK/META.yml0000644000175000017500000000153712114671441016126 0ustar dhavaldhaval--- abstract: 'GTK based Catalyst server restarter.' author: - 'Dhaval Dhanani L' build_requires: ExtUtils::MakeMaker: 6.59 Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 6.59 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.06' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: CatalystX-Restarter-GTK no_index: directory: - inc - t requires: AnyEvent: 0 Catalyst::Devel: 0 Catalyst::Runtime: 5.80032 Gtk2: 0 IO::Handle: 0 IPC::SysV: 0 Moose: 0 MooseX::Types: 0 Object::Destroyer: 0 Try::Tiny: 0 namespace::autoclean: 0 perl: 5.8.0 resources: license: http://dev.perl.org/licenses/ repository: http://dev.catalyst.perl.org/repos/Catalyst/CatalystX-Restarter-GTK/trunk version: 0.06 CatalystX-Restarter-GTK/lib/0000700000175000017500000000000012114673167015412 5ustar dhavaldhavalCatalystX-Restarter-GTK/lib/CatalystX/0000700000175000017500000000000012114673167017326 5ustar dhavaldhavalCatalystX-Restarter-GTK/lib/CatalystX/Restarter/0000700000175000017500000000000012114674535021301 5ustar dhavaldhavalCatalystX-Restarter-GTK/lib/CatalystX/Restarter/GTK.pm0000664000175000017500000003366712114674535022317 0ustar dhavaldhavalpackage CatalystX::Restarter::GTK; use v5.008; use Moose; use MooseX::Types::Moose qw(Int Str); use Try::Tiny qw(try catch); use POSIX qw(SIGUSR1 SIGUSR2 WNOHANG); use IPC::Semaphore qw(); use IPC::SysV qw(S_IRWXU IPC_PRIVATE IPC_CREAT); use Object::Destroyer qw(); use Carp qw(croak); use Socket qw(AF_UNIX SOCK_STREAM); use IO::Handle qw(); use namespace::autoclean; our $VERSION = '0.08'; extends 'Catalyst::Restarter'; sub pick_subclass { die "Win32 not supported" if ($^O eq 'MSWin32'); return __PACKAGE__; } # stores forked catalyst server's PID has _child => ( is => 'rw', isa => Int ); # stores forked gtk window process' PID has win_pid => ( is => 'rw', isa => Int, ); # Port number of catalyst server has port => ( is => 'rw', isa => Int, ); # name of catalyst application. has application_name => ( is => 'rw', isa => Str, ); # Socket for communication with window process has parent_sock => ( is => 'rw', ); # Pipe for retriving error messages from server process has srv_reader => ( is => 'rw' ); has auto_restart => ( is => 'rw', default => 1 ); has server_watcher => ( is => 'rw' ); sub start_server_watcher { my $self = shift; my $pid = shift; $self->_child($pid); # Detect server process termination. my $server_watcher = AnyEvent->child( pid => $self->_child, cb => sub { $self->notify_win('stopped'); $self->_child(0); } ); $self->server_watcher($server_watcher); } sub run_and_watch { my ($self) = @_; my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRWXU | IPC_CREAT) or croak "Can not create semaphore $!"; my $sentry = Object::Destroyer->new($sem, 'remove'); socketpair(my $parent_sock, my $win_sock, AF_UNIX, SOCK_STREAM, 0) or croak "socketpair failed: $!"; # Fork GUI process my $pid = fork; croak $! unless defined $pid; if ($pid) { close $win_sock; $parent_sock->autoflush(1); require AnyEvent; $self->win_pid($pid); $self->parent_sock($parent_sock); # Detect window process termination my $child_win = AnyEvent->child( pid => $self->win_pid, cb => sub { $self->win_pid(0); $self->_kill_child; exit; } ); # Handle USR1 (Restart signal) from window my $restart_watcher = AnyEvent->signal( signal => SIGUSR1, cb => sub { $self->_kill_child; $self->_fork_and_start; } ); if ($self->auto_restart) { my $timer = AnyEvent->timer( after => 1, interval => 1, cb => sub { if (my @events = $self->_watcher->new_events) { $self->_handle_events(@events); } } ); } # wait until window process sets up watchers. $sem->op(0, -1, 0); $sentry = undef; $self->_fork_and_start; # Wait for events infinitely. AnyEvent->condvar->recv; } else { $sentry->dismiss; close $parent_sock; $win_sock->autoflush(1); # Use event loop of Gtk2 by loading it first. require Gtk2; Gtk2->init; require AnyEvent::Socket; my $win = WinMonitor->new($self->application_name); $win->set_restart_handler(sub { kill SIGUSR1, getppid; }); my ($watcher, $start_timer); # Creates event watcher for checking socket readiness of forked server. $start_timer = sub { $watcher = AnyEvent->timer( after => 1, cb => sub { AnyEvent::Socket::tcp_connect('localhost', $self->port, sub { if (shift) { $watcher = undef; $win->set_status('started'); } else { # Restart timer upon failure $watcher = $start_timer->(); } }); } ); }; # SIGUSR1 - starting server my $usr1_watcher = AnyEvent->signal( signal => SIGUSR1, cb => sub { $win->clear_msg; $win->set_status('starting'); $win_sock->say('1'); $start_timer->(); } ); # SIGUSR2 - Server exited / killed my $usr2_watcher = AnyEvent->signal( signal => SIGUSR2, cb => sub { $win->set_status('stopped'); $watcher = undef; $win_sock->say('1'); } ); my $winsock_watcher = AnyEvent->io( fh => $win_sock, poll => 'r', cb => sub { # Unbuffered read from socket return unless sysread($win_sock, my $msg, 256, 0); $win->append_msg($msg); } ); $sem->op(0, 1, 0); main Gtk2; exit(0); } } # Sends server status signal to window process. { my %map = ('starting' => SIGUSR1, 'stopped' => SIGUSR2); sub notify_win { my ($self, $msg) = @_; return unless exists $map{$msg}; if ($self->win_pid) { kill $map{$msg}, $self->win_pid; # Wait until signal is handled. This is for synchronizing signals. $self->parent_sock->getline; } } } sub _fork_and_start { my $self = shift; pipe(my $reader, my $writer) or croak "$!"; my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRWXU | IPC_CREAT) or croak "failed to create semaphore $!"; my $sentry = Object::Destroyer->new($sem, 'remove'); my $pid = fork; return unless (defined $pid); if($pid) { close $writer; $self->start_server_watcher($pid); # Read console output from forked server and send to win proc $self->srv_reader(AnyEvent->io( fh => $reader, poll => 'r', cb => sub { if (my $bytes = sysread($reader, my $msg, 256, 0)) { syswrite($self->parent_sock, $msg, $bytes); } } )); $self->notify_win('starting'); $sentry->dismiss; $sem->op(0, 1, 0); } else { close $reader; $writer->autoflush(1); $sem->op(0, -1, 0); $sentry = undef; open (STDERR, '>&', $writer) or croak "Failed to dup STDERR $!"; open (STDOUT, '>&', $writer) or croak "Failed to dup STDOUT $!"; STDOUT->autoflush(1); try { $self->start_sub->(); } catch { STDERR->print($_); exit 1; }; } } sub _kill_child { my $self = shift; if ($self->_child) { kill 'INT', $self->_child; waitpid($self->_child, 0); $self->_child(0); $self->notify_win('stopped'); } } __PACKAGE__->meta->make_immutable; no Moose; #--- Class WinMonitor for GUI --- package WinMonitor; use strict; use warnings; use Gtk2; use Glib qw(TRUE FALSE); use Carp; my $path = __FILE__; $path =~ s/[^\/]+$//; my %status_msg = ( starting => { msg => 'Starting', color => Gtk2::Gdk::Color->new(0, 0, 0x55 * 257) }, started => { msg => 'Started', color => Gtk2::Gdk::Color->new(0, 0x55 * 257, 0) }, stopped => { msg => 'Stopped', color => Gtk2::Gdk::Color->new(0x55 * 257, 0, 0) }, ); $status_msg{$_}->{icon} = $path.$_.'.png' foreach (keys %status_msg); sub new { my ($class, $app_name) = @_; my $obj = {}; my $win = Gtk2::Window->new('toplevel'); $win->set_title($app_name); $win->set_keep_above(1); $win->set_position('center'); my $status = Gtk2::Label->new; my $menu_bar = Gtk2::MenuBar->new; my $view = Gtk2::MenuItem->new('_View'); my $mview = Gtk2::Menu->new; my $console = Gtk2::MenuItem->new('Console'); $console->signal_connect('activate', sub { $obj->show_msg; }); $mview->append($console); $view->set_submenu($mview); my $restart = Gtk2::MenuItem->new('Restart'); my $mrestart = Gtk2::Menu->new; $mrestart->append($restart); my $tools = Gtk2::MenuItem->new('_Tools'); $tools->set_submenu($mrestart); $menu_bar->append($view); $menu_bar->append($tools); $menu_bar->set_size_request(-1, 22); my $vbox = Gtk2::VBox->new(FALSE, 0); $vbox->pack_start($menu_bar, FALSE, FALSE, 0); my $hbox = Gtk2::HBox->new(TRUE, 0); $hbox->pack_start(Gtk2::Label->new($app_name.' Server'), TRUE, TRUE, 3); $vbox->pack_start($hbox, TRUE, FALSE, 3); $vbox->pack_start($status, TRUE, FALSE, 3); $win->add($vbox); $win->signal_connect(delete_event => sub { Gtk2->main_quit; }); $win->signal_connect('window-state-event' => sub { if (shift(@{$_[1]->new_window_state}) eq 'iconified' && $obj->{trayicon}->is_embedded) { $win->hide; } }); $win->show_all; my $buffer = Gtk2::TextBuffer->new; #-- Create tray icon and menu my $trayicon = Gtk2::StatusIcon->new_from_file($status_msg{stopped}->{icon}); $trayicon->set_visible(TRUE); my $traymenu = Gtk2::Menu->new; my $tray_mconsole = Gtk2::MenuItem->new('View Console'); $tray_mconsole->signal_connect('activate' => sub { $console->activate; }); my $tray_mrestart = Gtk2::MenuItem->new('Restart'); $tray_mrestart->signal_connect('activate' => sub { $restart->activate; }); my $mexit = Gtk2::MenuItem->new('Exit'); $mexit->signal_connect('activate' => sub { Gtk2->main_quit; }); $traymenu->append($tray_mconsole); $traymenu->append($tray_mrestart); $traymenu->append(Gtk2::SeparatorMenuItem->new); $traymenu->append($mexit); $trayicon->signal_connect('popup-menu', sub { my ($ticon, $button, $time) = @_; my ($x, $y, $push) = Gtk2::StatusIcon::position_menu($traymenu, $ticon); $traymenu->show_all; $traymenu->popup(undef, undef, sub {($x, $y,$push)}, undef, $button, $time); }); $obj = { %$obj, win => $win, trayicon => $trayicon, msg_buffer => $buffer, app_name => $app_name, lbstatus => $status, bt_restart => $restart, bt_console => $console }; bless $obj, $class; } # Updates status message on window sub set_status { my ($self, $st) = @_; my $msg = $status_msg{$st}; $self->{lbstatus}->set_text($msg->{msg}); $self->{lbstatus}->modify_fg('normal', $msg->{color}); $self->{win}->set_title($self->{app_name}.'-'.$msg->{msg}); $self->{trayicon}->set_from_file($msg->{icon}); $self->{trayicon}->set_tooltip($self->{app_name}.' ('.$msg->{msg}.')'); } # Collects console output received into text buffer sub append_msg { my ($self, $msg) = @_; my $buffer = $self->{msg_buffer}; $buffer->insert($buffer->get_end_iter, $msg); } sub get_msg_window { my ($self) = @_; my $win = Gtk2::Window->new; $win->set_title($self->{app_name}.' - console output'); $win->set_position('center'); $win->signal_connect('delete_event' => sub { $win->hide; 1; }); my $textview = Gtk2::TextView->new_with_buffer($self->{msg_buffer}); $textview->set_editable(FALSE); $textview->set_wrap_mode('word'); my $text_desc = Pango::FontDescription->new; $text_desc->set_family('Monospace'); $textview->modify_font($text_desc); my $scrolled_win = Gtk2::ScrolledWindow->new; $scrolled_win->add($textview); $win->add($scrolled_win); $win->set_default_size(800, 400); $win->set_size_request(100, 100); return $win; } # Shows collected messages in a new window sub show_msg { my ($self) = @_; unless ($self->{win_msg}) { $self->{win_msg} = $self->get_msg_window; } $self->{win_msg}->show_all; } # Clears text buffer. sub clear_msg { $_[0]->{msg_buffer}->set_text(q{}); } sub set_restart_handler { $_[0]->{bt_restart}->signal_connect('activate', $_[1]); } 1; =pod =head1 NAME CatalystX::Restarter::GTK - GTK based Catalyst server restarter. =head1 SYNOPSIS Set environment variable CATALYST_RESTARTER to CatalystX::Restarter::GTK. Then start server with -r (auto restart on file changes) option. export CATALYST_RESTARTER=CatalystX::Restarter::GTK perl script/myapp_server -r You can also create a shell script and add a shortcut to panel. This avoids need of starting terminal. #!/bin/bash cd /home/username/myapp/trunk/ export CATALYST_RESTARTER=CatalystX::Restarter::GTK perl script/myapp_server.pl -r To use this restarter for specific application only, set appropirate envioronment variable. MYAPP_RESTARTER=CatalystX::Restarter::GTK =head1 DESCRIPTION This module provides GUI interface for controlling Catalyst server and viewing console output generated. It captures both STDOUT and STDERR. It provides tray icon in GNOME notification area and a GTK window on desktop. It is set always on top by default. You can drag window to any screen corner for convenience. Server can be controlled from window as well as tray icon. You can hide window by minimizing it. Tray icon changes according to server status. User can view console output and manually restart server from menu. Whenever any file of project is updated, developer can immediately check server status without switching to console. =head1 NOTES This module extends Catalyst::Restarter and depends on its _watcher and _handle_events. =head1 AUTHOR Dhaval Dhanani L =head1 LICENCE This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =head1 COPYRIGHT This library is copyright (c) 2011 the above named AUTHOR and CONSTRIBUTOR(s). =cut CatalystX-Restarter-GTK/lib/CatalystX/Restarter/.GTK.pm.swp0000600000175000017500000006000012033752705023144 0ustar dhavaldhavalb0VIM 7.2[Mb4 dhavaldhaval-desktop~dhaval/perl/gtkserver/trunk/lib/CatalystX/Restarter/GTK.pmutf-8 U3210#"! Utp5ad+N/~_ED-,   q a R O N &   ~ d T D A @  s c R O N : % $ s r +  d c I H * l>rO+ya=kFR6mLKyx my $win = my $win = WinMonitor->new($self->application_name); require AnyEvent::Socket; Gtk2->init; require Gtk2; # Use event loop of Gtk2 by loading it first. $win_sock->autoflush(1); close $parent_sock; $sentry->dismiss; else { } AnyEvent->condvar->recv; # Wait for events infinitely. $self->_fork_and_start; $sentry = undef; $sem->op(0, -1, 0); # wait until window process sets up watchers. } ); } } $self->_handle_events(@events); if (my @events = $self->_watcher->new_events) { cb => sub { interval => 1, after => 1, my $timer = AnyEvent->timer( if ($self->auto_restart) { ); } $self->_fork_and_start; $self->_kill_child; cb => sub { signal => SIGUSR1, my $restart_watcher = AnyEvent->signal( # Handle USR1 (Restart signal) from window ); } exit; $self->_kill_child; $self->win_pid(0); cb => sub { pid => $self->win_pid, my $child_win = AnyEvent->child( # Detect window process termination ); } $self->_child(0); $self->notify_win('stopped'); cb => sub { pid => $self->_child, my $child_server = AnyEvent->child( # Detect server process termination. $self->parent_sock($parent_sock); $self->win_pid($pid); require AnyEvent; $parent_sock->autoflush(1); close $win_sock; if ($pid) { croak $! unless defined $pid; my $pid = fork; # Fork GUI process or croak "socketpair failed: $!"; socketpair(my $parent_sock, my $win_sock, AF_UNIX, SOCK_STREAM, 0) my $sentry = Object::Destroyer->new($sem, 'remove'); or croak "Can not create semaphore $!"; my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRWXU | IPC_CREAT) my ($self) = @_;sub run_and_watch {); default => 1 is => 'rw',has auto_restart => (); is => 'rw'has srv_reader => (# Pipe for retriving error messages from server process); is => 'rw',has parent_sock => (# Socket for communication with window process); isa => Str, is => 'rw',has application_name => (# name of catalyst application.); isa => Int, is => 'rw',has port => (# Port number of catalyst server); isa => Int, is => 'rw',has win_pid => (# stores forked gtk window process' PID); isa => Int is => 'rw',has _child => (# stores forked catalyst server's PID} return __PACKAGE__; die "Win32 not supported" if ($^O eq 'MSWin32');sub pick_subclass {extends 'Catalyst::Restarter';our $VERSION = '0.01';use namespace::autoclean;use IO::Handle qw();use Socket qw(AF_UNIX SOCK_STREAM);use Carp qw(croak);use Object::Destroyer qw();use IPC::SysV qw(S_IRWXU IPC_PRIVATE IPC_CREAT);use IPC::Semaphore qw();use POSIX qw(SIGUSR1 SIGUSR2 WNOHANG);use Try::Tiny qw(try catch);use MooseX::Types::Moose qw(Int Str);use Moose;package CatalystX::Restarter::GTK;ad5qonXWGFjiVU   , +   O N = < '&=cutThis library is copyright (c) 2011 the above named AUTHOR and CONSTRIBUTOR(s).==cutThis library is copyright (c) 2011 the above named AUTHOR and CONSTRIBUTOR(s).=head1 COPYRIGHTThis library is free software. You can redistribute it and/or modify it under the same ==cutThis library is copyright (c) 2011 the above named AUTHOR and CONSTRIBUTOR(s).=head1 COPYRIGHTThis library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.=head1 LICENCEDhaval Dhanani L, L=head1 AUTHORThis module extends CatalystX::Restarter::GTK which in turn extends Catalyst::Restarter. It depends upon inherited _watcher and _handle_events members of Catalyst::Restarter for monitoring files changes.=head1 NOTESWith this module Catalyst application developers do not need to use console to start or manage catalyst server or viewing console output. Window stays always on top by default. User can drag to any screen corner for convenience. When developer chagne any file of project, he can immediately check whether server is restarted successfuly or not before hitting refresh on web browser.This module forks two processes. First child process creates GUI window and listens for incoming messages from parent.(console output and signals for notifying status change). Second child process runs the actual server and creates server socket by calling run() on application module.It shows a small GUI window for controlling catalyst server and notifying status. It also captures console output printed by application at run time, both STDERR and STDOUT.=head1 DESCRIPTIONCatalystX::Restarter::GTK - GTK based Catalyst server restarter.=head1 NAME=pod1;} $_[0]->{bt_restart}->signal_connect('activate', $_[1]);sub set_restart_handler {} $_[0]->{msg_buffer}->set_text(q{});sub clear_msg {# Clears text buffer.} $self->{win_msg}->show_all; } $self->{win_msg} = $self->get_msg_window; unless ($self->{win_msg}) { my ($self) = @_;ad>F)pK r 9   j R 1  w J +  Y 7  e W L 1 0     ~_65rhb`_I32ON:dDC'& pbVU.-yx/}|]I>=<; }; exit 1; STDERR->print($_); catch { } $self->start_sub->(); try { STDOUT->autoflush(1); open (STDOUT, '>&', $writer) or croak "Failed to dup STDOUT $!"; open (STDERR, '>&', $writer) or croak "Failed to dup STDERR $!"; $sentry = undef; $sem->op(0, -1, 0); $writer->autoflush(1); close $reader; else { } $sem->op(0, 1, 0); $sentry->dismiss; $self->notify_win('starting'); )); } } syswrite($self->parent_sock, $msg, $bytes); if (my $bytes = sysread($reader, my $msg, 256, 0)) { cb => sub { poll => 'r', fh => $reader, $self->srv_reader(AnyEvent->io( # Read console output from forked server and send to win proc $self->_child($pid); close $writer; if($pid) { return unless (defined $pid); my $pid = fork; my $sentry = Object::Destroyer->new($sem, 'remove'); or croak "failed to create semaphore $!"; my $sem = IPC::Semaphore->new(IPC_PRIVATE, 1, S_IRWXU | IPC_CREAT) pipe(my $reader, my $writer) or croak "$!"; my $self = shift;sub _fork_and_start {} } } $self->parent_sock->getline; # Wait until signal is handled. This is for synchronizing signals. kill $map{$msg}, $self->win_pid; if ($self->win_pid) { return unless exists $map{$msg}; my ($self, $msg) = @_; sub notify_win { my %map = ('starting' => SIGUSR1, 'stopped' => SIGUSR2);{# Sends server status signal to window process.} } exit(0); main Gtk2; $sem->op(0, 1, 0); ); } $win->append_msg($msg); return unless sysread($win_sock, my $msg, 256, 0); # Unbuffered read from socket cb => sub { poll => 'r', fh => $win_sock, my $winsock_watcher = AnyEvent->io( ); } $win_sock->say('1'); $watcher = undef; $win->set_status('stopped'); cb => sub { signal => SIGUSR2, my $usr2_watcher = AnyEvent->signal( # SIGUSR2 - Server exited / killed ); } $start_timer->(); $win_sock->say('1'); $win->set_status('starting'); $win->clear_msg; cb => sub { signal => SIGUSR1, my $usr1_watcher = AnyEvent->signal( # SIGUSR1 - starting server }; ); } }); } $watcher = $start_timer->(); # Restart timer upon failure else { } $win->set_status('started'); $watcher = undef; if (shift) { AnyEvent::Socket::tcp_connect('localhost', $self->port, sub { cb => sub { after => 1, $watcher = AnyEvent->timer( $start_timer = sub { # Creates event watcher for checking socket readiness of forked server. my ($watcher, $start_timer); $win->set_restart_handler(sub { kill SIGUSR1, getppid; });ad\nmSR,+%#"zpo\ H E D :     w v R Q   t s A h G F  a . -  XWA@ZYd)(udI#feCkj8k\sub show_msg {# Shows collected messages in a new window} return $win; $win->set_size_request(100, 100); $win->set_default_size(800, 400); $win->add($scrolled_win); $scrolled_win->add($textview); my $scrolled_win = Gtk2::ScrolledWindow->new; $textview->set_wrap_mode('word'); $textview->set_editable(FALSE); my $textview = Gtk2::TextView->new_with_buffer($self->{msg_buffer}); $win->signal_connect('delete_event' => sub { $win->hide; 1; }); $win->set_position('center'); $win->set_title($self->{app_name}.' - console output'); my $win = Gtk2::Window->new; my ($self) = @_;sub get_msg_window {} $buffer->insert($buffer->get_end_iter, $msg); my $buffer = $self->{msg_buffer}; my ($self, $msg) = @_;sub append_msg {# Collects console output received into text buffer} $self->{bt_restart}->set_sensitive($st ne 'starting'); $self->{win}->set_title($self->{app_name}.'-'.$msg->{msg}); $self->{lbstatus}->modify_fg('normal', $msg->{color}); $self->{lbstatus}->set_text($msg->{msg}); my $msg = $status_msg{$st}; my ($self, $st) = @_;sub set_status {# Updates status message on window} bless $obj, $class; bt_restart => $restart, bt_console => $console }; $obj = { %$obj, win => $win, msg_buffer => $buffer, app_name => $app_name, lbstatus => $status, my $buffer = Gtk2::TextBuffer->new; $win->show_all; $win->signal_connect(delete_event => sub { Gtk2->main_quit; }); $win->add($vbox); $vbox->pack_start($status, TRUE, FALSE, 3); $vbox->pack_start($hbox, TRUE, FALSE, 3); $hbox->pack_start(Gtk2::Label->new($app_name.' Server'), TRUE, TRUE, 3); my $hbox = Gtk2::HBox->new(TRUE, 0); $vbox->pack_start($menu_bar, FALSE, FALSE, 0); my $vbox = Gtk2::VBox->new(FALSE, 0); $menu_bar->set_size_request(-1, 22); $menu_bar->append($tools); $menu_bar->append($view); $tools->set_submenu($mrestart); my $tools = Gtk2::MenuItem->new('_Tools'); $mrestart->append($restart); my $mrestart = Gtk2::Menu->new; my $restart = Gtk2::MenuItem->new('Restart'); $view->set_submenu($mview); $mview->append($console); $console->signal_connect('activate', sub { $obj->show_msg; }); my $console = Gtk2::MenuItem->new('Console'); my $mview = Gtk2::Menu->new; my $view = Gtk2::MenuItem->new('_View'); my $menu_bar = Gtk2::MenuBar->new; my $bt_console = Gtk2::Button->new('Console'); my $bt_restart = Gtk2::Button->new('Restart'); my $status = Gtk2::Label->new; $win->set_position('center'); $win->set_keep_above(1); $win->set_title($app_name); my $win = Gtk2::Window->new('toplevel'); my $obj = {}; my ($class, $app_name) = @_;sub new {); stopped => { msg => 'Stopped', color => Gtk2::Gdk::Color->new(0x55 * 257, 0, 0) }, started => { msg => 'Started', color => Gtk2::Gdk::Color->new(0, 0x55 * 257, 0) }, starting => { msg => 'Starting', color => Gtk2::Gdk::Color->new(0, 0, 0x55 * 257) },my %status_msg = (use Carp;use Glib qw(TRUE FALSE);use Gtk2;use warnings;use strict;package WinMonitor;#--- Class WinMonitor for GUI ---no Moose;__PACKAGE__->meta->make_immutable;} } $self->notify_win('stopped'); $self->_child(0); waitpid($self->_child, 0); kill 'INT', $self->_child; if ($self->_child) { my $self = shift;sub _kill_child {} }CatalystX-Restarter-GTK/lib/CatalystX/Restarter/started.png0000664000175000017500000000602112114670401023454 0ustar dhavaldhavalPNG  IHDRVΎW pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F8IDATxڜӿ+aIĢkLV6)~ 6fB\(B~µ<_I_ܾzz:O;tRw%P7p\6sN2юB $HJH:iH6,l#_PZqS4c>t@EI/0ͨ3 PθTÉҘ@#8ZB'{Lu(pWbx ^1-P l5hA9qJim N\bO0}Fl櫣p zÜpq: o0TpWc4մNzt$K> ~+GY#IENDB`CatalystX-Restarter-GTK/lib/CatalystX/Restarter/stopped.png0000664000175000017500000000602412114670401023467 0ustar dhavaldhavalPNG  IHDRVΎW pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F?IDATxڜӿ+aWG$YbHUL2ڤ 2 Fld ``tS"Wk:_rw_]羢Ta.W6,DE P]$j4[(GC`w8~ _='L@XDMbǥyԊ"\sj(I"̛@S ^ʼ(<yu%rE7%l}Po' build_requires: ExtUtils::MakeMaker: 6.59 Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: CatalystX-Restarter-GTK no_index: directory: - t - inc requires: AnyEvent: 0 Catalyst::Devel: 0 Catalyst::Runtime: 5.80032 Gtk2: 0 IO::Handle: 0 IPC::SysV: 0 Moose: 0 MooseX::Types: 0 Object::Destroyer: 0 Try::Tiny: 0 namespace::autoclean: 0 perl: 5.008 version: 0.06