Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do you package your programs?

by lachoy (Parson)
on Aug 28, 2002 at 11:45 UTC ( [id://193425]=note: print w/replies, xml ) Need Help??


in reply to How do you package your programs?

If you use ExtUtils::MakeMaker, you can specify a list of EXE_FILES in your Makefile.PL; they will be installed in the appropriate bin/ directory somewhere, depending on the configuration.

For instance, in my script for OpenInteract, I have:

my %opts = ( 'NAME' => 'OpenInteract', 'VERSION_FROM' => 'OpenInteract.pm', 'EXE_FILES' => [ qw( script/oi_manage ) ], ... ); WriteMakefile( %opts );

This will copy the file from script/oi_manage into (on my machine) /usr/bin. You can change this (with caution) by modifying your install's Config.pm keys 'installbin', and/or 'installsitebin'.

And there's nothing wrong with adding your library to @INC -- that's what it's for!

Chris
M-x auto-bs-mode

Replies are listed 'Best First'.
Re: How do you package your programs?
by Abigail-II (Bishop) on Aug 28, 2002 at 12:08 UTC
    I think it's very unfortunate that MakeMaker works this way. The directory I install the perl binary in is not the same directory I want to install a random program in, that just happens to be written in Perl.

    Large packages, I always install in /opt/app, for suitable app. This is done so you can easily remove an entire application - if only because you want to make a new, fresh, install. A program 'foo' belongs in /opt/foo/bin/foo, or /usr/local/bin/foo, depending whether I want it installed in its own directory structure or not. It should not be dropped in a directory depending on the language it happen to be written in.

    Abigail

      I second Abigail's suggestion. This also solves the problem of storing additional data files. Just use /opt/myapp/(data|sounds|grapics|...). Some applications like to install themselves as /usr/bin/myapp, then proceed to install files into /usr/share/myapp/. I prefer the first approach, as it keeps everything nicely bundled together. You can always add scripts to /usr/local/bin to put your app in the path.

      But of course, with opinions varying greatly, it is best to give the user a choice. Some might even want to install your app in a homedir on a shared server. That's the beauty of configure --prefix=/path...

Re: Re: How do you package your programs?
by jepri (Parson) on Aug 28, 2002 at 11:51 UTC
    OK, but where do I put things like jpegs, sound files? That's what has slightly turned me off MakeMaker.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://193425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-24 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found