I dont like to have the ENTIRE ports tree in my /usr/ports. For those like me, read “Hack 82 Build a Port Without the Ports Tree” from Dru Lavignes book “BSD Hacks”.
I use a very simple tool to install applications from ports on my FreeBSD machine.
It is called porteasy. (really is easy). It is located at /usr/ports/ports-mgmt/porteasy
http://www.freebsd.org/cgi/cvsweb.cgi/ports/ports-mgmt/porteasy/
# pkg_add -r porteasy Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.4-release/Latest/porteasy.tbz... Done. # pkg_info | grep porte porteasy-2.8.4 A tool for fetching and building ports
From man porteasy (read it pls):
The port names listed on the command line may be either unqualified or
fully qualified. A fully qualified port name is the path to the port
directory relative to the root of the ports tree (i.e. the port's cate-
gory and name separated by a slash). An unqualified port name is the
name of the package built by the intended port, or part of that name.
Unqualified names need to be looked up in the ports index, which is usu-
ally slightly out of date, so fully qualified names should be used when-
ever possible.
How to connect to an anonymous cvs server
To add an anonymous cvs server as an environment variable (there is a list to pick from, but sometimes some dont work :( ): http://www.freebsd.org/doc/en/books/handbook/anoncvs.html (this is for bash shells, if you use csh you use setenv CVSROOT blablabla)
#export CVSROOT=:pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs #touch /root/.cvspass #cvs login (password is anoncvs)
To add an anonymous cvs server as an environment variable (there is a list to pick from, but sometimes some dont work :( ): http://www.freebsd.org/doc/en/books/handbook/anoncvs.html (this is for bash shells, if you use csh you use setenv CVSROOT blablabla)
- export CVSROOT=:pserver:anoncvs@anoncvs.fr.FreeBSD.org:/home/ncvs
- touch /root/.cvspass
- cvs login
(password is anoncvs)
” Let’s assume you have a minimum install and don’t have an existing
/usr/ports directory structure. To install a port, you need the Mk and
Templates directories as well as the port’s Makefile. Use the cvs
checkout command to retrieve the necessary files from the CVS server: ”
To “check out a ports skeleton” :
# cd /usr # cvs checkout -A -P -l ports/Mk
cvs checkout: Updating ports/Mk U ports/Mk/bsd.apache.mk U ports/Mk/bsd.autotools.mk U ports/Mk/bsd.cmake.mk …….some 41 lines….. U ports/Mk/bsd.xfce.mk U ports/Mk/bsd.xorg.mk
- cvs checkout -A -P -l ports/Templates
U ports/Templates/BSD.local.dist U ports/Templates/README.category U ports/Templates/README.port U ports/Templates/README.top U ports/Templates/config.guess U ports/Templates/config.sub
The book also describes how to find each ports dependencies. Go read the book!
To install a port with porteasy :
- cd /usr
- porteasy -u shells/bash
This will retirieve the e2fsprogs port AND its dependencies.
(Sometimes not ALL dependencies are downloaded so you may have to do
porteasy -u some-dependency) Now you can :
- cd /usr/ports/sysutils/e2fsprogs (OR WHATEVER PORT)
- make install
You can install porteasy with porteasy :))
- cd /usr
/usr# porteasy -u ports-mgmt/porteasy ? INDEX-6 ? INDEX-6.bz2 P UPDATING U ports-mgmt/Makefile U porteasy/Makefile U porteasy/pkg-descr U porteasy/pkg-plist U porteasy/src/porteasy.8 U porteasy/src/porteasy.pl P lang/Makefile P perl5.8/Makefile U perl5.8/files/patch-bug64562
This will create the ports-mgmt directory in /usr/ports. Now install:
- cd /usr/ports/ports-mgmt/porteasy
- make
===> Extracting for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 – found ===> Patching for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 – found
- make install
===> Installing for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 – found ===> Generating temporary packing list ===> Checking if ports-mgmt/porteasy already installed ===> Compressing manual pages for porteasy-2.8.4 ===> Registering installation for porteasy-2.8.4
porteasy -Iu should update all ports(?)
To update the sources of your FreeBSD system you can use
cvsup. You can install cvsup using porteasy from ports from
/usr/ports/net/cvsup-without-gui.
/usr # porteasy -u net/cvsup-without-gui
To use cvsup you need a configuration file called a supfile.
This file configures WHAT you want to update. A supfile that updates
the sources of your system to FreeBSD 6.4 :
- default host=cvsup.at.FreeBSD.org
- default base=/usr/local/etc/cvsup
- default prefix=/usr
- default release=cvs tag=RELENG_6_4
- default delete use-rel-suffix
- default compress
src-all
- mkdir /usr/local/etc/cvsup
- cvsup -L2 -g /path/to/supfile
… .. .
/usr/src/sys/amd64/conf
ident XXX device pf device pflog device pfsync options ALTQ options ALTQ_CBQ # Class Bases Queuing (CBQ) options ALTQ_RED # Random Early Detection (RED) options ALTQ_RIO # RED In/Out options ALTQ_HFSC # Hierarchical Packet Scheduler (HFSC) options ALTQ_PRIQ # Priority Queuing (PRIQ) options ALTQ_NOPCC # Required for SMP build
- cd /usr/src/
- make buildworld
- make buildkernel KERNCONF=myKERNEL
- make installkernel KERNCONF=myKERNEL
shutdown -r now mount -a -t ufs mergemaster -p
cd /usr/src make installworld
mergemaster -i
“ Let’s assume you have a minimum install and don’t
have an existing /usr/ports directory structure. To install a port, you
need the Mk and Templates directories as well as the port’s Makefile.
Use the cvs checkout command to retrieve the necessary files from the
CVS server: ”
To “check out a ports skeleton” :
# cd /usr # cvs checkout -A -P -l ports/Mk cvs checkout: Updating ports/Mk U ports/Mk/bsd.apache.mk U ports/Mk/bsd.autotools.mk U ports/Mk/bsd.cmake.mk .......some 41 lines..... U ports/Mk/bsd.xfce.mk U ports/Mk/bsd.xorg.mk # cvs checkout -A -P -l ports/Templates U ports/Templates/BSD.local.dist U ports/Templates/README.category U ports/Templates/README.port U ports/Templates/README.top U ports/Templates/config.guess U ports/Templates/config.sub
The book also describes how to find each ports dependencies. Go read the book!
To install a port with porteasy :
# cd /usr # porteasy -u shells/bash
This will retirieve the e2fsprogs port AND its dependencies. (Sometimes not ALL dependencies are downloaded so you may have to do porteasy -u some-dependency) Now you can :
# cd /usr/ports/sysutils/e2fsprogs (OR WHATEVER PORT) #make install
You can install porteasy with porteasy :))
#cd /usr /usr# porteasy -u ports-mgmt/porteasy ? INDEX-6 ? INDEX-6.bz2 P UPDATING U ports-mgmt/Makefile U porteasy/Makefile U porteasy/pkg-descr U porteasy/pkg-plist U porteasy/src/porteasy.8 U porteasy/src/porteasy.pl P lang/Makefile P perl5.8/Makefile U perl5.8/files/patch-bug64562
This will create the ports-mgmt directory in /usr/ports. Now install:
# cd /usr/ports/ports-mgmt/porteasy #make ===> Extracting for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 - found ===> Patching for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 - found #make install ===> Installing for porteasy-2.8.4 ===> porteasy-2.8.4 depends on file: /usr/local/bin/perl5.8.8 - found ===> Generating temporary packing list ===> Checking if ports-mgmt/porteasy already installed ===> Compressing manual pages for porteasy-2.8.4 ===> Registering installation for porteasy-2.8.4
porteasy -Iu should update all ports(?)
Go buy http://www.amazon.com/BSD-Hacks-Dru-Lavigne/dp/0596006799 lots of cool stuff from Dru Lavigne!