• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 360
  • Last Modified:

Using FreeBSD's "ports"

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
kenysc
Asked:
kenysc
  • 4
  • 3
  • 3
1 Solution
 
jlevieCommented:
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
 
kenyscAuthor Commented:
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
 
jlevieCommented:
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
Technology Partners: 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!

 
VictorZCommented:
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
 
VictorZCommented:
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
 
VictorZCommented:
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
 
kenyscAuthor Commented:
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
 
jlevieCommented:
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
 
kenyscAuthor Commented:
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
 
jlevieCommented:
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now