# Create tbz package



## wirasto (Jun 7, 2009)

I want deploy my little application in tbz package. How create tbz  (freebsd) package ?


----------



## hydra (Jun 7, 2009)

You can create a port:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html

Then just a make package will do I suppose.


----------



## phoenix (Jun 8, 2009)

For ports that have not been installed yet:

```
# cd /usr/ports/category/portname
# make package
```

For ports that are already installed:

```
# pkg_create -b portname
```

Both of those will create a portname-version.tbz in the current directory.


----------



## wirasto (Jun 9, 2009)

```
# pkg_create -bx portname
pkg_create: can't find package 'x' installed!

# pkg_create -b portname
tar: Removing leading '/' from member names
```

Just example 

```
# ls | grep portname
portname-version.tbz
```


----------



## phoenix (Jun 9, 2009)

Hrm, seems pkg_create doesn't support -x like the rest of the pkg_* tools.  How bizarre.  For the rest of the pkg_* tools, adding -x does a "wildcard" search for matching installed packages (-x kde would match all packages starting with kde).

Thanks for the update.


----------



## LateNiteTV (Jun 9, 2009)

soooooooo i built the xorg metaport from source which pulled in all that other stuff (drivers, xorg-apps, xorg-server, etc.), can i do pkg_create-b xorg-version and have it create a package for xorg that includes all the dependencies etc and the options that i set when i built it?
sorry, i would try it but im at work and dont have access to my freebsd computer.


----------



## phoenix (Jun 9, 2009)

Adding *-R* should do what you want.


----------



## cwthfly (Sep 9, 2010)

how if the ports get too old version, while I need the latest version of app? I have got the src-code, can i just do make package to get the package?


----------

