ウィキのコピーミラー

これは pascal.chat のウィキのミラーです。編集、履歴、ログインはそちらで行います。

How to setup a FPC and Lazarus Ubuntu repository/ja

English · Français · Português · Slovenčina · Русский · 日本語

ダウンローダー達へ!

もし Lazarus をダウンロードしたいだけであれば、Ubuntu リポジトリを使えばいいだけのことです。

このページは、自分専用リポジトリーのセットアップ方法について記述したもので、普通のユーザーにはあまり意味のないものです。(訳者注:ローカルリポジトリまで作成するほどのものではないが、Ubuntu 上で最新の Lazarus を使いたい、という方にとってもかなり有用な情報になると思います)

リポジトリーとは?

ubuntu のリポジトリーはディレクトリーです。ローカルディスク上、ウェブサーバー上、または、FTP サーバー上に構築することができます。 使用するには、そのパスを /etc/apt/sources.list に加え、PGP 鍵をセットアップします。それによりお気に入りのパッケージマネージャ(package gui、例えば synaptic)を使って Lazarus をシンプルにインストールでき、fpc、fpc-src、Lazarus らのダウンロード、インストール、アップデートが自動化されます。

誰のために必要なのか?

FPC+Lazarus をコンピュータのプール上からインストールすることを望む管理者。学校のような。または、即時のテストを望む初心者。

ディレクトリの構造

リポジトリを apache ウェブサーバーを利用して作成したいものと仮定します。そうであるなら public に読み出し可能で root だけが書き込み権限を持つ /var/www/lazarus のようなディレクトリを作成する必要があります。

サポートしたいターゲットOS向けのサブディレクトリを作成してください。:

pascal
 mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-i386
 mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-amd64

deb ファイル

fpc、 fpc-src、 lazarus の deb ファイルをそこに置いてください。

自分で deb ファイルを作成する

Lazarus に付属の tools/install/ 内のスクリプトを使って deb ファイルを作成できます。

開発用パッケージをインストールする

text
 sudo apt-get install libgtk2.0-dev libgtk1.2-dev libgdk-pixbuf-dev libgpmg1-dev fakeroot libncurses5-dev
 (訳者注:とりあえず
   sudo apt-get install fakeroot
   だけやっておけば、次の
   sudo apt-get install fpc
   で他の依存関係は自動調整してくれるようです)
text
 deb ファイルか tar.gz ファイルをオフィシャルサイトから入手してください。
 例:
   sudo apt-get install fpc
text
 svn co http://svn.freepascal.org/svn/fpc/trunk fpc
text
 svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus

新しい deb ファイルを構築する

text
 cd lazarus/tools/install
text
 sudo ./create_fpc_deb.sh fpc /path/to/the/sources/of/fpc/
text
 sudo dpkg -i fpc_2.3.1-070726_i386.deb
text
 ./create_fpc_deb.sh fpc-src /path/to/the/sources/of/fpc/
text
 ./create_lazarus_deb.sh append-revision

gtk1 版の場合:

text
 ./create_lazarus_deb.sh gtk1 append-revision

(訳者注:以上の手順で完成した Lazarus の deb ファイルを「sudo dpkg -i lazarus*.deb」としてインストールすれば最新の Lazarus を Ubuntu 上で使うことができます。ローカルリポジトリまでは必要ない方は、以下の作業は不要ということになります)

リポジトリの deb ファイルを置き換える

Now you have 3 deb files.

You can install them directly, but first un-install the build version

text
dpkg -r fp-compiler fp-units-rtl fp-compiler
pascal
 cp fpc_2.3.1-070726_i386.deb fpc-src_2.3.1-070726_i386.deb lazarus_0.9.23.11636-0_i386.deb \
   /var/www/lazarus/dists/lazarus-testing/universe/binary-i386/

PGP Key

You need to sign the debs with a PGP key, so that the target systems can be sure, that no evil-doer replaced the files.

Creating a PGP key

You can use tools like seahorse or thunderbird to create the PGP key.

Upload the key to a public key server

In order to share the key you can upload the key to a public key server.

Remember the key ID

You need the key ID later. The key ID is shown in seahorse. But you can see it also via:

text
 gpg --list-keys

Updating repository files

Put the following script into /var/www/lazarus, edit it for your needs and run it:

pascal
#!/usr/bin/env bash
pascal
set -x
pascal
GPGHome=/home/gaertner/.gnupg/
MainDir=dists/lazarus-testing
pascal
for Arch in i386 amd64; do
  Dir=$MainDir/universe/binary-$Arch
pascal
# create index
apt-ftparchive packages $Dir > $Dir/Packages
cat $Dir/Packages | gzip -9c > $Dir/Packages.gz
cat $Dir/Packages | bzip2 > $Dir/Packages.bz2
pascal
done
pascal
# create Release file
rm -f $MainDir/Release*
Date=`date`
echo "Origin: Lazarus" >> $MainDir/Release
echo "Label: Lazarus" >> $MainDir/Release
echo "Suite: unstable" >> $MainDir/Release
echo "Codename: lazarus-testing" >> $MainDir/Release
echo "Version: 1.0" >> $MainDir/Release
echo "Date: $Date" >> $MainDir/Release
echo "Architectures: amd64 i386" >> $MainDir/Release
echo "Components: universe" >> $MainDir/Release
echo "Description: Lazarus testing 1.0" >> $MainDir/Release
pascal
apt-ftparchive release $MainDir >> $MainDir/Release
pascal
# sign Release file
gpg --sign --homedir=$GPGHome -ba -o $MainDir/Release.gpg $MainDir/Release
pascal
# end.

This will create index files Packages, Packages.bz2 and Packages.gz. And it will create the Release file containing the checksums of the deb packages and sign it (Release.gpg).

Adding the repository to a client

IMPORTANT: If you only came here to download lazarus for ubuntu/debian then use the stable repository Ubuntu repository. The repository below is an unstable, testing repository.

The following steps must be done on each computer, you want to use your repository.

Add the key

Download the key from the public key server:

text
 gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 3A5B1204

The 3A5B1204 should be replaced with your key id. Check the output, that you got the right key.

Add it to the apt system:

text
 gpg --export 3A5B1204 | sudo apt-key add -

You can see the list of apt keys with:

text
 sudo apt-key list

Add the repository

You can use synaptic for this or edit the /etc/apt/sources.list directly. Add the line:

text
 deb http://progprak.scale.uni-koeln.de/lazarus/ lazarus-testing universe

Replace the http path with your own.

Install Lazarus

For example:

text
 sudo apt-get update
 sudo apt-get install lazarus

From the Free Pascal wiki, page "How to setup a FPC and Lazarus Ubuntu repository/ja", as it stood on 2009-05-03 after a change by Malcome, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

第4版、最終更新:WikiArchive 。