Solved

Using FreeBSD's "ports"

Posted on 2001-06-09
10
349 Views
Last Modified: 2013-12-16
Hello,

As I know "ports" works to "replace" the commom steps to install an
application to the system:

1. download the (latest) source.
2. "./configure --prefix=/usr/local/mypath"
3. "make"
4. "make install"

However, in step (2), I can always use the configuration options. But how
can it be done using "ports"? Is it sth. like

freebsd# make PREFIX=/usr/local/mypath configure

??

The documents i found in freebsd.org seems asking you to do "make install"
in the application's dir and that's all done.

Thanks for advance.

Ken
0
Comment
Question by:kenysc
  • 4
  • 3
  • 3
10 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 6172283
There are things that you can change when building something from the ports collection, but in general that should probably be limited to adding features to a package. The ports collection is, to some degree, a unified collection in that a number of the ports depend on other ports and that implies that the location of said dependancy must be known. Also keep in mind that ports with dependancies will automatically build and install any dependant packages. Oh yeah, any FreeBSD specific patches will also be applied when the package is built.

If you really want to significantly change a port (like changing the destination dir), I'd sugggest that you do a "make" to get any dependancies resolved and to get the sources downloaded and patched. Then go to the source-distribution subdir of "work" and do the normal "configure", "make" "make install". And of course you can always just download the source distribution and build the application in the normal manner.

The question shows the destination being changed for a port. Why would you want to do that?

0
 

Author Comment

by:kenysc
ID: 6172670
It's just an example that I use "--prefix=/usr/local/mypath" to change the path. AIK one can use "make PREFIX=/my_own_path install" to specify where the package should be installed...

However, consider if I install the Apache server using ports. Apache have many config. options like "--with-perl", "--enable-module" etc. It would be a real problem if I can't use the config. options installing this package.

Thanks.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 6173166
For most of the ports it is possible to edit the top level Makefile to change the configure options. If you look at /usr/ports/www/apache13/Makefile, for example, you'll see the list of configure options that will be used and you can add/remove options as you see fit. The only gottcha that I know of is that a cvsup of the ports collection is likely to wipe out your changes to a Makefile. My solution to that is to always copy the Makefile to Makefile-custom after I change it so that I can refer to Makefile-custom to update the Makefile after cvsup'ing the ports collection if I decide to re-build the port.

And the same applies to some things in the /usr/src tree. I customize the build process for sendmail so that I can use SMTP AUTH with sendmail. To do that I need sendmail built with SASL support and that means that the Makefile has to change.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:VictorZ
ID: 7090511
Hello.

Hey BTW did you know that is you where looking for something in special you can in /usr/port
make a search
yes
/C00lFreeBSDB0x/usr/ports #make search key=String of what you are looking
:=)
an example
/C00lFreeBSDB0x/usr/ports #make search key=mmr
Port:     mmr-1.5.4
Path:     /usr/ports/mail/mmr
Info:     Curses based MIME Mail Reader
Maint:     ports@FreeBSD.org
Index:     mail
B-deps:    
R-deps:    


FreeBSD Rocks
Regards
Victor


0
 

Expert Comment

by:VictorZ
ID: 7090512
Hello.

Hey BTW did you know that is you where looking for something in special you can in /usr/port
make a search
yes
/C00lFreeBSDB0x/usr/ports #make search key=String of what you are looking
:=)
an example
/C00lFreeBSDB0x/usr/ports #make search key=mmr
Port:     mmr-1.5.4
Path:     /usr/ports/mail/mmr
Info:     Curses based MIME Mail Reader
Maint:     ports@FreeBSD.org
Index:     mail
B-deps:    
R-deps:    


FreeBSD Rocks
Regards
Victor


0
 

Expert Comment

by:VictorZ
ID: 7090514
Hello.

Hey BTW did you know that is you where looking for something in special you can in /usr/port
make a search
yes
/C00lFreeBSDB0x/usr/ports #make search key=String of what you are looking
:=)
an example
/C00lFreeBSDB0x/usr/ports #make search key=mmr
Port:     mmr-1.5.4
Path:     /usr/ports/mail/mmr
Info:     Curses based MIME Mail Reader
Maint:     ports@FreeBSD.org
Index:     mail
B-deps:    
R-deps:    


FreeBSD Rocks
Regards
Victor


0
 

Author Comment

by:kenysc
ID: 7153233
Thanks for you're triple reply but I want a way to make customized configuration while using ports.

Thx your tips on search.

Regards.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 7153365
Is not editing the Makefile for some port a usable solution? That would be the normal procedure to change a config option for any of the ports.
0
 

Author Comment

by:kenysc
ID: 7153697
I'm expecting a tool or a convenient way to do a "custom make". However, it seems jlevie's comment is the answer at this time.

So thank you and get your points, jlevie.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 7154420
To the best of my knowledge there's not any other way of making custon port builds, now do I know of any effort being made in that direction. The idea behind the ports collection was to provide an easy way to build applications, without the end user having to futz around with configure scripts, compiler options, etc. So a 'canned' build process is encapsulated within the Makefile. For most things it is quite easy to modify the Makefile for local customizations, just remember that a cvsup of the ports collection will wip out your changes, so save a copy of the modifed Makefile.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unistall fileset without dependecies on AIX 3 71
reinstall 1 92
Linux "time" command output redirection 16 224
UNIX Script. Send email if failure 8 64
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question