インストール

http://d.hatena.ne.jp/faw/20090109 を参考にインストール

ports tree 取得

$ mkdir -p ~/usr/local/var/db/portsnap ~/usr/ports/distfiles
$ vi ~/usr/ports/portsnap.conf
$ portsnap -f ~/usr/ports/portsnap.conf fetch extract update
  • ~/usr/ports/portsnap.conf

    • your_user_name を変更する
    # Default directory where compressed snapshots are stored.
    WORKDIR=/home/your_user_name/usr/local/var/db/portsnap
    
    # Default location of the ports tree (target for "update" and  "extract").
    PORTSDIR=/home/your_user_name/usr/ports
    
    # Server or server pool from which to fetch updates.  You can change
    # this to point at a specific server if you want, but in most cases
    # using a "nearby" server won't provide a measurable improvement in
    # performance.
    SERVERNAME=portsnap.FreeBSD.org
    
    # Trusted keyprint.  Changing this is a Bad Idea unless you've received
    # a PGP-signed email from <security-officer@FreeBSD.org> telling you to
    # change it and explaining why.
    KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3aede40c98633216c330
    
    # Example of ignoring parts of the ports tree.  If you know that you
    # absolutely will not need certain parts of the tree, this will save
    # some bandwidth and disk space.  See the manual page for more details.
    #
    # WARNING: Working with an incomplete ports tree is not supported and
    # can cause problems due to missing dependencies.  If you have REFUSE
    # directives and experience problems, remove them and update your tree
    # before asking for help on the mailing lists.
    #
    REFUSE arabic chinese french german hebrew hungarian
    REFUSE korean polish portuguese russian ukrainian vietnamese
    REFUSE x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes x11-toolkits x11-wm
    REFUSE palm cad astro

インストール

  1. ディレクトリ作成
    $ mkdir -p ~/usr/local/{bin,sbin,etc,lib,tmp/dist,tmp/work,var/db/pkg,var/db/ports,var/run}
    
  2. ~/.profile に以下を追加する

    export INSTALL_AS_USER=yes
    export PREFIX=${HOME}/usr/local
    export LOCALBASE=${HOME}/usr/local
    export PKG_DBDIR=${LOCALBASE}/var/db/pkg
    export PKG_TMPDIR=${LOCALBASE}/tmp/
    export PORT_DBDIR=${LOCALBASE}/var/db/pkg
    export DISTDIR=${LOCALBASE}/tmp/dist
    export WRKDIRPREFIX=${LOCALBASE}/tmp/work
    export PORTSDIR=${HOME}/usr/ports
    export PKGTOOLS_CONF=${LOCALBASE}/etc/pkgtools.conf
    export DEPENDS_TARGET='install clean'
    
    export X11BASE=${LOCALBASE}
    
    export PKG_CONFIG_PATH="$HOME/usr/local/lib/pkgconfig:$HOME/usr/local/libdata/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig"
    
    # Set user and group variables to ourself
    export BINOWN=`whoami`
    export BINGRP=`id -G -n ${BINOWN}`
    export SHAREOWN=${BINOWN}
    export SHAREGRP=${BINGRP}
    export MANOWN=${BINOWN}
    export MANGRP=${BINGRP}
    
    # Make sure files are installed with correct default permissions
    export BINMODE=744
    export SHAREMODE=644
    export MANMODE=644
    
    # Make sure we don't really try to become root, but just execute everything as ourselves
    export SU_CMD="sh -c"
    
    # Make sure the systemdefault make.conf is not read
    export __MAKE_CONF=${LOCALBASE}/etc/make.conf
    
    # Keep our own version of ldconfig hints
    export LDCONFIG="/sbin/ldconfig -i -f ${LOCALBASE}/var/run/ld-elf.so.hints"
    #export LDCONFIG="/sbin/ldconfig -f=${LOCALBASE}/var/run/ld-elf.so.hints -i -R=${LOCALBASE}/etc/ld-elf.so.conf "
    export LD_LIBRARY_PATH=${LOCALBASE}/lib
    export LD_RUN_PATH=${LOCALBASE}/lib
    
    export PATH=${LOCALBASE}/bin:${LOCALBASE}/sbin:${PATH}
    export MANPATH_MAP=${LOCALBASE}/bin:${LOCALBASE}/man
    
    # Set application specific variables to make sure it doesn't pick up things from the main system
    export APXS=${LOCALBASE}/sbin/apxs
    export PERL=${LOCALBASE}/bin/perl
    export PERL5=${PERL}
    export SITE_PERL=${LOCALBASE}/lib/perl5/site_perl/5.8.8
    export SITE_PERL5=${SITE_PERL}
    export PERL_VERSION=5.8.8
    export PERL_VER=${PERL_VERSION}
    
  3. 以下を実行
    $ ldconfig -r | awk '/search/ {print $3}' | tr ":" "\n" > ~/usr/local/etc/ld-elf.so.conf
    $ echo ${HOME}/usr/local/lib >> ~/usr/local/etc/ld-elf.so.conf

使用方法

  • /usr/ports 以下のインストールしたいパッケージのディレクトリへ移動して make install

$ find ~/usr/ports -name "vim*"
$ cd ~/usr/ports/editors/vim
$ make install

パッケージ

インストールできたパッケージ

  • vim-lite
  • tree

インストールできないパッケージ

  • vim
  • vim5
  • subversion
  • subversion-freebsd

コメント