# Ports or Packages?



## valsorym (Sep 12, 2011)

Hi all,
I have a question: How you are think, how is way the best?

I have information that install programs from the ports, they are compiled under the platform.

But I talked to the users of Gentoo Linux - and they asked me a question: Where and how do I set up the compilation options (which I have the processor, RAM, etc. all with regard to optimization)?

Then I thought - nowhere!
Perhaps the installation of ports, without the optimization, the same as installing a package.

Then I began to read. And prishol to the conclusion that the installation must be carried out not as:

```
# make && make install clean
```

and as:

```
# make
```
 
then go to the. / work directory and edit Makefile.
after:

```
# install clean
```

This is the correct method of optimization?
Or is it there is no difference between ports and packages? (in the end).
Or FreeBSD itself determines the type of device and optimizes its own?


----------



## zeiz (Sep 12, 2011)

First of all 
`# [b]make[/b] install clean`
since the command is make and not install
The sequence like

```
# make clean
# make
# make install clean
```
also works well especially when one has problem with building for some reasons.

Install through packages is much faster and if I don't care about building options I'd rather use packages that were baked with default options. 
However when packages are not available or I need to change some options the building from source is right choice. Sometimes a package doesn't go through for some reasons and then building from source can fix the problem.

Despite I know that many FreeBSD users on this forum always prefer source over packages, I don't see any sense to build the same packages myself spending lots of time for that.
For example as I know OpenBSD even doesn't recommend building from source at all and provides all the packages built for its users.


----------



## wblock@ (Sep 12, 2011)

Ports that can benefit from custom CFLAGs and other optimizations generally set that themselves.

Editing a port after doing a make won't change what's already been built.  To be effective, editing should be done after make patch.

Effectiveness of optimization varies.  What are you trying to improve?


----------



## vermaden (Sep 12, 2011)

> Ports or Packages?


Both: http://forums.freebsd.org/showthread.php?t=26140

Use binary packages when available/possible, built from Ports when need to customize the features and/or need to fix security issues.


----------



## fonz (Sep 12, 2011)

doorways said:
			
		

> then go to the. / work directory and edit Makefile.
> after:
> 
> ```
> ...


No.

If you wish to set certain compiler flags for *every* port build, use /etc/make.conf. If you wish to set other options, such as support for this or that, or to turn features on or off (note that not all ports have something to configure in the first place), type `# make config`When you run `# make` for the first time in a particular port's directory this is already done automatically, if there is anything to configure.

You shouldn't _normally_ have any business in a port's work/ directory, unless you're modifying the source code itself and/or trying to fix a broken port.

Fonz


----------



## valsorym (Sep 12, 2011)

> Originally Posted by *wblock*.
> What are you trying to improve?



Nothing special. Just think what to install libreoffice  of the ports (10 hour) where you can set of the packages (one hour ).

Thanks all. I understand!


----------



## fonz (Sep 12, 2011)

doorways said:
			
		

> Just think what to install libreoffice  of the ports (10 hour) where you can set of the packages (one hour ).


Some things are indeed (for most people) better installed from packages than from ports. This includes KDE/GNOME, OpenOffice.Org/LibreOffice and such. Some say this also includes X.org, but personally I find that borderline.

Fonz


----------

