自前の 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 コメント †
|