UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

MacPorts1.5をMacOS X 10.4.10にインストールする

MacPorts1.5をMacOS X 10.4.10にインストールする


0.改訂履歴

  • 2007.10.23 新規作成

1.はじめに

 このドキュメントでは,MacOS X 10.4.1に,MacPorts1.5をインストールする手順を説明する.  MacPortsとは,以前はDarwinPortsと呼ばれておりMacOS Xのフリー版カネールのDarwinプロジェクト用等にパッケージ管理ツールとして用意されていたものが,Darwinプロジェクトが終了した事によって 名前を変えたもの. たとえるならRedHatのRPMのようなもので,UNIX系のアプリケーション,ライブラリ等が3000個以上準備されており,簡 単にインストール,アップグレードが可能となっている.

 事前に,次のような環境が必要である.

  • Mac用の開発ツールであるXcode
    • OSのインストールディスクに付属
  • X11とX11SDK
    • OSのインストールディスクに付属

2.モジュールの入手とインストール

  • 以下の公式サイトからダウンロードする.
  • 利用しているMacOS Xのバージョン別に,10.3用と10.4用が用意されているので,注意する.
  • 今回は10.4対応用を利用する.
  • インストールしたモジュールは,次の通り.

  • ディスクイメージを開く.

  • インストーラを起動する.

  • この後は,淡々と絵の通り.

  • MacPortsを起動して確認してみる.
macbook3:/Users/ujpadmin root# port                  
MacPorts 1.5
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/ujpadmin] >
  • quitで終了.

3.selfupdateを実行する

  • 次に,MacPorts本体を最新版にアップデートする.
macbook3:/Users/ujpadmin root# /opt/local/bin/port -v selfupdate
Synchronizing from rsync://rsync.macports.org/release/ports/
rsync: failed to connect to rsync.macports.org: Operation timed out (60) rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-24.1/
rsync/clientserver.c(94) Error: /opt/local/bin/port: selfupdate failed: Couldn't sync the ports tre
e: sync failed doing rsync macbook3:/Users/ujpadmin root#
  • MacPortsはrsyncによってアップデートを管理しているが,rsyncが利用してる873 ポートに接続できない場合,上記のようなエラーがでる.
  • Firwallで許可をしたあと,再度実行してみる.
macbook3:/Users/ujpadmin root# /opt/local/bin/port -v selfupdate
Synchronizing from rsync://rsync.macports.org/release/ports/
receiving file list ... done
./
aqua/
aqua/Affiche/
aqua/AppKiDo/
aqua/AquaLess/
aqua/ArpSpyX/
aqua/AssignmentTrackerX/
aqua/BigSQL/
aqua/BigSQL/files/
aqua/BiggerSQL/
aqua/Books/
aqua/BwanaDik/
aqua/Cenon/
aqua/Cenon/files/
aqua/Chmox/
aqua/CocoaDialog/
aqua/CosmicDebris/
aqua/DesktopManager/
aqua/FFView/
aqua/FScript/
aqua/Freecell/
aqua/GPGAppKit/
aqua/Growl/

〜略〜


===> making install in src/port
cat ../../doc/prefix.mtree | /usr/sbin/mtree -U -d -e -p /opt/local > /dev/null
/usr/bin/install -c -d -o root -g admin -m 0775 /opt/local/bin
/usr/bin/install -c -o root -g admin -m 555 port portindex portmirror /opt/local
/bin/
cd /opt/local/bin && ln -s -f port portf
===> making install in src/programs
===> making install in src/programs/daemondo
/usr/bin/install -c -o root -g admin -m 555 build/daemondo /opt/local/bin

Congratulations, you have successfully installed the MacPorts system. To get the 
Portfiles and update the system, run:

sudo port selfupdate
Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation. Stray sources might have been left in the legacy /opt/local/var/db/dports directory after this upgrade, which moved most of what it could to /opt/local/ var/macports, so you might want to look in the former and cleanup manually. selfupdate done! macbook3:/Users/ujpadmin root#
  • 問題なく完了した模様.

4.アプリケーションリストを更新する

  • syncコマンドを使って,アプリケーションリストを更新する事ができる.
  • 実行してみる.
macbook3:~ root# port -d sync
DEBUG: Synchronizing ports tree(s)
Synchronizing from rsync://rsync.macports.org/release/ports/
DEBUG: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/
ports/ /opt/local/var/macports/sources/rsync.macports.org/release/ports
receiving file list ... done
./
aqua/
aqua/Affiche/
aqua/AppKiDo/
aqua/AquaLess/
aqua/ArpSpyX/

〜略〜



zope/zope-zopezen/
zope/zope-zphotoslides/
zope/zope-zphotoslides/files/
zope/zope-zsyncer/
PortIndex
devel/bazaar/Portfile
devel/libsigsegv/Portfile
devel/libsockets/Portfile
devel/libsockets/files/patch-Makefile
gnome/libgnome/Portfile
gnome/libgnome/files/patch-configure.diff
gnome/libgnomecanvas/Portfile
graphics/libguichan/Portfile
lang/clisp/Portfile
perl/p5-dbi/Portfile
python/py25-memcached/Portfile
deleting multimedia/ffmpeg/work
deleting lang/clisp/files/patch-documentation.lisp
deleting directory lang/clisp/files
deleting graphics/libguichan/files/patch-sdlmakefile
deleting graphics/libguichan/files/patch-openglimageloader.cpp
deleting graphics/libguichan/files/patch-openglgraphics.cpp
deleting graphics/libguichan/files/patch-listmodel.hpp
deleting graphics/libguichan/files/patch-configure
deleting directory graphics/libguichan/files
deleting devel/readline/work

sent 9722 bytes received 296051 bytes 24461.84 bytes/sec
total size is 15704230 speedup is 51.36
macbook3:~ root#
  • 削除されたものも,在る模様.

5.必要なライブラリを探す

  • searchコマンドを使って,検索できる.
  • たとえば,イメージマジックを検索してみる.
macbook3:~ root# port search imagemag  
ImageMagick graphics/ImageMagick 6.3.6-2 Tools and libraries
to manipulate images in many formats
macbook3:~ root#
  • この場合,完全一致しなくても検索できている事が解る.

6.パッケージをインストールする

  • まずは,パッケージを探す.
macbook3:/Users/ujpadmin root# port search mrtg
mrtg                           net/mrtg       2.15.2       The multi-router traffic grapher
mrtg-ping-probe net/mrtg-ping-probe 2.2.0 A ping probe adapter for mrtg
macbook3:/Users/ujpadmin root#
  • インストール時には,リストの一番左に在るパッケージ名を入力する.
macbook3:/Users/ujpadmin root# port install mrtg
---> Fetching gd2 ---> Attempting to fetch gd-2.0.35.tar.bz2 from http://www.libgd.org/releases/ ---> Verifying checksum(s) for gd2 ---> Extracting gd2 ---> Applying patches to gd2 ---> Configuring gd2 ---> Building gd2 with target all ---> Staging gd2 into destroot ---> Installing gd2 2.0.35_0 ---> Activating gd2 2.0.35_0 ---> Cleaning gd2 ---> Fetching mrtg ---> Attempting to fetch mrtg-2.15.2.tar.gz from http://oss.oetiker.ch/mrtg/pub/ ---> Verifying checksum(s) for mrtg ---> Extracting mrtg ---> Configuring mrtg ---> Building mrtg with target all ---> Staging mrtg into destroot ---> Installing mrtg 2.15.2_0 ---> Activating mrtg 2.15.2_0 ---> Cleaning mrtg macbook3:/Users/ujpadmin root#
  • 関連しているgd2がインストールされている事が解る.

7.関連モジュールを表示する

  • variantsコマンドを使って,関連モジュールを表示する.
macbook3:/Users/ujpadmin root# port variants mjpegtools
mjpegtools has the variants:
        universal
darwin_7
darwin_8
i386
powerpc
gtk
sdl
libdv
pal
macbook3:/Users/ujpadmin root#
  • これで必要なモジュールや,ターゲットとなるプラットホームなどが解る.

8.インストール済みパッケージの一覧を確認する

  • installedコマンドで,一覧を取得する事ができる.
macbook3:/Users/ujpadmin root# port installed
The following ports are currently installed:
apr @1.2.11_0 (active)
apr-util @1.2.10_0 (active)
atk @1.20.0_1 (active)
bzip2 @1.0.4_1 (active)
cairo @1.4.10_0 (active)
db44 @4.4.20_1+darwin_8 (active)
expat @2.0.1_0 (active)
fontconfig @2.4.2_1+macosx (active)
freetype @2.3.5_0 (active)
gd2 @2.0.35_0 (active)
gettext @0.16.1_0 (active)
giflib @4.1.4_1 (active)
glib2 @2.14.2_0 (active)
gtk2 @2.12.1_0 (active)
ImageMagick @6.3.6-2_0+darwin_8 (active)
jpeg @6b_2 (active)
libiconv @1.11_6+darwin_8 (active)
libpng @1.2.22_0+darwin_8 (active)
libtool @1.5.24_1 (active)
libxml2 @2.6.30_0 (active)
mrtg @2.15.2_0 (active)
ncurses @5.6_0+darwin_8 (active)
ncursesw @5.6_0+darwin_8 (active)
neon @0.26.4_0 (active)
openssl @0.9.8g_0+darwin_8 (active)
pango @1.18.3_0 (active)
pkgconfig @0.22_0 (active)
readline @5.2.007_0
render @0.9_1 (active)
sqlite3 @3.5.1_0+darwin_8 (active)
subversion @1.4.5_0 (active)
tiff @3.8.2_1+darwin_8+macosx (active)
Xft2 @2.1.12_0 (active)
xorg-util-macros @1.1.5_0 (active)
xorg-xproto @7.0.11_0 (active)
xrender @0.9.0_1+darwin_8 (active)
zlib @1.2.3_1 (active)
macbook3:/Users/ujpadmin root#
  • パッケージ名の後ろについているのは,インストールされて有効(active)になっている事を示す.

9.パッケージの無効・有効を切り替える

  • active,deactiveコマンドを使って,パッケージを一時的に無効にする.
  • ここでは,ImageMagickを無効にして確認し,再度有効化する.
macbook3:/Users/ujpadmin root# port deactivate ImageMagick
---> Deactivating ImageMagick
macbook3:/Users/ujpadmin root# port installed
The following ports are currently installed:
apr @1.2.11_0 (active)

〜略〜


gtk2 @2.12.1_0 (active)
ImageMagick @6.3.6-2_0+darwin_8 jpeg @6b_2 (active) 〜略〜 zlib @1.2.3_1 (active) macbook3:/Users/ujpadmin root# port activate ImageMagick
---> Activating ImageMagick
macbook3:/Users/ujpadmin root# port installed
The following ports are currently installed:
apr @1.2.11_0 (active)

〜略〜

gtk2 @2.12.1_0 (active)
ImageMagick @6.3.6-2_0+darwin_8 (active)
jpeg @6b_2 (active)

〜略〜

zlib @1.2.3_1 (active)
macbook3:/Users/ujpadmin root#

10.アップデートが可能なモジュールの一覧を取得する

  • outdatedコマンドで,アップデートが可能なモジュールの一覧を取得する.
macbook3:/Users/ujpadmin root# port outdated
No installed ports are outdated.
macbook3:/Users/ujpadmin root#
  • この場合,アップデート対象がない.

11.パッケージのアップデートを行う

  • upgradeコマンドでパッケージ名を指定して,アップデートする.
macbook3:/Users/ujpadmin root# port upgrade ImageMagick
macbook3:/Users/ujpadmin root#
  • アップデートの対象が複数在る場合,全てのモジュールのアップデートを一気に行う事ができる.
macbook3:/Users/ujpadmin root# port upgrade installed
---> Activating readline 5.2.007_0

12.パッケージの削除を行う.

  • 以下の例では,uninstallコマンドを使って,パッケージを削除している.
  • パッケージreadlineを削除する場合の例を示す.
macbook3:/Users/ujpadmin root# port uninstall readline
--->  Unable to uninstall readline 5.2.007_0, the following ports depend on it:
--->    sqlite3
Error: port uninstall failed: Please uninstall the ports that depend on readline first.
macbook3:/Users/ujpadmin root# port uninstall sqlite3
---> Unable to uninstall sqlite3 3.5.1_0+darwin_8, the following ports depend on it:
---> apr-util Error: port uninstall failed: Please uninstall the ports that depend on sqlite3 first.
macbook3:/Users/ujpadmin root# port uninstall apr-util
---> Unable to uninstall apr-util 1.2.10_0, the following ports depend on it:
---> subversion Error: port uninstall failed: Please uninstall the ports that depend on apr-util first.
macbook3:/Users/ujpadmin root# port uninstall subversion
---> Deactivating subversion 1.4.5_0
---> Uninstalling subversion 1.4.5_0
macbook3:/Users/ujpadmin root# port uninstall apr-util
---> Deactivating apr-util 1.2.10_0
---> Uninstalling apr-util 1.2.10_0
macbook3:/Users/ujpadmin root# port uninstall sqlite3 ---> Deactivating sqlite3 3.5.1_0+darwin_8 ---> Uninstalling sqlite3 3.5.1_0+darwin_8 macbook3:/Users/ujpadmin root# port uninstall readline ---> Uninstalling readline 5.2.007_0 macbook3:/Users/ujpadmin root#
  • この例では,readlineを消そうとしたら,その前にsqlite3を消す必要が在る.
  • sqlite3を消す前に,apr-utilを消す必要が在る.
  • apr-utilを消す前に,subvesionを消す必要が在るという依存関係があるので,subversion->arp- util->sqlite3->readlineの順番で削除した.


広告スペース
Google