LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can I Make make Believe Root Is a Different Directory? (http://www.linuxquestions.org/questions/linux-general-1/can-i-make-make-believe-root-is-a-different-directory-502113/)

binarybob0001 11-16-2006 01:48 AM

Can I Make make Believe Root Is a Different Directory?
 
I'm using Slackware and everynow and then I get a package that is particularly annoying to install. Some do not provide install options even like python scripts, imake and smake (or they provide options but finding out the right one to use is difficult). What would be nice is to fool make that it is running as root, but be able to direct all the files it creates to a directory for packaging. Checkinstall works 98% of the time, but sometimes you need to do things the hardway. Does anyone know how to create an environment like this? Thanks.

BCarey 11-16-2006 07:18 PM

Have you tried chroot?

binarybob0001 11-17-2006 03:32 AM

That could be done, but how would I give the application access to all the packages it needs to look for.

ppr:kut 11-17-2006 05:02 AM

I'm not sure if I get you right, but I think "DESTDIR" is what you want.
Just make sure you have writing rights for the source and destination directory. Say destination is "usr/src/package-a" then just type
Quote:

"make install DESTDIR=/usr/src/package-a"
then all things get installed in that directory. makepkg can then make a package of it, which you can install just as usual with installpkg.
My experience that it works often, but DESTDIR has to be defined in the Makefile, otherwise it does exactly nothing. But such packages are rare.

binarybob0001 11-18-2006 04:48 AM

I made this post for the rare packages. My last experience with this was bin utils. I needed to patch mount to handle AES encrypted loopback devices. I used the DESTDIR variable. I made my package and installed it. Sure enough, 10 hours of work became 20 hours of work. What's needed is a good program to monitor the file system so that all the newly created files, symlinks and chmod's can be gathered into one place for an install script to be made and a package. Checkinstall has failed me numerous times due to something called a recursive install whatever that is.

ppr:kut 11-20-2006 03:33 AM

OK, now I get what you want!
I haven't done such things before, but I just try and take the chroot thing a step further. If you want to use chroot, i guess that there need to be no files in the chrooted environment, because otherwise it wouldn't make sense. Libraries and other files, needed to be read, could be made accesible if you mount the original root somewhere in the new one, for example /mnt/root-old. Then just change the $PATH-variable would make them accesible.
If you search for something similar to checkinstall, try protopkg. Haven't tried it so far, but i know that it uses not installwatch, which is the base for checkinstall.


All times are GMT -5. The time now is 05:31 AM.