# Making packages available



## AngusBuchanan (Feb 6, 2011)

Hello all,

Having built some packages with portmaster, I am now trying to share them with other machines on the network.  For a first try, I just tarred up /usr/ports/packages and copied it to a test box.

However, despite setting PKG_PATH, I seemed only to be able to install the package by the *exact* name, including .tbz, from within the directory.  All else fails:


```
freebsdtest# pkg_add ruby19-iconv-1.9.2.0,1.tbz
pkg_add: can't stat package file 'ruby19-iconv-1.9.2.0,1.tbz'
freebsdtest# pkg_add ruby19-iconv-1.9.2.0,1
pkg_add: can't stat package file 'ruby19-iconv-1.9.2.0,1'
freebsdtest# pkg_add ruby19-iconv-1.9.2
pkg_add: can't stat package file 'ruby19-iconv-1.9.2'
freebsdtest# pkg_add ruby19-iconv
pkg_add: can't stat package file 'ruby19-iconv'
freebsdtest# pkg_add ruby19
pkg_add: can't stat package file 'ruby19'
freebsdtest# pkg_add ruby
pkg_add: can't stat package file 'ruby'
freebsdtest# ls -l /usr/ports/packages/All/ruby*
-rw-r--r--  1 root  wheel  5221718 Feb  6 11:47 /usr/ports/packages/All/ruby-1.9.2.0,1.tbz
-rw-r--r--  1 root  wheel    14696 Feb  6 11:47 /usr/ports/packages/All/ruby19-iconv-1.9.2.0,1.tbz

freebsdtest# set PKG_PATH=/usr/ports/packages/All
freebsdtest# echo $PKG_PATH
/usr/ports/packages/All
freebsdtest# pkg_add ruby
pkg_add: can't stat package file 'ruby'
freebsdtest# pkg_add ruby19-iconv-1.9.2.0,1.tbz
pkg_add: can't stat package file 'ruby19-iconv-1.9.2.0,1.tbz'
freebsdtest# pkg_add ruby19-iconv-1.9.2.0,1
pkg_add: can't stat package file 'ruby19-iconv-1.9.2.0,1'
freebsdtest# pkg_add ruby19-iconv
pkg_add: can't stat package file 'ruby19-iconv'
freebsdtest#
```


I then served /usr/ports/packages/All over HTTP and set my PACKAGESITE to that URL, and again was only able to install with *pkg_add -r* with the exact name of the file.

I am sure that normally I can run *pkg_add -r <some short name>* and it installs.  How does this work?  Is there some kind of index?  I recall reading about some symlinks in a Latest directory, and someone pointed me at Tinderbox, but that seems hugely involved for my current use case.

Any recommendations?  I just want to be able to share a dozen or so custom packages amongst a stack of machines in a datacentre, and be able to install them with *pkg_add -r*.

Thanks in advance.


----------



## Beastie (Feb 6, 2011)

AngusBuchanan said:
			
		

> I am sure that normally I can run pkg_add -r <some short name> and it installs.  How does this work?  Is there some kind of index?  I recall reading about some symlinks in a Latest directory, and someone pointed me at Tinderbox, but that seems hugely involved for my current use case.


This.

```
ftp> pwd
Remote directory: /pub/FreeBSD/ports/i386/packages-8.1-release/Latest
ftp> ls vim*
229 Entering Extended Passive Mode (|||28161|).
150 Here comes the directory listing.
lrwxr-xr-x    1 110      1002           27 Jun 11  2010 vim-lite.tbz -> ../All/vim-lite-7.2.411.tbz
[...]
```


----------



## AngusBuchanan (Feb 7, 2011)

OK - so there should be symlinks.  Is there a script that does this?  I notice there's s make target for latest link.   It seems likely that there's a (semi)automated way to do this.


----------



## SirDice (Feb 7, 2011)

If you build packages yourself the $PORTSDIR/packages/Latest/ directory will be populated automatically.


----------

