# Ports: custom-build packages



## mah454 (Apr 28, 2013)

Hello 

I want to build some package with ports, but I need to build and install without some parameters. For example build lsof or bash: 
without documents;
without manual pages and info pages;
other things.
Note: build/install with minimal options. How can I do this?


----------



## lubnet (Apr 28, 2013)

```
cd /usr/ports/someport
make config
```

If there are some configuration options you see it by `make config` command.


----------



## jozze (Apr 28, 2013)

I don't really understand what you want, but I see two possible things you might want to check out. If you want to ...
1) ... set the compilation flags: use `# make config-recursive` && friends,
2) ... change the internals of the port itself: write a custom patch.

1) setting the compile time options:
Usually, you set those things (compile time flags) when you run `# make config`, (or `# make config-recursive`, if you want to resolve for dependencies in one go as well) or a similar utility (e.g. ports-mgmt/portupgrade, ports-mgmt/portmaster), however, if that is insufficient for your needs, you might want to write your own custom patches.

2) writing a custom patch:
First, I'd check this out:
http://www.freebsd.org/doc/en/books/porters-handbook/slow.html and read as much as I needed, to know and understand what I'm doing.

I dunno where I read that, maybe in this very handbook (although I think it was the general FreeBSD handbook), after your patch is ready, just put it into /usr/ports/<path_the_port_I_want>/files/, and the patch has to have a name of the form patch*. When you run `# make`, those patches will be executed in an alphabetical order.

So maybe name them like patch-z-<my name>, so they won't interrupt any existing patches. So you can write a patch for the Makefile, ordering it to remove any generated documentation. However, I would discourage you from doing that, unless you know what you're doing, because it's fairly easy to break your ports.


----------



## SirDice (May 1, 2013)

Building the port with NOPORTDOCS should prevent the build of manual pages and other documentation. 

Have a look at the port's Makefile, not all options have a neat option screen.


----------



## ShelLuser (May 2, 2013)

In addition to the above comments I'd also like to point your attention to /etc/make.conf. In this file you can set options which will then be applied on a system-wide basis. Whether this is usable or not heavily depends on the issue at hand of course, because this file is system-wide its options apply to _all_ software which you compile yourself.


----------

