自前の Portfile の作り方・使い方

local ports repository の用意

自前の Portfile を作成し、メンテナンスしていくにはまず、 MacPorts 本来の ports tree の他に、別の tree (local ports repository) を作成します。 ここでは、<PATH_TO_LOCAL_PORT_TREE> としています。 そのディレクトリ以下には、ports tree と同じ tree を作らなくてはいけません。 まあ、こんな感じで作れます。

$ mkdir <PATH_TO_LOCAL_PORT_TREE>
$ cd <PATH_TO_LOCAL_PORT_TREE>
$ mkdir `ls -F1 \
/opt/local/var/macports/sources/rsync.macports.org/release/ports/ | \
grep '\/$'`

sources.conf の書き換え

<PATH_TO_LOCAL_PORT_TREE> を /opt/local/etc/macports/sources.conf に登録し、 MacPorts に local ports repository を参照させるようにします。

# MacPorts system wide sources configuration file
# $Id: sources.conf 26177 2007-06-15 10:11:22Z jmpp@macports.org $
#
# To enable your local ports repository, uncomment and customize the
# following line to point at your local ports directory
# Example: file:///Users/landonf/misc/MacPorts/ports
file:///<PATH_TO_LOCAL_PORT_TREE>
#
# To prevent a source from synchronizing when `port sync` is used,
# append [nosync] to the end of the line
# Example: file:///Users/landonf/misc/MacPorts/dports [nosync]
#
# To get the ports tree from the MacPorts rsync.macports.org server use:
# rsync://rsync.macports.org/release/ports/
rsync://rsync.macports.org/release/ports/

双方の ports tree に重複する Portfile がある場合は、 /opt/local/etc/macports/sources.conf で上に書いたものが優先されるようです。

Portfile の配置

カテゴリ名に対応したディレクトリの配下に自前の Portfile を作成・配置してください。

Portfile の書き方は、DarwinPortsGuide を見れば大体のところは分りますが、 内容は不完全なので、既存の Portfile を参考にしましょう。 portfile(7) も参考になります。

Portindex コマンドの実行

Portfile の配置が終われば、次のコマンドを実行する必要があります。

$ cd <PATH_TO_LOCAL_PORT_TREE>
$ portindex

コメント

  • PrivatePortfile は上記の tree の portfile を入れるデリレクトリーに保存して ports.dev を登録すれば、port upgrade でパッケージのアップデート出来ますか? -- 教えて君? 2006-03-16 (木) 19:22:25
  • あい、できます。 -- ぺろぽる? 2006-03-17 (金) 23:28:10
  • ver. 1.5 のディレクトリ構成に合わせて変更しました。 -- ぺろぽる? 2007-07-11 (水) 01:55:46
  • /opt/local/etc/macports/source.conf ではなくて、/opt/local/etc/macports/sources.confのようです。 -- 2008-01-26 (土) 12:27:31


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2009-07-28 (火) 01:10:14 (402d)