Re: Package Application for CPAN
by Zaxo (Archbishop) on Sep 15, 2004 at 17:52 UTC
|
| [reply] |
|
|
make install
place the .pl file? I assume it'll go in @INC somewhere (or wherever PREFIX points to). Is this a good place for it to end up? | [reply] [d/l] |
|
|
where will make install place the .pl file?
As always it depends. If you do nothing and have used h2xs to build your skeleton it will simply get dumped in the same location as your .pm files. To install a .pl script (say it is at DISTRO/bin/foo.pl in your distro) into a bin dir you modify the Makefile.PL like this:
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'Foo',
'VERSION_FROM' => 'Foo.pm',
'EXE_FILES' => ['bin/foo.pl'], # <--- Add list of .pl exe
+files to install
);
The foo.pl script will now be installed in an architecture dependent bin dir. This will proabably allow the user to just type foo.pl as it will *probably* be in their path. On win32 a .bat file will also be automatically generated. You can control the install location with perl Makefile.PL PREFIX=blah This affects both .pm and exe_files. LIB controls compiled binary install location if you have C/XS code.
| [reply] [d/l] [select] |
|
|
| [reply] [d/l] [select] |
|
|
There are several CPAN modules which also contain 'executeables'.. They usually land in the same directory as the perl binary itself. Looking at the Makefile.PL for Prima (which was the first one I thought of), it does some complicated stuff to put its executeables somewhere useful.. Ah, and looking at DBI::Shell, it could have avoided all that by using: EXE_FILES => [ "dbish$ext_pl" ], or similar, that's probably what you want.
C.
| [reply] [d/l] |
|
|
You'll probably get advice to use some newer builders
Can you elaborate on this?
| [reply] |
|
|
| [reply] |
Re: Package Application for CPAN
by MrCromeDome (Deacon) on Sep 15, 2004 at 18:33 UTC
|
Make sure to also check out tachyon's Simple Module Tutorial. I found it to be very, very helpful the first time I started putting modules together.
Cheers!
MrCromeDome | [reply] |
Re: Package Application for CPAN
by jacques (Priest) on Sep 15, 2004 at 18:19 UTC
|
This is perfect for PAR, but it is not the standard (yet). | [reply] |
Re: Package Application for CPAN
by belg4mit (Prior) on Sep 15, 2004 at 20:55 UTC
|
The CPAN script area only handles single (apparently ASCII)
files, so I've resorted to the use of par (not PAR) -- the
perl equivalent of shar.
--
I'm not belgian but I play one on TV.
| [reply] |
Re: Package Application for CPAN
by borisz (Canon) on Sep 15, 2004 at 18:27 UTC
|
Look at h2xs first, this get you started. Then get familar with the targets of the Makefile. (make manifest; make dist ... )
Make sure thast you follow the usual installation procedure.
perl Makefile.PL
make
make test
make install
| [reply] [d/l] [select] |