diff -r a14d0bfd2e21 -r 85a89053a279 Build.PL --- a/Build.PL Tue Jul 15 15:39:57 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -#!/usr/bin/perl - -use Module::Build; - -my $builder = Module::Build->subclass( - class => 'My::Module::Build', - code => <<'___CODE', - use strict; - use warnings; - use File::Temp; - sub ACTION_equivs { - my $self = shift; - my %provides = ( - 'POSIX' => 'perl-base', - 'File::Path' => 'perl-modules', - ); - my %deps = ( ( map { (my $d = $_ ) =~ s/::/-/g; - defined $provides{$_} ? $provides{$_} : 'lib' . lc $d . '-perl' - => $self->requires->{$_} == 0 ? '' : ' (>= ' . $self->requires->{$_} . ')' - } keys %{$self->requires} ), - ); - my $c = new File::Temp or die "Can't tempfile"; - print $c "Package: libius-dav-htpasswd-perl-deps\n"; - print $c 'Depends: ', join ', ', map { "$_$deps{$_}" } keys %deps; - system('equivs-build', $c->filename); - } - sub ACTION_install { - my $self = shift; - my $h = ($self->install_path('cgi-bin') =~ m|^(.*)/cgi-bin$|)[0] ; - my $u = my $g = ($h =~ m|/([^/]+)$|)[0]; - system(qw(chown -R), "$u:$g", $h) == 0 - or die "Can't 'chown -R $u:$g $h': $!"; - { no warnings 'qw'; - system(qw(chmod -R go=,-st), $h) == 0 - or die "Can't 'chmod -R go=,-st $h"; - } - $self->SUPER::ACTION_install; - } - sub get_metadata { - my ($self, @args) = @_; - my $data = $self->SUPER::get_metadata(@args); - # workaround double utf encoded characters in MYMETA.{yml,json} ('ö' - # instead of 'ö' for example): the author name is taken from the pod in - # lib/Ius/Dav/Htpasswd.pm and the pod parser used by Module::Build is - # assuming latin1 despite the '=encoding' command - use Encode; - map { $_ = decode('utf8', $_); } @{$data->{author}} if defined $data->{author}; - return $data; - } -___CODE -); - -my $build = $builder->new( - module_name => 'Ius::Dav::Htpasswd', - license => 'gpl', - create_license => 1, - requires => { - 'Apache::Htpasswd' => 0, - 'AppConfig' => 0, - 'File::Path' => 0, - 'POSIX' => 0, - 'String::MkPasswd' => 0 - }, - script_files => [ glob 'bin/*' ], - cgi_files => - { map { /\.(bak|orig)$/ ? () : ( $_ => $_ ) } glob 'cgi-bin/*' } -); -$build->add_build_element('cgi'); -$build->install_path( - 'cgi-bin' => $build->original_prefix( $build->installdirs ) - . '/lib/ius-dav-htpasswd/cgi-bin' ); -$build->create_build_script;