Subject: Re: a few PLIST related questions
To: Alistair Crooks <azcb0@amdahl.com>
From: None <mcmahill@mtl.mit.edu>
List: tech-pkg
Date: 08/14/1998 09:27:36
On Fri, 14 Aug 1998, Alistair Crooks wrote:
> > 1)  Several subdirectories are created.  Should those be listed the same
> >     way as files or only at the end as
> >     @dirrm subdirname
> 
> Just the @dirrm subdirname, in the correct order so that parent
> directories are listed after child subdirectories e.g.
> 
> @dirrm parent/child
> @dirrm parent
ok.  That one's easy!

> > 2)  There has been a lot of talk about checksums lately.  I don't
> >     completely understand where that comes in so I'll ask this one.
> >     The "normal" install procedure for the program (ie not in our
> >     package environment) is
> >     make all
> >     make tarbindist
> >     cd final_destination_directory
> >     tar -zxvf name_of_tarbindist_file_just_created
> >     make
> > 
> >     The final 'make' sees that you have extracted a binary distribution of
> >     the program and it goes in to a couple of scripts and hard codes the
> >     path names (using sed).
> > 
> >     Anyway, my question is then, is this a problem?  I can easily add an
> >     install target that does this, but the exact contents of a couple of
> >     the installed files will vary depending on ${PREFIX}.  Will this be
> >     a problem if this is made into a binary package?  Do I need to do
> >     something extra to make it go correctly?
> 
> The md5 checksums are done as part of the "fake-pkg" target, which is
> performed after the pre-install, do-install, and post-install stages,
> when you see the "Registering installation for ${PKGNAME}" message. So
> if all the tar steps you mention above are done as part of one of those
> *-install targets, you should be OK.
> 
> However, this will be a problem for any binary package that is created,
> as you suspected, as it will not be possible to run the binary package
> on a system different to your own - the pathnames will not be correct. At
> the moment, there's nothing that can be done about this. Sorry.
> 
> But a quick question - why does it hardcode paths in there? Can't scilab
> use environment variables, or run-time checks, to make it much more
> portable?

It does a couple of things.  Most (I think all but one) of the scripts
have something like:

if test "$SCI" = ""; then
  SCI="/usr/pkgsrc/math/scilab/work/scilab-2.4"
fi
export SCI

at the top.  So, if the user of the program has SCI defined, then getting
the correct path here doesn't matter.  It is nice, however, to have it
just work with out having to make each user define SCI.  

I'll see if I can figure out how to get the path name from $0 in the
script.  Perhaps that will be more robust.

Thanks for the help!

Dan