Trawling The FreeBSD Ports Collection - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Trawling The FreeBSD Ports Collection

Description:

Do 'make build' in the port directory to compile the application ... Compile only the features you want to reduce dependencies (See portname/Makefile) ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 14
Provided by: foss
Category:

less

Transcript and Presenter's Notes

Title: Trawling The FreeBSD Ports Collection


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

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
What is a port?
  • 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
  • Makefile files/ pkg-install pkg-plist
  • distinfo pkg-descr pkg-message scripts/

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 namebash
  • make search keyftp

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'gt'WITHOUT_PILOTyes',
  • 'net/gaim' gt 'WITHOUT_GNOMEyes',
  • 'emulators/wine' gt 'DEBUGyes',

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

13
Questions?
  • Thank You
  • Shanker Balan
  • Exocore Consulting
  • Bangalore
  • http//shankerbalan.com/
Write a Comment
User Comments (0)
About PowerShow.com