Solved

Using FreeBSD's "ports"

Posted on 2001-06-09
10
348 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

860 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