LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-23-2005, 07:33 AM   #1
jkassemi
Member
 
Registered: May 2004
Location: Albuquerque, NM
Distribution: slackware-current, slamd64-11
Posts: 106

Rep: Reputation: 15
make destination DESTDIR


Hello everybody....

I've got a directory /package (I'm creating a slackware package, but I don't think that really matters), and I'm trying to install Apache 2 into it.

When I use --prefix=/package/usr/local/httpd on the configuration script, I end up with loads of files that point to /package/usr/local/httpd/... for different settings. I want them all to point to /usr/local/httpd, but also need to install all of the items in the /package directory.

So I've done:

Code:
./configure --prefix=/usr/local/httpd
make
make install DESTDIR=/package/usr/local/httpd
This seems like it works at first, but once I move the /package tree up one level ( so that the files are in the /usr/local/httpd) location, I start getting errors once more. I believe this is because Apache installs some items outside the /usr/local/httpd directory, like /sbin/apachectl, for instance.

I did some research, and found somebody who suggested doing something like this:

Code:
./configure --prefix=/usr/local/httpd
make
make destination DESTDIR=/package
make install DESTDIR=/package/usr/local/httpd
They were saying that it would create the appropriate directory structure in /package, creating /package/sbin, /package/usr/share/man, /package/usr/local/httpd, etc. That was on an OpenBSD mailing list (http://www.monkey.org/openbsd/archiv.../msg00051.html), and I can't figure out if there is anything like it for linux. When I try, I just get a make destination rule not found error.

Anybody offer any help on what to do?

Thanks for your help,
James
 
Old 09-24-2005, 01:49 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Couple things...
Quote:
make destination DESTDIR=/package
...
When I try, I just get a make destination rule not found error
Not surprising unless the Apache developers put instructions in their Makefile to compile/update a "destination" object. That's a make thing, not an OpenBSD/Linux thing. You might try
Code:
./configure --prefix=/package
make DESTDIR=/package/usr/local/httpd
make install DESTDIR=/package/usr/local/httpd
The DESTDIR variable is also a make thing. There are a couple ways you can influence where a compiled package gets installed. DESTDIR is a common Makefile variable. You can do som funky things with the variables, but usually if you use a value at one stage (like the make install above) you should use the same value in all stages. Again, unless you're trying to do something super-spiffy. If you are, you'll likely know why you have to do it that way.


Also, I'm not sure why you have a --prefix option and override it. All the files the install copies over should go somewhere under the prefix directory. The above three commands would be equivalent to this:
Code:
./configure --prefix=/package/usr/local/httpd
make
make install
If you're really, really concerned that Apache is putting files in other places, compile and install Apache as a regular user. Create a user that has write access only to the directory the Apache source is in, and the prefix directory. When make install is run, you'll get errors if the install tries to copy files anywhere else (permission denied). Even if you need root to do the install to create the package, you can use this dummy account as a dry run to get the commands right. Then you'll be certain that all the files go to the right place even as root.



I won't promise this third bit will fix your problem, but you can try this:
Code:
rmdir /usr/local/httpd
ln -s /package/usr/local/httpd /usr/local/httpd
./configure --prefix=/usr/local/httpd
make
make install
create package
rm /usr/local/httpd
install package
If it's not obvious what that's doing, here's an explanation. Assuming you don't have a /usr/local/httpd directory, get rid of it and replace it with a symlink pointing to /package/usr/local/httpd. Then you can run through the configure, compile, and install as if you were installing directly to /usr/local/httpd. The files will get redirected to /package/... and all the symlinks will still point to /usr/local/... The package it up, remove the /usr/local/httpd symbolic link, install the package, and all the files in the package should still point to the correct location.
 
Old 09-24-2005, 05:06 AM   #3
jkassemi
Member
 
Registered: May 2004
Location: Albuquerque, NM
Distribution: slackware-current, slamd64-11
Posts: 106

Original Poster
Rep: Reputation: 15
Perfect. That did just what I wanted it to do. Thank you very much.

-James
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to add a "DESTDIR" variable in makefiles that don't have it ? nasty_daemon Programming 2 11-25-2005 01:24 PM
help ! Destination Unreachable ernvb Linux - Hardware 3 10-23-2005 11:09 PM
matrian destination eka Linux - Networking 6 07-19-2005 02:46 PM
Holiday Destination... X11 General 23 04-14-2002 11:53 AM
destination host unreachable!!! katana Linux - General 7 07-20-2001 01:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration