1 / 13

Trawling The FreeBSD Ports Collection

Shanker Balan Exocore Consulting Bangalore http://shankerbalan.com/. Trawling The FreeBSD Ports Collection. Introduction. FreeBSD is a source based distribution Everything in FreeBSD system is built from “base” (/usr/src) Kernel, libc, GCC tool chain, Sendmail are all “base”

dionne
Download Presentation

Trawling The FreeBSD Ports Collection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Shanker Balan Exocore Consulting Bangalore http://shankerbalan.com/ Trawling The FreeBSD Ports Collection

  2. Introduction • FreeBSD is a source based distribution • Everything in FreeBSD system is built from “base” (/usr/src) • Kernel, libc, GCC tool chain, Sendmail are all “base” • Contributed applications are knows as “ports” (/usr/ports) • Applications not part of “base” are installed from “ports”

  3. Overview of Software Installation • Traditional way of installing 3rd party software under UNIX • “wget http://gaim.sf.net/gaim-0.72.tar.bz2” • “tar jxvf gaim-0.72.tar.bz2” • “less INSTALL && ./configure && make” • “make test && make install” • And the FreeBSD way... • Install from “packages” • Install from “ports” • Over 9200 applications are available this was

  4. What is a “package”? • A “package” is like an “RPM” or a “DEB” • Single file which must be downloaded from the site • Contains pre-compiled copies of all the applications, as well as cfg files, doc etc • Dependency information for the application • To install a package from ftp.freebsd.org • “pkg_add -r bash”

  5. root# cd /usr/ports; ls devel/ audio/ multimedia/ x11/ mail/ www/ net/ root# cd mail/; ls postfix/ mutt/ qmail/ evolution/ fetchmail/ procmail/ root# cd postfix/; ls Makefilefiles/ pkg-install pkg-plist distinfo pkg-descr pkg-message scripts/ What is a “port”?

  6. Ports (contd) • Each “port” contains patches necessary to compile and run the original application on BSD • Do “make build” in the port directory to compile the application • The “Makefile” will fetch the src code from FTP or local disk • Unpack, apply patches and compile it • Do “make install” to install the application. • “make package” will create a binary package for the port

  7. Ports Vs Packages • Package Benefits • Compressed package is typically smaller than a compressed source tarball • Mozilla, GNOME, KDE, OpenOffice take a long time (and disk space) to compile • Packages do not require compilation knowledge • Ports Benefits • Some people dont trust binary distributions • Can tweak the compilation process for CPU (-march athlon) and compiler optimizations (-O2)

  8. Ports Benefits (contd) • User definable “./configure” options. Compile only the features you want to reduce dependencies (See portname/Makefile) • Build Gaim without GNOME support • Build Ghostscript w/o X11 support • Easy to apply local patchsets and build applications

  9. Finding Your Application • Find the latest ported apps at • http://freshports.org • http://www.freebsd.org/ports/ • Or locally using keywords • “cd /usr/ports” • “make search name=”bash”” • “make search key=”ftp””

  10. Updating the ports collection • The “CVSup” Method • CVSup is a network distribution method for CVS repositories • Install “net/cvsup” • Copy /usr/share/examples/cvsup/ports-supfile to /root • Edit ports-supfile and set it to use the closest cvsup server • Run “cvsup -g /root/ports-supfile” • /usr/ports will now be updated with all the recent changes

  11. Upgrading Ports • Using “portupgrade” • Install “sysutils/portupgrade” • “portupgrade -a -i” • Specify compile time options in /usr/local/etc/pkgtools.conf MAKE_ARGS = { 'mail/evolution'=>'WITHOUT_PILOT=yes', 'net/gaim' => 'WITHOUT_GNOME=yes', 'emulators/wine' => 'DEBUG=yes', }

  12. Resources • The FreeBSD Hanbook: http://www.freebsd.org/doc/ • Manual pages • portupgrade(1) • ports(7) • pkg_add(1)

  13. Thank You Shanker Balan Exocore Consulting Bangalore http://shankerbalan.com/ Questions?

More Related