# What defines whether a port becomes a package?



## ced (Dec 2, 2016)

When browsing the ports, I see things like ElasticSearch 5, or Mongo 3, whereas the packages for these version don't exist.

Wondering what is the process/requirement/step for a port to become available as a package?

Thanks a lot for your insights!


----------



## Beastie (Dec 2, 2016)

ced said:


> When browsing the ports, I see things like ElasticSearch 5, or Mongo 3, whereas the packages for these version don't exist.


Well, `pkg install -n elasticsearch5` says:

```
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        elasticsearch5: 5.0.0
        openjdk8: 8.112.16
        java-zoneinfo: 2016.g
        alsa-lib: 1.1.2
        javavmwrapper: 2.5_2
```
So I guess _there is_ a package for it.



ced said:


> Wondering what is the process/requirement/step for a port to become available as a package?


Probably not much more than being able to be built successfully and not having any licensing restrictions.


----------



## wblock@ (Dec 2, 2016)

pkg is the command name.  What it uses are called "packages".


----------



## ced (Dec 2, 2016)

What version are you running? I'm running 11.0-RELEASE and pkg --help doesn't show what option -n is used for nor does the man page?
Anyway, when I do it I get:


```
# pkg install -n elasticsearch5
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    6 MiB 722.1kB/s    00:08
Processing entries: 100%
FreeBSD repository update completed. 25389 packages processed.
Updating database digests format: 100%
pkg: No packages available to install matching 'elasticsearch5' have been found in the repositories
```


----------



## chrbr (Dec 2, 2016)

Please see pkg-install(8). The option -n is a dry run which just shows what would happen. By the way, the man pages with the options of pkg(8) are organized like that. This is not obvious but mentioned in the last lines of pkg(8).


----------



## Beastie (Dec 2, 2016)

ced said:


> What version are you running? I'm running 11.0-RELEASE and pkg --help doesn't show what option -n is used for nor does the man page?


It's dry-run mode, just to see what it would install but without actually installing anything. See `pkg help install`.



ced said:


> Anyway, when I do it I get:
> 
> 
> ```
> ...


For some reason, it seems packages are not available past version 2 in the -RELEASE repository.
However it seems to be available in the -STABLE repository.
STABLE is more up to date anyway, so use that instead.

/usr/local/etc/pkg/repos/FreeBSD.conf:

```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
```


----------



## ced (Dec 2, 2016)

Thanks for that suggestion but it's not an answer to my question. I see that pkg has no installable package available for things like ES5 whereas I can find a port for it. So why is this? What are the requirements for the port to become available as precompiled package?


----------



## marino (Dec 2, 2016)

there are four common reasons for that.

license forbids making a package
the port doesn't build on that architecture and is marked as such
the port failed to build on the cluster machine
the port has been marked broken
for 1, 2, and 4, often this is shown on http://freshports.org
http://portsmon.freebsd.org/portoverview.py can show errors for #3


----------



## ced (Dec 2, 2016)

Perfect! Thanks a lot. I'll check freshports. I'm having a hung it'll be 3 or 4 as it fails to build on openjdk..


----------



## Beastie (Dec 2, 2016)

ced said:


> Thanks for that suggestion but it's not an answer to my question. I see that pkg has no installable package available for things like ES5 whereas I can find a port for it. So why is this? What are the requirements for the port to become available as precompiled package?


Already answered in post #2...


----------



## ASX (Dec 2, 2016)

ced said:


> Thanks for that suggestion but it's not an answer to my question. I see that *pkg has no installable package available for things like ES5* whereas I can find a port for it. So why is this?


In case you missed it, from the previous post, ES5 is available as a package in "latest" repository, but not in "quartely" repository.
FreeBSD 11.0-RELEASE default to "quarterly" repository, where ports are implitcitely "latest".


----------



## ced (Dec 2, 2016)

Aha.. I'll have to read up on how to change that. 

Interesting.. thanks guys. 

Could anyone educate me how I can see the state of the package on fresh ports? I'm looking at it but can't see where I could verify if the clusterbuild succeeded or not?


----------



## ANOKNUSA (Dec 3, 2016)

ced said:


> Aha.. I'll have to read up on how to change that.



Just be aware that using the "latest" repository means your packages will work on a rolling-release model. The usual caveats for such a model apply.

I mention this because, while I mean no offense, it's pretty common for people who jump on rolling-release distribution platforms just to get the latest version of _one package_ to run into trouble with all their other packages.


----------



## Beastie (Dec 3, 2016)

ced said:


> Aha.. I'll have to read up on how to change that.


/usr/local/etc/pkg/repos/FreeBSD.conf:

```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
```



ced said:


> Could anyone educate me how I can see the state of the package on fresh ports? I'm looking at it but can't see where I could verify if the clusterbuild succeeded or not?


The PortsMon link.


----------

