Sign in Join
Wiki copytemporary

How to setup a FPC and Lazarus Ubuntu repository/ja: what changed

Revision 3 to 4. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## ダウンローダー達へ!
22
33もし Lazarus をダウンロードしたいだけであれば、[[Getting Lazarus|Ubuntu リポジトリを]]使えばいいだけのことです。
44
55このページは、自分専用リポジトリーのセットアップ方法について記述したもので、普通のユーザーにはあまり意味のないものです。(訳者注:ローカルリポジトリまで作成するほどのものではないが、Ubuntu 上で最新の Lazarus を使いたい、という方にとってもかなり有用な情報になると思います)
66
77## リポジトリーとは?
88
99ubuntu のリポジトリーはディレクトリーです。ローカルディスク上、ウェブサーバー上、または、FTP サーバー上に構築することができます。 使用するには、そのパスを /etc/apt/sources.list に加え、PGP 鍵をセットアップします。それによりお気に入りのパッケージマネージャ(package gui、例えば synaptic)を使って Lazarus をシンプルにインストールでき、fpc、fpc-src、Lazarus らのダウンロード、インストール、アップデートが自動化されます。
1010
1111## 誰のために必要なのか?
1212
1313FPC+Lazarus をコンピュータのプール上からインストールすることを望む管理者。学校のような。または、即時のテストを望む初心者。
1414
1515## ディレクトリの構造
1616
1717リポジトリを apache ウェブサーバーを利用して作成したいものと仮定します。そうであるなら public に読み出し可能で root だけが書き込み権限を持つ /var/www/lazarus のようなディレクトリを作成する必要があります。
1818
1919サポートしたいターゲットOS向けのサブディレクトリを作成してください。:
2020
21-` mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-i386`\
22-` mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-amd64`
21+``` pascal
22+ mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-i386
23+ mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-amd64
24+```
2325
2426## deb ファイル
2527
2628fpc、 fpc-src、 lazarus の deb ファイルをそこに置いてください。
2729
2830### 自分で deb ファイルを作成する
2931
3032Lazarus に付属の tools/install/ 内のスクリプトを使って deb ファイルを作成できます。
3133
3234#### 開発用パッケージをインストールする
3335
3436- 開発用パッケージをインストールする。:
3537
36-` sudo apt-get install libgtk2.0-dev libgtk1.2-dev libgdk-pixbuf-dev libgpmg1-dev fakeroot libncurses5-dev`\
37-` (訳者注:とりあえず`\
38-`   sudo apt-get install fakeroot`\
39-`   だけやっておけば、次の`\
40-`   sudo apt-get install fpc`\
41-`   で他の依存関係は自動調整してくれるようです)`
38+```text
39+ sudo apt-get install libgtk2.0-dev libgtk1.2-dev libgdk-pixbuf-dev libgpmg1-dev fakeroot libncurses5-dev
40+ (訳者注:とりあえず
41+ sudo apt-get install fakeroot
42+ だけやっておけば、次の
43+ sudo apt-get install fpc
44+ で他の依存関係は自動調整してくれるようです)
45+```
4246
4347- FPC の最終安定版をインストールする。新しい FPC や Lazarus をビルドするために必要です。:
4448
45-` deb ファイルか tar.gz ファイルをオフィシャルサイトから入手してください。`\
46-` 例:`\
47-`   sudo apt-get install fpc`
49+```text
50+ deb ファイルか tar.gz ファイルをオフィシャルサイトから入手してください。
51+ 例:
52+ sudo apt-get install fpc
53+```
4854
4955- FPC のソースをダウンロードします。現在開発中のバージョンを使うなら下記のコマンドが使えます。より安定したバージョンを取得するなら [[Installing Lazarus|Installing_Lazarus#FPC Sources]] を参照してください(訳者注:多くの方は FPC の安定版を使うと思いますので、通常は「sudo apt-get install fpc-source」でインストールできます。仮に公式リポジトリの FPC のバージョンが FPC サイトで配布されている安定版より古い場合は、 <ftp://ftp.freepascal.org/pub/fpc/dist/> から入手した deb ファイル郡を「sudo dpkg -i fp-*.deb」、「sudo dpkg -i fpc-*.deb」としてインストールし使えばよいだけです。通常は FPC 関係の deb を自分で作成する必要はなさそうです)。:
5056
51-` svn co `[`http://svn.freepascal.org/svn/fpc/trunk`](http://svn.freepascal.org/svn/fpc/trunk)` fpc`
57+```text
58+ svn co http://svn.freepascal.org/svn/fpc/trunk fpc
59+```
5260
5361- Lazarus のソースをダウンロードします(訳者注: svn は sudo apt-get install subversion とすることでインストールできます)。:
5462
55-` svn co `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)` lazarus`
63+```text
64+ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
65+```
5666
5767#### 新しい deb ファイルを構築する
5868
5969- Lazarus インストールスクリプトディレクトリに移動する。:
6070
61-` cd lazarus/tools/install`
71+```text
72+ cd lazarus/tools/install
73+```
6274
6375- FPC の deb ファイルを構築する(訳者注:安定版を使う場合は <ftp://ftp.freepascal.org/pub/fpc/dist/> から入手すればよいので不要です)。The following script will build a single fpc deb using the date as version. As parameter you must specify the path of the FPC sources you downloaded above:
6476
65-` sudo ./create_fpc_deb.sh fpc /path/to/the/sources/of/fpc/`
77+```text
78+ sudo ./create_fpc_deb.sh fpc /path/to/the/sources/of/fpc/
79+```
6680
6781- 新しい fpc の deb ファイルをインストールします(訳者注:安定版を使う場合は不要です)。これは Lazarus の deb ファイルを構築するために必要となります。最初に古い FPC をアンインストールすることを忘れないでください。
6882
69-` sudo dpkg -i fpc_2.3.1-070726_i386.deb`
83+```text
84+ sudo dpkg -i fpc_2.3.1-070726_i386.deb
85+```
7086
7187- fpc-src の deb ファイルを構築します(訳者注:安定版を使う場合は不要です)。この作業は上の作業とほぼ同じです。:
7288
73-` ./create_fpc_deb.sh fpc-src /path/to/the/sources/of/fpc/`
89+```text
90+ ./create_fpc_deb.sh fpc-src /path/to/the/sources/of/fpc/
91+```
7492
7593- Lazarus の deb ファイルを構築する。 gtk2 版の通常の Lazarus を構築する場合:
7694
77-` ./create_lazarus_deb.sh append-revision`
95+```text
96+ ./create_lazarus_deb.sh append-revision
97+```
7898
7999gtk1 版の場合:
80100
81-` ./create_lazarus_deb.sh gtk1 append-revision`
101+```text
102+ ./create_lazarus_deb.sh gtk1 append-revision
103+```
82104
83105(訳者注:以上の手順で完成した Lazarus の deb ファイルを「sudo dpkg -i lazarus*.deb」としてインストールすれば最新の Lazarus を Ubuntu 上で使うことができます。ローカルリポジトリまでは必要ない方は、以下の作業は不要ということになります)
84106
85107#### リポジトリの deb ファイルを置き換える
86108
87109Now you have 3 deb files.
88110
89111You can install them directly, but first un-install the build version
90112
91113- If you installed fp-compiler you will need to:
92114
93-`dpkg -r fp-compiler fp-units-rtl fp-compiler `
115+```text
116+dpkg -r fp-compiler fp-units-rtl fp-compiler
117+```
94118
95119- Copy them to your repository:
96120
97-` cp fpc_2.3.1-070726_i386.deb fpc-src_2.3.1-070726_i386.deb lazarus_0.9.23.11636-0_i386.deb \`\
98-`   /var/www/lazarus/dists/lazarus-testing/universe/binary-i386/`
121+``` pascal
122+ cp fpc_2.3.1-070726_i386.deb fpc-src_2.3.1-070726_i386.deb lazarus_0.9.23.11636-0_i386.deb \
123+ /var/www/lazarus/dists/lazarus-testing/universe/binary-i386/
124+```
99125
100126- Don't forget to remove the old ones.
101127
102128## PGP Key
103129
104130You need to sign the debs with a PGP key, so that the target systems can be sure, that no evil-doer replaced the files.
105131
106132### Creating a PGP key
107133
108134You can use tools like seahorse or thunderbird to create the PGP key.
109135
110136- Install seahorse
111137- start seahorse
112138- Key \> Create new key
113139- A window popup up asking for the type. Choose *PGP Key*.
114140- Give a full name and an email adress and click *Create*.
115141- The passphrase is needed to encrypt the created files. This way no one can use the keys but you, even if they manage to steal your files. If you think, your files will never stolen or read by others you can leave them empty.
116142- Creating the keys will take some minutes
117143
118144### Upload the key to a public key server
119145
120146In order to share the key you can upload the key to a public key server.
121147
122148- start seahorse
123149- Edit \> Preferences \> Key servers \> Publish key to: choose a key server. For example: hkp://pgp.mit.edu:11371. Close the dialog.
124150- Remote \> Sync and publish key \> Sync.
125151
126152### Remember the key ID
127153
128154You need the key ID later. The key ID is shown in seahorse. But you can see it also via:
129155
130-` gpg --list-keys`
156+```text
157+ gpg --list-keys
158+```
131159
132160## Updating repository files
133161
134162Put the following script into /var/www/lazarus, edit it for your needs and run it:
135163
136164 #!/usr/bin/env bash
137165
138166 set -x
139167
140168 GPGHome=/home/gaertner/.gnupg/
141169 MainDir=dists/lazarus-testing
142170
143171 for Arch in i386 amd64; do
144172 Dir=$MainDir/universe/binary-$Arch
145173
146174 # create index
147175 apt-ftparchive packages $Dir > $Dir/Packages
148176 cat $Dir/Packages | gzip -9c > $Dir/Packages.gz
149177 cat $Dir/Packages | bzip2 > $Dir/Packages.bz2
150178 done
151179
152180 # create Release file
153181 rm -f $MainDir/Release*
154182 Date=`date`
155183 echo "Origin: Lazarus" >> $MainDir/Release
156184 echo "Label: Lazarus" >> $MainDir/Release
157185 echo "Suite: unstable" >> $MainDir/Release
158186 echo "Codename: lazarus-testing" >> $MainDir/Release
159187 echo "Version: 1.0" >> $MainDir/Release
160188 echo "Date: $Date" >> $MainDir/Release
161189 echo "Architectures: amd64 i386" >> $MainDir/Release
162190 echo "Components: universe" >> $MainDir/Release
163191 echo "Description: Lazarus testing 1.0" >> $MainDir/Release
164192
165193 apt-ftparchive release $MainDir >> $MainDir/Release
166194
167195 # sign Release file
168196 gpg --sign --homedir=$GPGHome -ba -o $MainDir/Release.gpg $MainDir/Release
169197
170198 # end.
171199
172200This 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*).
173201
174202## Adding the repository to a client
175203
176204*IMPORTANT*: If you only came here to download lazarus for ubuntu/debian then use the stable repository [[Getting Lazarus|Ubuntu repository]]. The repository below is an unstable, testing repository.
177205
178206The following steps must be done on each computer, you want to use your repository.
179207
180208### Add the key
181209
182210Download the key from the public key server:
183211
184-` gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 3A5B1204`
212+```text
213+ gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 3A5B1204
214+```
185215
186216The 3A5B1204 should be replaced with your key id. Check the output, that you got the right key.
187217
188218Add it to the apt system:
189219
190-` gpg --export 3A5B1204 | sudo apt-key add -`
220+```text
221+ gpg --export 3A5B1204 | sudo apt-key add -
222+```
191223
192224You can see the list of apt keys with:
193225
194-` sudo apt-key list`
226+```text
227+ sudo apt-key list
228+```
195229
196230### Add the repository
197231
198232You can use synaptic for this or edit the /etc/apt/sources.list directly. Add the line:
199233
200-` deb `[`http://progprak.scale.uni-koeln.de/lazarus/`](http://progprak.scale.uni-koeln.de/lazarus/)` lazarus-testing universe`
234+```text
235+ deb http://progprak.scale.uni-koeln.de/lazarus/ lazarus-testing universe
236+```
201237
202238Replace the http path with your own.
203239
204240## Install Lazarus
205241
206242For example:
207243
208-` sudo apt-get update`\
209-` sudo apt-get install lazarus`
244+```text
245+ sudo apt-get update
246+ sudo apt-get install lazarus
247+```
210248
211249---
212250*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](/wiki-contact).*

Back to history