Solved

Using FreeBSD's "ports"

Posted on 2001-06-09
10
345 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now