Sign in Join
Wiki copytemporary

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

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## O que é um repositório?
22
33Um repositório Ubuntu é um diretório. Ele pode ser guardado num disco local ou em um servidor Web ou FTP. To use it, you add its path into your /etc/apt/sources.list and setup a pgp key. Then you can simply install lazarus with your favourite package gui (e.g. synaptic) and fpc, fpc-src and lazarus will be downloaded, installed and updated automatically.
44
55## Who needs it?
66
77Administrators who wants to install FPC+Lazarus on a pool of computers. Like in school. Or newbies who just want to quickly test it.
88
99## The directory structure
1010
1111Let's assume you want create a repository available via the apache webserver. Then you need to setup a directory like /var/www/lazarus that is public readable and only writable by root.
1212
1313Create a sub directory for each target you want to support:
1414
15-` mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-i386`\
16-` mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-amd64`
15+``` pascal
16+ mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-i386
17+ mkdir -p /var/www/lazarus/dists/lazarus-testing/universe/binary-amd64
18+```
1719
1820## The debs
1921
2022Put the fpc, fpc-src and lazarus deb files into it.
2123
2224### Creating the deb files yourself
2325
2426You can create the debs with the scripts in tools/install/ of the lazarus sources.
2527
2628#### Install development packages
2729
2830- install development packages:
2931
30-` sudo apt-get install libgtk2.0-dev libgtk1.2-dev libgdk-pixbuf-dev libgpmg1-dev fakeroot libncurses5-dev`
32+```text
33+ sudo apt-get install libgtk2.0-dev libgtk1.2-dev libgdk-pixbuf-dev libgpmg1-dev fakeroot libncurses5-dev
34+```
3135
3236- Install the latest stable FPC. This is needed to build the new FPC and Lazarus:
3337
34-` Either the deb files from the official site or the tar.gz.`
38+```text
39+ Either the deb files from the official site or the tar.gz.
40+```
3541
3642- Download the FPC sources. To get the current development version you can use the command below. To get a more stable version, see [[Installing Lazarus|Installing_Lazarus#FPC Sources]]:
3743
38-` svn co `[`http://svn.freepascal.org/svn/fpc/trunk`](http://svn.freepascal.org/svn/fpc/trunk)` fpc`
44+```text
45+ svn co http://svn.freepascal.org/svn/fpc/trunk fpc
46+```
3947
4048- Download the lazarus sources:
4149
42-` svn co `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)` lazarus`
50+```text
51+ svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
52+```
4353
4454#### Build new deb
4555
4656- go into the lazarus install script directory:
4757
48-` cd lazarus/tools/install`
58+```text
59+ cd lazarus/tools/install
60+```
4961
5062- build the fpc deb. 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:
5163
52-` sudo ./create_fpc_deb.sh fpc /path/to/the/sources/of/fpc/`
64+```text
65+ sudo ./create_fpc_deb.sh fpc /path/to/the/sources/of/fpc/
66+```
5367
5468- install the new fpc deb. This is needed to build the lazarus deb, which depends on the new fpc deb. Don't forget to uninstall first your old FPC.
5569
56-` sudo dpkg -i fpc_2.3.1-070726_i386.deb`
70+```text
71+ sudo dpkg -i fpc_2.3.1-070726_i386.deb
72+```
5773
5874- build the fpc-src deb. This works pretty much the same as above:
5975
60-` ./create_fpc_deb.sh fpc-src /path/to/the/sources/of/fpc/`
76+```text
77+ ./create_fpc_deb.sh fpc-src /path/to/the/sources/of/fpc/
78+```
6179
6280- build the lazarus deb. You can either build a normal lazarus:
6381
64-` ./create_lazarus_deb.sh append-revision`
82+```text
83+ ./create_lazarus_deb.sh append-revision
84+```
6585
6686or a lazarus using gtk2:
6787
68-` ./create_lazarus_deb.sh gtk2 append-revision`
88+```text
89+ ./create_lazarus_deb.sh gtk2 append-revision
90+```
6991
7092#### Replace the deb files in the repository
7193
7294- Now you have 3 deb files. Copy them to your repository:
7395
74-` cp fpc_2.3.1-070726_i386.deb fpc-src_2.3.1-070726_i386.deb lazarus_0.9.23.11636-0_i386.deb \`\
75-`   /var/www/lazarus/dists/lazarus-testing/universe/binary-i386/`
96+``` pascal
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/
99+```
76100
77101- Don't forget to remove the old ones.
78102
79103## PGP Key
80104
81105You need to sign the debs with a PGP key, so that the target systems can be sure, that no evil-doer replaced the files.
82106
83107### Creating a PGP key
84108
85109You can use tools like seahorse or thunderbird to create the PGP key.
86110
87111- Install seahorse
88112- start seahorse
89113- Key \> Create new key
90114- A window popup up asking for the type. Choose *PGP Key*.
91115- Give a full name and an email adress and click *Create*.
92116- 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.
93117- Creating the keys will take some minutes
94118
95119### Upload the key to a public key server
96120
97121In order to share the key you can upload the key to a public key server.
98122
99123- start seahorse
100124- Edit \> Preferences \> Key servers \> Publish key to: choose a key server. For example: hkp://pgp.mit.edu:11371. Close the dialog.
101125- Remote \> Sync and publish key \> Sync.
102126
103127### Remember the key ID
104128
105129You need the key ID later. The key ID is shown in seahorse. But you can see it also via:
106130
107-` gpg --list-keys`
131+```text
132+ gpg --list-keys
133+```
108134
109135## Updating repository files
110136
111137Put the following script into /var/www/lazarus, edit it for your needs and run it:
112138
113139 #!/usr/bin/env bash
114140
115141 set -x
116142
117143 GPGHome=/home/gaertner/.gnupg/
118144 MainDir=dists/lazarus-testing
119145
120146 for Arch in i386 amd64; do
121147 Dir=$MainDir/universe/binary-$Arch
122148
123149 # create index
124150 apt-ftparchive packages $Dir > $Dir/Packages
125151 cat $Dir/Packages | gzip -9c > $Dir/Packages.gz
126152 cat $Dir/Packages | bzip2 > $Dir/Packages.bz2
127153 done
128154
129155 # create Release file
130156 rm -f $MainDir/Release*
131157 Date=`date`
132158 echo "Origin: Lazarus" >> $MainDir/Release
133159 echo "Label: Lazarus" >> $MainDir/Release
134160 echo "Suite: unstable" >> $MainDir/Release
135161 echo "Codename: lazarus-testing" >> $MainDir/Release
136162 echo "Version: 1.0" >> $MainDir/Release
137163 echo "Date: $Date" >> $MainDir/Release
138164 echo "Architectures: amd64 i386" >> $MainDir/Release
139165 echo "Components: universe" >> $MainDir/Release
140166 echo "Description: Lazarus testing 1.0" >> $MainDir/Release
141167
142168 apt-ftparchive release $MainDir >> $MainDir/Release
143169
144170 # sign Release file
145171 gpg --sign --homedir=$GPGHome -ba -o $MainDir/Release.gpg $MainDir/Release
146172
147173 # end.
148174
149175This 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*).
150176
151177## Adding the repository to a client
152178
153179The following steps must be done on each computer, you want to use your repository.
154180
155181### Add the key
156182
157183Download the key from the public key server:
158184
159-` gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 3A5B1204`
185+```text
186+ gpg --keyserver hkp://pgp.mit.edu:11371 --recv-keys 3A5B1204
187+```
160188
161189The 3A5B1204 should be replaced with your key id. Check the output, that you got the right key.
162190
163191Add it to the apt system:
164192
165-` gpg --export 3A5B1204 | sudo apt-key add -`
193+```text
194+ gpg --export 3A5B1204 | sudo apt-key add -
195+```
166196
167197You can see the list of apt keys with:
168198
169-` sudo apt-key list`
199+```text
200+ sudo apt-key list
201+```
170202
171203### Add the repository
172204
173205You can use synaptic for this or edit the /etc/apt/sources.list directly. Add the line:
174206
175-` deb `[`http://progprak.scale.uni-koeln.de/lazarus/`](http://progprak.scale.uni-koeln.de/lazarus/)` lazarus-testing universe`
207+```text
208+ deb http://progprak.scale.uni-koeln.de/lazarus/ lazarus-testing universe
209+```
176210
177211Replace the http path with your own.
178212
179213## Install Lazarus
180214
181215For example:
182216
183-` sudo apt-get update`\
184-` sudo apt-get install lazarus`
217+```text
218+ sudo apt-get update
219+ sudo apt-get install lazarus
220+```
185221
186222---
187223*From the Free Pascal wiki, page "How to setup a FPC and Lazarus Ubuntu repository/pt", as it stood on 2007-10-19 after a change by Antoniog, 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