Darwin Ports

轉載自 http://blog.ijliao.info/categories/computer/mac/

身為 BSD 愛好者,一定要用 Ports 的啊~

在轉進 (switch ? XD) Mac 之前,我就知道在 Mac 上面有兩套安裝自由軟體的工具,一套是 fink,長得有點像 debian 的 apt,另一套是 Darwin Ports,比較像是 BSD 系列的 ports system;而我,身為一個 FreeBSD Ports Committer,當然就是把 fink 踢到一旁,直接拿 dports 來用啦。

萬 事起頭難,一開始就有一大堆東西等著我 download,先是 Xcode,雖然說隨機光碟裡面就有 Xcode 2.0 了,但是看到 2.1 不抓下來總覺得對不起自己,不過 2.1 可是有 700多M 咧… XD 再加上一些 gcc 的小 patch,放著讓它抓,醒來的時候總該好了吧 ? 接下來就是去抓 dports 的東西,這裡有詳細步驟,簡單說就是直接把那兩行 cvs 給 copy/paste 就好了,日後要 update ports 的時候也是一樣,不過不必再 login 一次,只要 update 就行了;也可以把以下參數加到自己的 ~/.cvsrc,日後可以省點打字工:

cvs -z3
diff -Nu
update -Pd
checkout -P

這樣以後要 update dports 的話就是

cd darwinports && cvs update

安裝 dports 的方法是

cd darwinports/base && ./configure && make && sudo make install

三兩下裝好,以後 dports 相關的東西應該都會塞到 /opt 底下去;不要忘了把 /opt/local/bin 加到 path 裡去,不然就沒辦法執行啦。

痛 苦的部份過去了,接下來就是好好惡搞的時候 XD 整個 dports system 可以分成兩部份,”port” 這支程式還有 “darwinports/dports” 這個 ports description;port 這程式有點像 FreeBSD ports 裡面的 portupgrade,包山包海功能強大,新增刪除搜尋昇級全部靠它,這裡有它的使用手冊。

有了 dports,看來短時間之內不怕無聊了;至於要不要踏上 porter 的不歸路呢 ? 老實說,看到它的 portfile 是用 tcl 寫的,我就提不起勁啦 XD 還是玩玩別人的程式就好 :p


Get DarwinPorts

The DarwinPorts 1.0 release is available in binary form as a dmg disk image, containing a pkg installer, and in source form as either a tar.bz2 package or a tar.gz one. Checksums for all these are contained here.

Please note that in order to install and run DarwinPorts on Mac OS X, you must have either the Mac OS X Developer Tools (for 10.2.x) or XCode (for 10.3.x and 10.4.x) installed.

If you want to use DarwinPorts on a platform other than Mac OS X, please be aware of the following dependencies (we assume that you have basics such as gcc):

  • TCL (8.3 or 8.4)
  • curl
  • OpenSSL or libmd
Mac OS X Package (.pkg) Installer

The easiest way to install DarwinPorts on a Mac OS X system is by downloading the dmg image and running Installer.app on the pkg contained therein, following the on-screen instructions until completion. This procedure will place a fully functional and default DarwinPorts installation on your host system, completely ready for usage.

To take advantage of your new installation, you need to adapt your shell's configuration files to find the binaries installed by DarwinPorts. Please refer to the README file contained in the dmg for instructions on how to do this.

Although not strictly necessary, it is still recommended that you synchronize your recent installation with OpenDarwin servers to ensure you have the latest release available of the DarwinPorts infrastructure and of the Portfiles containing the instructions necessary for the installation of ports. To accomplish this simply execute:

sudo port -d selfupdate

It is also recommended to run the above command on a regular basis to keep your installation always current. At this point you should be ready to enjoy DarwinPorts!

Source Installation

If on the other hand you decide to install from source, there are still a few things you will need to do once you've downloaded the tarball before you can install a port with the DarwinPorts system, namely installing DarwinPorts itself. “cd” into the directory where you downloaded the package and run “tar xjvf DarwinPorts-1.0.tar.bz2” or “tar xzvf DarwinPorts-1.0.tar.gz”, depending on whether you downloaded the bz2 tarball or the gz one, respectively. This will unpack the DarwinPorts sources that you will proceed to install. To do so, execute the following:

cd DarwinPorts-1.0
./configure && make && sudo make install

Optionally:

cd ../
rm -rf DarwinPorts-1.0.*

These steps need to be perfomed from an administrator account, for which “sudo” will ask the password upon installation. This procedure will install a pristine DarwinPorts system and, if the optional steps are taken, remove the as of now unnecessary DarwinPorts-1.0 directory and corresponding tarball. To customize your installation you should read the output of “./configure --help | more” and pass the appropriate options to the configuration script in the steps detailed above.

You will need to adapt your shell's configuration files to find the binaries installed by DarwinPorts. Lastly, you need to synchronize your recent installation with OpenDarwin servers:

sudo port -d selfupdate

Upon completion DarwinPorts will be ready to install ports. Again, it is recommended to run the above command on a regular basis to keep your installation current.

Alternatively, you can refer to the README_RELEASE1 file contained in the 1.0 release tarball for basic installation and usage instructions.

Help

Help is also available should you need it.

CVS Sources

If you are developer or a user with a taste for the bleeding edge and wish for the latest changes and feature additions, you may acquire the DarwinPorts sources through CVS.

Use the following commands to check the project out of the OpenDarwin CVS repository:

cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od login
cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co -P darwinports

When the server asks you for a password, simply press return on your keyboard—the password is empty.

If you do not want to bother with fetching from CVS, you can download a nightly updated CVS-snapshot. Once extracted, you can keep it up to date with the usual “cvs update” commands.

If you'd simply like to view the CVS repository without checking it out, you can do so via CVSweb.

arrow
arrow
    全站熱搜

    Bluelove1968 發表在 痞客邦 留言(0) 人氣()