Subject: Re: Q&D guide to putting perl modules into pkgsrc?
To: None <tech-pkg@NetBSD.org>
From: Carl Brewer <carl@bl.echidna.id.au>
List: tech-pkg
Date: 10/26/2004 14:42:57
Greg Troxel wrote:
> Look at the Makefile for an existing perl module, and note that it is
> pretty short and you just have to change the name (in then module
> name, the CPAN fetch location, and in the PERL5_PACKLIST variable).
> 
> See devel/p5-Data-Buffer for a fairly vanilla example.

I've done this, and got a mostly working pkg, save for
worrying about the README etc ...

But.... I'm having trouble getting a patch to take.  When I
run the patch manually, it works :

rollcage2# patch < patches/patch-aa
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- lib/MasonX/Apache2Handler.pm.orig  Sun Apr 11 17:02:16 2004
|+++ lib/MasonX/Apache2Handler.pm       Mon Oct 25 22:47:12 2004
--------------------------
File to patch: work/MasonX-Apache2Handler-0.05/lib/MasonX/Apache2Handler.pm
Patching file 
work/MasonX-Apache2Handler-0.05/lib/MasonX/Apache2Handler.pm using Plan A...
Hunk #1 succeeded at 615 with fuzz 1.
done



but when I run it from make :

===> Applying pkgsrc patches for p5-MasonX-Apache2Handler-0.05
1 out of 1 hunks failed--saving rejects to lib/MasonX/Apache2Handler.pm.rej
Patch /usr/pkgsrc/www/p5-MasonX-Apache2Handler/patches/patch-aa failed
*** Error code 1

Stop.


The patch looks like this:
more patches/patch-aa
--- lib/MasonX/Apache2Handler.pm.orig   Sun Apr 11 17:02:16 2004
+++ lib/MasonX/Apache2Handler.pm        Mon Oct 25 22:47:12 2004
@@ -615,7 +615,7 @@
      if (exists $allowed_params->{data_dir} and not exists 
$params{data_dir})
      {
         # constructs path to <server root>/mason
-       my $def = $defaults{data_dir} = 
Apache->server->server_root_relative('mason');
+       my $def = $defaults{data_dir} = 
File::Spec->catfile(Apache::ServerUtil::server_root, 'mason');
         param_error "Default data_dir (MasonDataDir) '$def' must be an 
absolute path"
             unless File::Spec->file_name_is_absolute($def);




Can anyone let me know what I've done wrong?

thanks

Carl




>