Operating System - HP-UX
1833589 Members
3759 Online
110061 Solutions
New Discussion

Re: Changing install location for package

 
Darrell Allen
Honored Contributor

Changing install location for package

Hi all,

Being lazy (and not overly adept at making packages), I downloaded a Perl package instead of source code. The package installs in /usr/local but I'd like to install to /usr/contrib instead. I saw a recent thread about changing the location within swinstall but it seems to use the "new" location as the "root" directory. The result is I wind up with Perl in /usr/contrib/usr/local...

So, how can I use swinstall to install Perl in /usr/contrib instead of /usr/local?

Thanks,
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
7 REPLIES 7
G. Vrijhoeven
Honored Contributor

Re: Changing install location for package

Hi Dannan,

You can relocate packages if they that option relocation=true is specified in the psf file ( source sd kit) you can check that out by looking at the product discription. If not it is not possible. (you can always use the mv command after installation) One warning, do not change target root ( /var/sw/swagent.log etc will be placed after the the alternate root)

Hope this will help
Stefan Farrelly
Honored Contributor

Re: Changing install location for package


Only if a package is written to handle installation to alternative locations will it work. Chances are youre out of luck.

Instead, what I do for simple packages (that only have 1 or a few install directories) is swinstall them, then mv them to where you want them and leave a symbolic link where they used to be.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Wodisch
Honored Contributor

Re: Changing install location for package

Hello Darrell,

you could try "swcopy"ing the package to a local directory, then reading the scripts used by it, modying a copy of those, and try to use "swmodify" to copy those modified scripts back into the package.
Or you could try to "swmodify" ALL files in the package to move them to the new target directory.
They still might/will contain internal links/references to the old path, though :-(

Just my $0.02,
Wodisch
Sridhar Bhaskarla
Honored Contributor

Re: Changing install location for package

It's always better to compile the source code so that we can have the flexibility of installing it anywhere. Unfortunately most of the packages are too hardcoded with the paths that they won't work if installed in other directories. You can try your luck by actually creating a link in /usr/local/perlxxx to /usr/contrib and then install.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bernie Vande Griend
Respected Contributor

Re: Changing install location for package

You do have the "-r" option with swinstall to specify an alternate "/" directory which would allow you to install the packages somewhere else. You could use this option to install the package to an alternate location and then copy it to the correct locations. A better use of the "-r" is to install the files to a temporary location in which you can then repackage them and change the options to install wherever you wish.
Ye who thinks he has a lot to say, probably shouldn't.
Darrell Allen
Honored Contributor

Re: Changing install location for package

Thanks for the replies so far.

I'm still looking for suggestions though I'm looking more closely into Wodisch's and Bernie's posts.

Here's what I did: untar the depot; edit INFO file changing /usr/local to /usr/contrib; tarred it back up; then swinstalled it. This seems to have worked but I find it to be a less than desirable method.

I don't really want to install a package and then move the files for that package. I want to manage the software as a package, that is run swremove if desired (if I had moved the files then swremove wouldn't be able to remove them would it?), swlist, etc.

Perhaps it is better to compile the source code and make the package myself. But if I trust the site and the package, wouldn't it be a good thing to be able to modify the package install location?

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Darrell Allen
Honored Contributor

Re: Changing install location for package

Almost forgot: after editing the INFO file I changed usr/local to usr/contrib in the depot's directory structure.
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)