=================================================================== RCS file: /cvsrepo/anoncvs/cvs/www/Attic/ports.html,v retrieving revision 1.86 retrieving revision 1.87 diff -c -r1.86 -r1.87 *** www/Attic/ports.html 2006/05/01 08:47:02 1.86 --- www/Attic/ports.html 2006/05/02 18:02:36 1.87 *************** *** 1,7 **** ! --- 1,7 ---- ! *************** *** 13,239 **** ! [OpenBSD] !

The Ports & Packages collection


!

Index


!

Motivation

! OpenBSD is a fairly complete system of its own, but still there is a lot ! of software that one might want to see added. However, there is the problem ! of where to draw the line as to what to include, as well as the occasional ! licensing and export restriction problems. As OpenBSD is supposed to be ! a small stand-alone UNIX-like operating system, some things just can't be ! shipped with the system.

! The ports & packages collection does NOT go through the thorough security audit that OpenBSD follows. ! Although we strive to keep the quality of the packages collection high, we just do not have enough human ! resources to ensure the same level of robustness and security.

! The port collection, originally borrowed from ! FreeBSD, fills this gap. ! The concept is to have, for each third-party software, a Makefile that ! controls

! This information is kept in a directory hierarchy under the ! /usr/ports directory.

! Packages are the binary equivalent of ports. A compiled port becomes ! a package that can be registered into the system using pkg_add(1)

! Packages look like simple .tgz bundles, but they should ! always be added using ! pkg_add(1), ! as there might be some extra information that only ! pkg_add(1) ! knows how to handle. ! Tip: you can distinguish between packages and .tgz bundles ! using ! pkg_info(1). !

Getting Packages

! A large collection of pre-compiled packages is available for most common ! architectures. ! Adding a package is as easy as ! pkg_add pkgname.tgz. ! If you are grabbing packages from a single source (a package repository), ! set PKG_PATH to that repository URL, in order to grab dependencies.

! For instance, to install the Gimp package for the 3.9 release on an i386 ! machine off the ftp site (including dependencies), do:

      # export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/
      # pkg_add gimp-2.2.10.tgz
  
!

Ports and Packages Update for an OpenBSD Release

! The 2.7 release saw the introduction of a stable branch for the ports tree.

! For instance, to grab the stable branch for the 3.9 release:

      $ cd /usr/ports
      $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_3_9 -Pd
  

! Starting with the 2.8 release, selected binary packages are also made ! available. ! Please refer to the ! stable packages page to find out about ! updated packages and important updates to the stable branch. ! If you want to receive security announcements, you can subscribe ! to the ports-security mailing list.

! Package names are always changed in case of a package ! update, to avoid any risk of confusion between a package from the release ! and a bug-fixed package.

!

Managing Installed Packages

! The packages(7) ! manual page holds useful information about ways to manage ! installed packages, solve conflicts (files that already exist) and handle ! dependencies.

! As of OpenBSD 2.8, to update a package you must:

! This is slightly inconvenient, as packages may trigger dependencies, and ! you may have to remove a large subset of packages for an update. !

Using Ports

! If a given package does not exist for your architecture, you may still ! be able to compile the port. Besides, some users will want to compile ! everything from source for various reasons.

! You can ftp the release version from the pub/OpenBSD/[version] (where ! [version] is the release number) directory on any of the ! ftp mirror sites. ! The release versions are the ones we ship on our CDROM, and have gone ! through more testing than any snapshot. ! Further information is available in the ! ports(7) man page. !

Life Cycle of the Ports Tree

! The ports tree, like the rest of OpenBSD, is constantly changing.

! The current ports tree may not be used with the previous ! release. This is due to changes, typically with the port make process, ! that require code based upon the OpenBSD-current source tree. !

The ports tree works as a single entity. Updating a single directory is ! not guaranteed to work, as package dependencies may force you to update ! and recompile vast portions of the ports tree. ! It is strongly suggested that people don't track ports-current unless ! they're prepared to deal with various problems. ! Mailing lists such as ! ports-changes@openbsd.org or ! tech@openbsd.org will probably be invaluable. !

You are advised to track ports-stable on a production machine: ! we will try to keep the stable ports tree up-to-par with respect to ! problems, and to provide timely binary updates as well. !

Note that vanishing distfiles is not an issue, as ! ftp.openbsd.org holds the complete repository. Even changing checksums is ! not an issue: you can issue the command

  	make checksum REFETCH=true 
  
! to make sure you are grabbing the correct distfile for your ports tree. ! For definitions of current and stable, see the ! OpenBSD's flavors. !

A list of daily changes to ports ! and ports-current is available.

! The ports-current tree can be retrieved via:

!

Ports and the X Window System

! There is some special magic in the OpenBSD X configuration files ! that allows the ports tree to install imake-based applications under ! /usr/local. !

Example Use of the Ports Tree

! Let's say you managed to get a ports tree and you want to compile and ! install the archiving utility unzip. You should be able to ! do something like this:

      % cd /usr/ports/archivers/unzip
--- 13,239 ----
  
  
  
! [OpenBSD]
  
! 

Ports & Packages コレクション


!

目次


!

動機

! OpenBSD は、それ自身がかなり完全なシステムですが、それでも誰かが追加してくれる ! ことを期待したくなる多数のソフトウェアがあります。しかしながら、時おり発生する ! ライセンスの問題や輸出制限の問題と同様、何を含めるかということに関する線引きを ! どこで行うのかという問題があります。OpenBSD は、小さくて独立した UNIX ライクな ! オペレーティングシステムとしてサポートされていますので、ものによってはシステム ! に含めて出荷することができません。

! ports & packages コレクションは、OpenBSD で行われている徹底的なセキュリティ監査を通していません。 ! 私たちは packages コレクションの品質を高く保つために努力していますが、残念ながら、堅牢性とセキュリティを ! 同じレベルで保障できるだけの十分な人的リソースを有していません。

! もともと FreeBSD のものを移植した ! ports コレクションが、このギャップを埋めてくれるでしょう。そのコンセプトは、 ! それぞれのサードパーティ製ソフトウェアが、以下のことを制御することができる ! Makefile を持つ、というものです。

! この情報は /usr/ports ディレクトリ以下のディレクトリ構造中に ! 保持されています。

! packages は ports のバイナリ版です。コンパイル済の ports が packages であり、 pkg_add(1) + を使用してシステムにインストールすることが可能なものです。

! packages は、単なる .tgz の集合体のように見えますが、 ! pkg_add(1) ! だけが理解する、どのように取り扱う必要があるのかなどの ! 特別な情報をいくつか持っているかも知れませんので、必ず ! pkg_add(1) ! を使用してインストールしなければなりません。 ! ヒント: packages と単なる .tgz の集合体は、 ! pkg_info(1) ! を使用して区別することができます。 !

Packages の入手

! コンパイル済 packages の大規模なコレクションは、ほとんどの ! 共通アーキテクチャ上で利用可能となっています。 ! packages の追加は非常に簡単で、 ! pkg_add pkgname.tgz とします。 ! もし、いつも同じ配布元 (パッケージリポジトリ) から packages を入手しているのでしたら、 ! 取得の依存性に従って、PKG_PATH をその URL に設定しておいてください。

! たとえば、FTP サイトから i386 マシン上の 3.9 リリース用の (依存性を含む) ! Gimp パッケージをインストールする場合、次のようにします。

      # export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/3.9/packages/i386/
      # pkg_add gimp-2.2.10.tgz
  
!

OpenBSD のリリースに合わせた Ports および Packages の更新

! 2.7 リリースから、ports ツリーにも安定版ブランチが導入されるようになりました。

! たとえば、3.9 リリース用の安定版ブランチを入手するには、次のようにしてください。

      $ cd /usr/ports
      $ cvs -q -d anoncvs@some.anon.server:/cvs up -r OPENBSD_3_9 -Pd
  

! 2.8 リリース以降では、選択されたバイナリパッケージも ! 利用可能になっています。 ! 安定版ブランチに対する packages の更新と重要な更新については、 ! 安定版 packages のページ ! を参照してください。 ! セキュリティについてのアナウンスが必要な場合には、ports-security ! メーリングリストに参加してください。

! リリースからのパッケージとバグ修正版パッケージとが区別できなくなる ! 危険性を回避するため、packages が更新された場合には、package ! の名前は必ず変更されます。

!

インストール済 Packages の管理

! packages(7) ! マニュアルページには、インストール済 packages の管理の方法や ! (ファイルが既に存在しているなどの) 衝突の解決、依存性の取り扱い ! に関する、役に立つ情報が記載されています。

! OpenBSD 2.8 の場合、packages を更新するには以下のようにします。

! この方法は、依存性の引き金を引くことになるかも知れませんし、更新のために packages ! の大きなサブセットを消去しなければならなくなるかも知れませんので、やや不便な方法ではあります。 !

Ports を使用する

! 使用中のアーキテクチャ用の packages が存在していない場合でも、ports から ! コンパイルを行うことは可能です。さらに、さまざまな理由から、何でもソースから ! コンパイルしないと気が済まないユーザもいます。

! FTP ミラーサイトのいずれかの pub/OpenBSD/[version] ! (ここで、[version] はリリースバージョン番号のことです) ディレクトリから ! リリースバージョンを ftp で取得することができます。 ! リリースバージョンとは、CDROM で出荷されているバージョンのことで、他のどのような ! スナップショットよりも入念なテストを経ています。より詳しくは、 ! ports(7) ! man ページを参照してください。 !

Ports ツリーのライフサイクル

! ports ツリーは、残りの OpenBSD のツリーと同様、絶えず変化しています。

! 現在の ports ツリーは、前回のリリースバージョン用には使用できないかも知れません ! 。これは、典型的には ports を作成するプロセスの、OpenBSD-current ! のソースツリーに基づくコードを要求するような変更に起因しています。 !

ports ツリーは単一の実体として動作します。ひとつのディレクトリだけを更新しても、 ! packages の依存性が、ports ツリーの膨大な部分を更新し、再コンパイルすることを ! 要求してくるかも知れませんので、動作は保障されません。 ! ですから、さまざまな問題に対処する準備ができていない場合には、ports-current ! を追いかけるべきではないということを、強くお勧めします。また、 ! ports-changes@openbsd.org や ! tech@openbsd.org のような ! メーリングリストは非常に参考になることでしょう。 !

業務用のマシン上では、安定版の ports を追いかけることをお勧めします。 ! 私たちは、問題に対して、ある基準に達するよう、安定版の ports ツリーを維持するよう、 ! また同様に、バイナリもタイムリーに更新するよう、努めています。 !

ftp.openbsd.org では、完全なリポジトリを保持していますので、配布ファイルが ! 消えてなくなることは問題ではないということに注意してください。また、同様に、 ! チェックサムが変化することも問題ではなく、

  	make checksum REFETCH=true 
  
! とすることで、使用中の ports ツリー用の正しい配布ファイルを確実に取得することも可能なのです。 ! current および安定版の記述に関しては、 ! 「OpenBSD の種類」を参照してください。 !

ports および ports-current の日々の変更 ! のリストも用意されています。

! ports-current のツリーは以下のところから入手可能です。

!

Ports と X Window System

! OpenBSD の X の設定ファイルには、ports ツリーから /usr/local ! の下の imake ベースのアプリケーションのインストールを可能とするための ! ちょっとした仕掛けが用意されています。 !

Ports ツリーの使用例

! 何とか ports ツリーを入手したので、アーカイブユーティリティの unzip ! をコンパイルしてインストールしたい、とします。 ! その場合には、以下のようにすれば良いでしょう。

      % cd /usr/ports/archivers/unzip
***************
*** 243,352 ****
      # exit
  
! Easy, huh ? Especially considering all that happened in the background:

! With OpenBSD 3.0, almost all ports automatically build ! packages when installing.

! As ports get built, the /usr/ports/distfiles directory gets filled with ! program sources, and /usr/ports/packages gets filled with binary packages. ! Users with low connectivity may refer to ! mirroring-ports(7) for ! an efficient way to grab all distfiles at once. In OpenBSD-current, you ! can use the script /usr/ports/infrastructure/fetch/clean-old to track ! old distfiles. ! Note that the OpenBSD CD only includes the ports tree and selected packages. ! If you wish to have the distfiles, you will have to get them through an ! independent way. !

Advanced Usage of the Ports Tree

! Ports tree has many features for the advanced user that make it a valuable ! tool beyond basic installation. Advanced users may wish to tamper with ! the makefiles (you should read the make(1) ! manual page first) or set various variables from the make command-line or in ! /etc/mk.conf. These variables are described in detail in the bsd.port.mk(5) ! manual page, and the porting documents below.

!

Creating New Ports

! If you are interested in helping to expand the OpenBSD ports tree ! you should first read porting.html. ! That page references the FreeBSD Porter's Handbook ! as well as OpenBSD specific policies and hints. !

When a Port Is Lagging Behind the Mainstream Version

! The ports collection is a volunteer project. Sometimes the project simply ! doesn't have the developer resources to keep everything up-to-date. ! Developers pretty much pick up what they consider interesting and can ! test in their environment. Your donations ! count for what platforms the ports can be tested on.

! Some individual ports may lag behind the mainstream versions because of this. ! The ports collection may have a version back of a program from January while a new ! version of the program has been released by its developers in May three months ago. ! Often this is a conscious decision; the new version may have problems in it on ! OpenBSD that the maintainer is trying to solve, or that have simply made the ! application worse than the old version: OpenBSD may have different ! goals than the mainstream developers in other projects, ! which sometimes results in features and design or implementation choices ! that are undesirable from OpenBSD developers' point of view. The update may also be ! postponed because the new version is not considered a crucial update.

! If you really need a new version of a port, you should ask the MAINTAINER ! of the port to update the port (see below on how to find out who ! the maintainer is); if you can send patches for this, all the better. To create proper ! patches, you should refer to the documentation on building ! ports.

!

Problems and Contacts

! If you have trouble with an existing port, please send e-mail to the ! port maintainer. To see who is the maintainer of the port, type, for ! example:

         % cd /usr/ports/archivers/unzip
         % make show=MAINTAINER
  
! Alternatively, if there is no maintainer, or you can't reach ! him/her, send mail to the OpenBSD ! ports mailing list, ports@openbsd.org. ! Please don't use the misc@openbsd.org mailing list for questions about ports. ! Corrections are always welcome, but in any case do please provide: ! For ports that don't build correctly, a complete build transcript is almost ! always required. You can use the portslogger script, found in ! /usr/ports/infrastructure/build, for this. A sample run of portslogger ! might be:
         % cd /usr/ports/archivers/unzip
--- 243,352 ----
      # exit
  
! 簡単だったでしょう ? 特別に、その裏側で何が起きているのかをすべて見てみましょう。

! OpenBSD 3.0 では、ほとんどすべての ports が、インストール時に ! 自動的に packages を生成します。

! ports をビルドするため、/usr/ports/distfiles ディレクトリには、プログラムのソースが ! 置かれます。また、/usr/ports/packages ディレクトリには、バイナリパッケージが置かれます。 ! インターネットとの接続性の悪いユーザは、一度にすべての配布ファイルを取得するための十分な方法として、 ! mirroring-ports(7) ! を参照してください。OpenBSD-current では、古い配布ファイルを追いかけるため、 ! /usr/ports/infrastructure/fetch/clean-old ! スクリプトを使用することもできます。 ! OpenBSD CD には、ports ツリーと選択された packages が入っているだけということに注意してください。 ! もし、配布ファイルも必要なのでしたら、 ! 他の方法でそれらを取得する必要があります。 !

Ports ツリーの使用例 (応用編)

! ports ツリーは、上級ユーザにとって、基本的なインストール以上に価値のあるツールに ! するための多くの機能を持っています。上級ユーザは、makefile を変更したいと思うかも ! 知れません (まずは make(1) ! マニュアルページをお読みください) し、make のコマンド行や /etc/mk.conf ! ファイル内にいろいろな変数を設定したいと思うかも知れません。これらの変数は、その詳細が bsd.port.mk(5) ! マニュアルページや、以下の移植のためのドキュメントの中に記述されています。

!

新しい Ports の作成

! もし、OpenBSD の ports ツリーの拡張の支援に興味があるのでしたら、 ! まず、porting.html をお読みください。 ! このページは、OpenBSD 固有のポリシーやヒントと同様に、 FreeBSD Porter's Handbook ! も参照しています。 !

いつ Ports は主流のバージョンから遅れを取ってしまうのでしょう ?

! ports コレクションはボランティアベースのプロジェクトです。ときどき、プロジェクトは ! すべてのものを更新し続けられるだけの開発者のリソースを有していないことがあります。 ! 開発者は、実に多くの彼らがおもしろいと考えるものをピックアップし、彼らの環境でテストすることができます。 ! あなたの寄付によって、 ! ports がどのようなプラットフォームに対応されるかが変わってくるのです。

! いくつかの個別の ports が、この理由によって、主流のバージョンから遅れを取ることがあるかも知れません。 ! たとえば、3 ヶ月前の 5 月に、あるプログラムの元の開発者が新しいバージョンをリリースしたにも関わらず、 ! ports コレクションは、1 月のそのプログラムのより以前のバージョンかも知れません。 ! しばしば、これは意識的な決定なのです。新しいバージョンは、OpenBSD ではメンテナが解決を試みている最中の ! 問題を抱えているのかも知れませんし、単純に、そのアプリケーションが古いバージョンのものよりも ! 悪くなってしまっただけなのかも知れません。また、OpenBSD は、他のプロジェクトの主力開発者とは ! 異なる目標を持っているのかも知れませんから、 ! 時として、選択された機能や設計、実装の結果が、OpenBSD の開発者の観点からは ! 好ましくないものであるのかも知れません。また、新しいバージョンが極めて重要な更新であるとは ! 考えられないために、ports の更新が延期されることもあります。

! しかし、もし、本当に新しいバージョンの ports が必要な場合には、その ports のメンテナに ! ports を更新するよう、連絡を取ってみるべきでしょう (メンテナが誰なのかをどのようにして見つかるのかは。 ! 以下の項目をご覧ください)。もし、これについてのパッチを送ることができれば、それは ! さらに良いことでしょう。また、適正なパッチを生成するためには、 ! ports のビルドに関するドキュメントに目を通してください。

!

問題発生時の連絡先

! もし、既存の ports に問題点があった場合には、ports のメンテナに電子メールを ! 送ってください。その ports のメンテナが誰であるのかを知るためには、 ! たとえば、以下のようにしてください。

         % cd /usr/ports/archivers/unzip
         % make show=MAINTAINER
  
! 別の方法としては、もし、メンテナがいない場合や、あるいはメンテナに辿り着けない場合には、 ! OpenBSD ports メーリングリスト ports@openbsd.org ! にメールを送ってください。 ! ports に関する質問の場合、misc@openbsd.org メーリングリストを使用しないでください。 ! 訂正は常に歓迎されますが、どのような場合においても以下の情報を用意してください。 ! ports が正常にビルドできない場合には、ほとんど常に、そのビルド時の記録が必要です。 ! そのために、/usr/ports/infrastructure/build にある portslogger スクリプトを ! 使用することができます。 ! portslogger の実行例は以下のようになります。
         % cd /usr/ports/archivers/unzip
***************
*** 356,378 ****
                 ~/portslogs
  
! After this, you should have a logfile of the build in your ~/portslogs directory ! that you can send to the port maintainer. Also, make sure you are not using ! any special options in your build, for example in /etc/mk.conf.

! Alternatively, you can


! OpenBSD www@openbsd.org !
$OpenBSD: ports.html,v 1.86 2006/05/01 08:47:02 steven Exp $ --- 356,385 ---- ~/portslogs
! これによって、~/portslogs ディレクトリ中に、ports のメンテナに送ることができる ! このビルドのログファイルが生成されます。また、たとえば、/etc/mk.conf 中などで ! 特別なビルドオプションを使用していないことを確認しておいてください。

! これ以外の方法として、


! OpenBSD www@openbsd.org !
! ! ! $OpenBSD: ports.html,v 1.87 2006/05/02 18:02:36 jufi Exp $ !