-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcm3-and-elego.html
More file actions
414 lines (367 loc) · 15 KB
/
cm3-and-elego.html
File metadata and controls
414 lines (367 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CM3 5.1 and Elego ComPact</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<META HTTP-EQUIV="Resource-type" CONTENT="document">
<META HTTP-EQUIV="Reply-to" CONTENT="m3-support@elego.de">
<LINK HREF="normal.css" REL="stylesheet" TYPE="text/css">
<META NAME="robots" content="noindex">
</head>
<body bgcolor="#ffffff">
<h2>CM3 5.1 and Elego ComPact</h2>
<p>
Instead of using the shell scripts provided in the
<tt>script</tt> directory of the source distribution, you can
use the project manager of
<a href="http://dcvs.elegosoft.com/elego-compact/">
Elego ComPact</a> to build, ship, clean, and generally
maintain the CM3 5.1 packages. Elego ComPact offers also a
component based view of version control (with components being
packages, projects, and configurations) built on top of
CVS. <b>Elego ComPact <i>Free</i></b> (free non-commercial use)
and <b>Elego ComPact <i>Demo</i></b> (expiring free evaluation)
can be downloaded from
<a href="http://www.elego-software-solutions.com/">Elego's WWW
site</a>.
</p>
<p>
Currently Elego ComPact is not distributed as open source, but
with the release of CM3 5.1 there may be a more tightly
integrated version of the Elego ComPact project manager and the
CM3 builder that we release under the DEC SRC copyright. If
you're interested in this, please write us about it. Elego
ComPact is written entirely in Modula-3.
</p>
<h3>How to compile CM3 5.1 with Elego ComPact</h3>
<p>
It's quite easy to use Elego ComPact together with the CM3 5.1
distribution. These steps are necessary:
</p>
<ol>
<li>
<a href="#c1">Install Elego ComPact</a>
</li>
<li>
<a href="#c2">Define an appropriate package kind</a>
</li>
<li>
<a href="#c3">Setup an Elego ComPact project</a>
</li>
</ol>
<p>
You may then
</p>
<ol>
<li>
<a href="#c4">Compile and ship CM3 packages with Elego ComPact</a>
</li>
<li>
<a href="#c5">Version control your CM3 packages</a>
</li>
<li>
<a href="#c6">Apply arbitrary commands to one, several, or all
packages</a>
</li>
</ol>
<h4><a name="c1">Install Elego ComPact</a></h4>
<p>
Please refer to the installation instructions on
<a href="http://dcvs.elegosoft.com/download-info-en.php">
Elego's Download pages</a>. Basically you only need to get the
executable programs for your platform, unpack them somewhere in
your file system, and extend your PATH. It is probably a good
idea to get the configuration and manual archives as well,
though.
</p>
<p>
The program you're using for project management tasks is named
<tt>prjm</tt>. You will get a short help notice with <tt>prjm
-h</tt> and a more verbose description with <tt>prjm -man</tt>.
You can also use Elego ComPact's graphical user interface
<tt>ComPactHTTPd</tt>.
</p>
<p>
Try to run the programs and have a look at the in-line help. If
you encounter any problems, feel free to contact <a
href="mailto:compact{at}elego.de">compact{at}elego.de</a>.
</p>
<h4><a name="c2">Define an appropriate package kind</a></h4>
<p>
The Elego ComPact tools need to be able to locate and identify
your CM3 packages. As Elego ComPact is language independent, it
needs some information about the structure of packages and the
actions that may be applied to them. Here at Elego we currently
use the following definitions:
</p>
<pre>
# ----------------------------------------------------------------------------
# CM3 5.1 System Packages on UNIX
# ----------------------------------------------------------------------------
pkgkind CRITICAL_MASS_M3_SYS_UNIX
ostype "bsd|unix|linux|sunos5" has file "src/m3makefile" and dir "src"
inherit actions BASIC_VC_UNIX_OVERRIDES
inherit actions BASIC_VC
inherit actions CRITICAL_MASS_M3_SYS
# ----------------------------------------------------------------------------
# CM3 5.1 System Packages on Win32
# ----------------------------------------------------------------------------
pkgkind CRITICAL_MASS_M3_SYS_WIN32
ostype "winnt|windows|win32|nt|cygwin" has file "src/m3makefile" and dir "src"
inherit actions CRITICAL_MASS_M3_SYS
# ----------------------------------------------------------------------------
# CM3 5.1 System Packages
# ----------------------------------------------------------------------------
pkgkind CRITICAL_MASS_M3_SYS
has file "src/m3makefile" and dir "src"
inherit actions BASIC_VC
action build "m3msh -- rm .bok && cm3 {?OPT} {?CM3OPT} -build 2> PkgErr && m3msh -- touch .bok"
action buildlocal "m3msh -- rm .bok && cm3 {?OPT} {?CM3OPT} -DROOT={!ROOT} -build -override && m3msh -- touch .bok"
action builtok "test -f .bok"
action shipglobal "cm3 {?OPT} {?CM3OPT} -ship 2> PkgErr && m3err PkgErr"
action shipproject "cm3 {?OPT} {?CM3OPT} -ship 2> PkgErr && m3err PkgErr"
action shiplocal "echo no shipping needed"
action clean "cm3 {?OPT} {?CM3OPT} -clean 2> PkgErr && m3err PkgErr"
action realclean "m3msh rm {?OPT} {?RMOPT} PkgDep PkgCDT PkgCRT PkgErr ; cm3 {?OPT} {?CM3OPT} -clean"
action mkdep "m3dep {?OPT} {?M3DEPOPT} > PkgDep && test -f src/m3overrides || m3ovr -v {!LOCATIONS} > src/m3overrides 2> PkgErr"
</pre>
<p>
These definitions extend the standard definitions bundled with
Elego ComPact's programs. We suggest you put them into the file
<tt>${HOME}/compact/PkgBase.DefaultData</tt>, which is one of
the standard locations where ComPact will look for them.
</p>
<p>
You could as well use the bundled definitions only, but by
default the project manager will overwrite your
<tt>m3overrides</tt> files with generated ones containing
absolute paths from your workspace. This will make it difficult
to provide patches (context diffs). So we suggest you use the
above definitions and ensure that all the m3override files are
correct, i.e. defining all necessary overrides relative to the
variable <tt>ROOT</tt>. As the first source distribution of CM3
did only contain some correct m3override files, you probably
want to get the <a href="m3override-update.tgz"
type="application/octet-stream">m3override-update.tgz</a> update
archive. You will notice that the buildlocal action uses the
variable <tt>ROOT</tt> which must be passed to <tt>prjm</tt> on
the command line, e.g. <tt>prjm -D ROOT=~/work/cm3
more-arguments</tt>.
</p>
<p>
Finally you need to make sure that Elego ComPact correctly
identifies your packages. You can do this by setting the
environment variable <tt>PKGKIND=CRITICAL_MASS_M3_SYS_UNIX</tt>
and exporting its value, or by placing a <tt>PkgKind</tt> file
containing that name in every package root. This can easily be
accomplished with one of the scripts in <tt>cm3/scripts</tt>:
</p>
<pre>
./pkgmap.sh -c 'echo CRITICAL_MASS_M3_SYS_UNIX > PkgKind' `cat PKGS`
</pre>
<p>
If the package database <tt>PKGS</tt> does not yet exist, you
must create it with <tt>./find-packages</tt>.
</p>
<p>
That's all that is needed for the general setup of Elego ComPact
and CM3.
</p>
<h4><a name="c3">Setup an Elego ComPact project</a></h4>
<p>
To actually do something useful with the Elego ComPact tools,
and CM3, you also need one or more <b>project
descriptions</b>. These are packages that contain a <b>project
description file (PrjDesc)</b>. A project description file that
contains some CM3 standard packages looks like this
(<tt>~/work/prjm/cm3-std/PrjDesc</tt>):
</p>
<pre>
collectionroot ${PRJ_ROOT}
collection m3-comm at cm3/m3-comm
collection m3-db at cm3/m3-db
collection m3-demo at cm3/m3-demo
collection m3-games at cm3/m3-games
collection m3-lectern at cm3/m3-lectern
collection m3-libs at cm3/m3-libs
collection m3-mail at cm3/m3-mail
collection m3-obliq at cm3/m3-obliq
collection m3-pkgtools at cm3/m3-pkgtools
collection m3-sys at cm3/m3-sys
collection m3-tools at cm3/m3-tools
collection m3-ui at cm3/m3-ui
collection m3-www at cm3/m3-www
collection sharedboard at cm3/m3-demo/sharedboard
package m3core in m3-libs
package libm3 in m3-libs
package X11R4 in m3-ui
package bitvector in m3-libs
package digraph in m3-libs
package formsedit in m3-ui
package formsvbt in m3-ui
package formsvbtpixmaps in m3-ui
package formsview in m3-ui
package jvideo in m3-ui
package m3back in m3-sys
package m3bundle in m3-tools
package m3scanner in m3-sys
package m3tk in m3-tools
package netobj in m3-comm
package netobjd in m3-comm
package parseparams in m3-libs
package realgeometry in m3-libs
package set in m3-libs
package slisp in m3-libs
package sortedtableextras in m3-libs
package stubgen in m3-comm
package table-list in m3-libs
package tcp in m3-comm
package tempfiles in m3-libs
package ui in m3-ui
package vbtkit in m3-ui
package videovbt in m3-ui
package web in m3-www
</pre>
<p>
The <tt>PrjDesc</tt> file contains definitions of collections
and packages and their location. In the file above, all package
locations are relative to the environment variable
<tt>PRJ_ROOT</tt>, which is convention at Elego. You could also
directly insert the path to the root of your workspace there.
</p>
<p>
A <tt>PrjDesc</tt> file must reside in the directory where
<tt>prjm</tt> is invoked, which is then considered to be a
project package. A project package is also used by <tt>prjm</tt>
to save and reconstruct project configurations and version
control the needed meta data. For build management purposes you
need not concern yourself with these uses.
</p>
<p>
It is probably easiest to get the <a href="cm3-elego-5.1.0.tgz">
cm3-elego-5.1.0.tgz</a> archive which contains some example
project files and the appropriate package kind definitions.
</p>
<h4><a name="c4">Compile and ship CM3 packages with Elego
ComPact</a></h4>
<p>
Once you have setup everything as described, you can easily
compile an arbitrary big set of packages. We'll use the cm3-std
project again as an example, which we assume is installed in
your home directory under <tt>${HOME}/work/prjm/cm3-std</tt>:
</p>
<pre>
PRJ_ROOT=${HOME}/work
ROOT=${HOME}/work/cm3
export ROOT PRJ_ROOT
prjm -D ROOT=${ROOT} -buildlocal
</pre>
<p>
The first three lines are just to remind you of the setup
needed, while the last line will compile all packages in the
<tt>PrjDesc</tt> file. The project manager will automatically
determine the dependencies of the packages (as long as all the
imports can be found in the top-level m3makefile) and issue all
needed commands. It also uses a cache containing fingerprints of
all the packages, so that only packages that have changed will
be re-compiled. So the given command should usually find a quite
minimal set of build commands.
</p>
<p>
If you want to compile all the packages and ship them to the CM3
package pool (usually in <tt>/usr/local/cm3/pkg</tt>), use the
following command:
</p>
<pre>
prjm -D ROOT=${ROOT} -buildglobal
</pre>
<h4><a name="c5">Version control your CM3 packages</a></h4>
<p>
If you have set up CVS and your packages are under version
control, you can use the Elego ComPact package version manager
<tt>pkgvm</tt> to checkout named versions of packages, commit
changes, view diff listings, package logs, etc. And you can use
the project manager <tt>prjm</tt> to apply version control on a
project wide scale. Note: You <em>must</em> have checked out the
packages from a CVS repository for this to work. Elego would
like to provide public access to the CM3 CVS repository via CVS
and CVSup, but this needs some time to organize and setup;
anyway, it's not working yet.
</p>
<p>
Let's assume you have got a working CVS repository with all the
versions of all the CM3 sources. You can then checkout an
initial workspace populated with the latest versions with:
</p>
<pre>
prjm -get head
</pre>
<p>
If you have made some modifications, you may want to see what
packages are modified and produce a unified context diff of all
the changes:
</p>
<pre>
prjm -mod
prjm -m -q -qc -udiff
</pre>
<p>
You could then commit all the changes and create a named change
set at the same time:
</p>
<pre>
prjm -m -cs my-change-set -commit patch
</pre>
<p>
To remember the current configuration of your workspace under a
simple name, you would make use of a snapshot:
</p>
<pre>
prjm -snapshot my-snapshot-name
</pre>
<p>
This configuration could then be restored using the <tt>-get</tt>
command of the project manager at any time.
</p>
<p>
There are a lot of more version control functions you can use to
control the history of your projects. We will not enumerate them
here and be content with the given examples; please have a look
at the complete
<a href="http://dcvs.elegosoft.com/compact/index.html">
Elego ComPact Manuals</a>.
</p>
<h4><a name="c6">Apply arbitrary commands to one, several, or all
packages</a></h4>
<p>
The Elego ComPact project manager is a tool which applies
actions to a set of packages. Some actions are pre-defined, but
you may as well apply any other command to one, some, or all
packages of a project.
</p>
<pre>
prjm -apply 'wc src/*.i3 src/*.m3'
</pre>
<p>
will give you the character, word, and line number of the m3
files in the <tt>src</tt> directory of your packages. You could
as well search for something or replace certain expressions
using some standard POSIX tools:
</p>
<pre>
prjm -k -apply 'test -f src/m3overrides &&
mv src/m3overrides src/m3overrides.bak &&
sed -e 's/ROOT/TOP/g' src/m3overrides.bak > src/m3overrides'
</pre>
<p>
This would change all the ROOT variables in the override files
to TOP. The Elego ComPact command line tools fit nicely in the
old paradigm of small tools that can be combined in various
ways.
</p>
<hr>
<address><a href="mailto:m3-support{at}elego.de">m3-support{at}elego.de</a></address>
<!-- Created: Fri Feb 16 15:27:10 MET 2001 -->
</body>
</html>