sobota 11. februára 2012

Create and update ports tree

You don't have ports tree yet because of minimal install at the beginning. For downloading and updating ports tree you need port "cvsup". But how to install port without having ports tree?

pkg_add -r cvsup-without-gui
"-r" causes to fetch port from server. Note that ports from "pkg" utility are pre-build. They are already compiled.

After each installation use "rehash" command otherwise your system won't be aware of new commands arising from new installed ports/packages.
"-r" downloads from default server. In order to achieve reliability, lower delay, speed improvement, we can change the server to different. Put new variable to shell environment. Add following to etc. ".tcshrc":
setenv  PACKAGEROOT ftp://ftp2.sk.freebsd.org

Check man for cvsup. First time your ports tree is built, this process takes long. Additional update of tree takes much less. For creating and updating use:
cvsup -L 2 [path to ports-supfile]



At first, copy ports-supfile from "/usr/share/examples/cvsup/ports-supfile" to where you want. Afterwards do etc. chmod 600 for copied file. Than edit it:
(I think the only value you have to change is cvsup server)
*default host=cvsup.sk.FreeBSD.org

Now use mentioned cvsup command. It will build complete ports tree so be patient. To reduce this time plus make it more effective, you don't need some branches of ports tree like "astro", "games" ports, exotic language ports and so on. To refuse these do following before first use of cvsup command:
mkdir /var/db/sup - you can use appropriate chmod
cp /usr/share/examples/cvsup/refuse /var/db/sup + opt. chmod
Add following to "refuse" file: (this is what I have in there)
doc/bn_*
doc/da_*
doc/de_*
doc/el_*
doc/es_*
doc/fr_*
doc/hu_*
doc/id_*
doc/it_*
doc/ja_*
doc/mn_*
doc/nl_*
doc/no_*
doc/pl_*
doc/pt_*
doc/ro_*
doc/ru_*
doc/sr_*
doc/tr_*
doc/zh_*
ports/arabic
ports/astro
ports/biology
ports/finance
ports/chinese
ports/french
ports/german
ports/hebrew
ports/hungarian
ports/japanese
ports/korean
ports/polish
ports/portuguese
ports/russian
ports/ukrainian
ports/vietnamese

So many needless branches. This method (with refuse file) have one disadvantage. Commonly (without refuse file), after each update, you run "make index" command in "/usr/ports" directory to build indexed database used etc. for searching in tree hierarchy. This command takes long, but it works.
This command won't work if you use "refuse" file. The workaround is to fetch built index file. This is almost instant compared to "make index" but can have disadvantages with up to date issues. I have not noticed this theses issues so far...
To fetch built index file use following in "/usr/ports":
make fetchindex

After all procedure, you can try to "make" some port from ports tree. Very useful port is Midnight Commander similar to Norton(Total) Commander. I use light version.
Go to "/usr/ports" and type:
make search name=mc-light - useful command
(you can use also make search key=....)
This search command spits out information about particular port. Check the "path" and go there. 
Type "make install clean" in appropriate direcotry.
(In this example /usr/ports/misc/mc-light)

If you started from minimal install, you won't have installed anything. So etc. within "mc" making, other dependencies will install as well (libraries, fonts, prog. languages and so). It's often that dependencies have own dependencies so mainly first "installs" are annoying. You will be asked during building for building options. If you are not familiar with them, google them or use default one.
After mc-light have passed successfully, type:
rehash - see beginning of this article
mc - this starts Midnight Commander

For more information check handbook.









Žiadne komentáre:

Zverejnenie komentára