Re: The mechanics of an SDK

[email protected] (Tim Bunce) Wed, 29 Aug 2001 10:46:44 +0100
Newsgroups perl.sdk
Message-ID <[email protected]>
On Wed, Aug 29, 2001 at 02:48:19AM -0400, Michael G Schwern wrote:
> On Tue, Aug 28, 2001 at 10:08:16PM -0700, Ask Bjoern Hansen wrote:
> > On Tue, 28 Aug 2001, Michael G Schwern wrote:
> > > Let's say I want to put together an SDK.  Now.  I already have my
> > > modules picked out.  Aside from CPAN bundles, how exactly does one
> > > make an SDK?
> > 
> > I would make it as a big ol' tar ball with all the included modules,
> > an installer (some kind of wrapper around CPAN.pm I reckon) and
> > possibly some extra tests.
> 
> Ok then.  I just uploaded a Testing SDK to CPAN.
> http://www.pobox.com/~schwern/src/Test-SDK-0.02.tar.gz
> 
> Here's how I did it, it's pretty easy.
> 
>     mkdir Test-SDK;
>     cd Test-SDK;
> 
> write a Makefile.PL like so:
> 
>     use 5.004;
> 
>     use ExtUtils::MakeMaker;
> 
>     WriteMakefile(
>         NAME            => 'Test-SDK',
>         VERSION         => '0.01',
>         INST_LIB        => './blib/lib',
>         INST_ARCHLIB    => './blib/arch',
>     );
> 
> Setting INST_LIB and INST_ARCHLIB means that when you run make, the
> modules all get copied into Test-SDK/blib/lib/.  That way dependencies
> are handled.
> 
> The "use 5.004" is the minimum perl version to make the modules in the
> SDK work.
> 
> I then took three modules, Test::Harness, Test::Simple and
> Test::Inline and unpacked them straight into Test-SDK/
> 
> -rw-r--r--    1 schwern  schwern       197 Aug 29 02:26 Makefile.PL
> drwxr-sr-x    4 schwern  schwern      4096 Aug 29 02:30 Test-Harness-1.23
> drwxr-sr-x    6 schwern  schwern      4096 Aug 29 02:30 Test-Inline-0.10
> drwxr-sr-x    4 schwern  schwern      4096 Aug 29 02:30 Test-Simple-0.16
> 
> >From here on it's a regular module.
> 
>     perl Makefile.PL
>     make
>     make manifest  (had to delete a few spurious things)
>     make test
> 
> Throw in Changes and README files, run a "make dist" and *bang* SDK.
> 
> Now get off your asses and make some more!

This may be impractical for some reason, but...

Since I'm even lazier than that, I'd like to see a utility that takes a
bundle file and turns it into an 'instantiated module' just like you've
done above.

That would reduce the task to just

	write Bundle::Foo::Bar file
	run utility

It's hardly going to be complicated, even including the fetching and
unpacking of the modules via CPAN.pm.

Tim.