# Installing only ports requirements



## usersend (Jul 19, 2010)

Hi.

Situation is that I would like to install only requirements for ports software, for example requirements for php package but not itself, is there such option available? 

Didn't find answer using google maybe just using wrong keywords...


----------



## DutchDaemon (Jul 19, 2010)

If you can handle some scripting, the [cmd=]make all-depends-list[/cmd] looks like a good place to start.

E.g.
	
	



```
$ cd /usr/ports/lang/php5
$ make all-depends-list


/usr/ports/devel/autoconf262
/usr/ports/devel/pkg-config
/usr/ports/devel/pcre
/usr/ports/textproc/libxml2
/usr/ports/lang/perl5.12
/usr/ports/devel/m4
/usr/ports/misc/help2man
/usr/ports/devel/gmake
/usr/ports/devel/autoconf-wrapper
/usr/ports/converters/libiconv
/usr/ports/devel/libsigsegv
/usr/ports/devel/p5-Locale-gettext
/usr/ports/devel/gettext
/usr/ports/devel/libtool22
```

Strip off '/usr/ports/' and feed the rest to e.g. portmaster.


----------



## SirDice (Jul 19, 2010)

Mind you, those dependencies could have dependencies of their own.


----------



## usersend (Jul 19, 2010)

*DutchDaemon*, thank You! it is exactly what i was looking for

i just expected to see some mention of that at http://www.freebsd.org/doc/en/books/handbook/ports-using.html or somewhere around


----------



## SirDice (Jul 19, 2010)

usersend said:
			
		

> i just expected to see some mention of that at http://www.freebsd.org/doc/en/books/handbook/ports-using.html or somewhere around


See ports(7). Not everything fits in the handbook. It still has to be readable, even for novices 

It even says so in line 2:


> The detailed description of available make targets and environment variables is available in ports(7).



:e


----------



## usersend (Jul 19, 2010)

for next person who stumbles upon same question


```
#!/usr/local/bin/bash
cd /usr/ports/*/$1
deps=`make all-depends-list`
for dep in $deps
do
cd $dep && make && make install &&  make clean
done
```

[CMD="./d.sh php5"][/CMD] or anything else
works like a charm


----------



## ckester (Jul 19, 2010)

Not sure what invoking three separate make processes gets you.

I'd replace the next to last line with:


```
cd $dep && make install clean
```


----------



## wblock@ (Jul 19, 2010)

usersend said:
			
		

> for next person who stumbles upon same question
> 
> 
> ```
> ...



How about just:
`# make depends`


----------



## DutchDaemon (Jul 19, 2010)

Yeah, 'make depends' probably does the same


----------

