]> pere.pagekite.me Git - homepage.git/blob - mypapers/drafts/store-extra/index.html
Generated.
[homepage.git] / mypapers / drafts / store-extra / index.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
2 "http://www.w3.org/TR/REC-html40/loose.dtd">
3 <HTML>
4 <META NAME="GENERATOR" CONTENT="TtH 2.67">
5
6
7
8 <title> store-extra: Useful Store admin and config applications</title>
9
10 <H1 align="center">store-extra: Useful Store admin and config applications </H1>
11
12 <H3 align=center>Petter Reinholdtsen &lt; pere@td.org.uit.no &gt; </H3>
13
14 <H3 align=center>2000-06-27 </H3>
15
16 <p>
17 <H2><A NAME="tth_sEc1">
18 1</A>&nbsp;&nbsp;Introduction</H2>
19
20 <p>
21 The <tt>store-extra</tt> Store application is my collection of useful
22 Store admin and config scripts which is not part of the Store base
23 (<tt>perl-internal</tt>). Most of it used to be part of smaller
24 applications, but I decided to collect it into one application
25 instead.
26
27 <p>
28 This is the collection of what used to be <tt>store-pere</tt>, <tt>
29 env-config</tt>, <tt>mime-config</tt>, <tt>emacs-info</tt>, <tt>build-all</tt> and
30 some scripts from NTNUs <tt>emacs</tt> application.
31
32 <p>
33 I did not write all these scripts. I have lost track of all the
34 authors, but some of them were written by Espen Skoglund, Bjørn
35 Stabell, Arne H. Juul, and more. If your credit is missing here,
36 please let me know.
37
38 <p>
39 <H2><A NAME="tth_sEc2">
40 2</A>&nbsp;&nbsp;Compiling new applications and versions</H2>
41
42 <p>
43 The build-all scripts provides the simplest way to compile new
44 programs in store. It works best with source using GNU autoconf and
45 Perl modules. It has limited support for X imake source and normal
46 makefiles. If the application fails to compile using build-all, the
47 original method described in the original Store documentation must be
48 used instead.
49
50 <p>
51 When everything works as it should, this sequence would give a
52 compiled version of a new application:
53
54 <p>
55
56 <OL type="1">
57 <li> Make new application subdirectory in <tt>/store/store/&lt;master&#62;/</tt>.
58
59 <p>
60
61 <li> Fetch source and update <tt>registration</tt> with source location.
62 FTP sites are better then HTTP sites. Replace version number with
63 <tt>$version</tt> to allow automatic detection of new versions.
64
65 <p>
66 <font size="-1">
67 <blockquote>
68 <pre>
69 echo 'Source: ftp://ftp.gnu.org/pub/gnu/gcc-${version}.tar.gz' &#62;&#62; registration
70 </pre></blockquote>
71 </font>
72
73 <p>
74
75 <li> Unpack source in application subdirectory. Rename source
76 subdirectory to <tt>src-&lt;version&#62;</tt>.
77
78 <p>
79
80 <li> Check source to find out if there is a <tt>configure</tt> script
81 (=buildtype GNU) or a <tt>Makefile.PL</tt> file (=buildtype pm). If
82 not, build-all is likely to fail.
83
84 <p>
85
86 <li> Create a file <tt>buildinfo</tt> in the applicatio subdirectory
87
88 <p>
89 with the information required to get build-all to compile this
90 application. The absolute minimum file contains <tt>appname</tt>, <tt>
91 version</tt> and <tt>buildtype</tt>.
92
93 <p>
94 <font size="-1">
95 <blockquote>
96 <pre>
97 appname=nasm
98 version=0.98
99 buildtype=GNU
100 </pre></blockquote>
101 </font>
102
103 <p>
104
105 <li> Run <tt>build-all [archs]</tt> in application subdirectory and
106 check the current compile status in the files <tt>out.&lt;arch&#62;</tt> to
107 find out if everything works as planned.
108
109 <p>
110 <font size="-1">
111 <blockquote>
112 <pre>
113 tail -f out.&lt;arch&#62;
114 </pre></blockquote>
115 </font>
116
117 <p>
118
119 <li> If this was a perl module, run <tt>pm-touch-compiled</tt> to make
120 sure platform dependent subdirectories are properly marked in Store.
121
122 <p>
123
124 <li> Check content of ver-&lt;version&#62; to make sure everything looks OK.
125
126 <p>
127
128 <li> Run <tt>chkapp</tt> to make sure everything went OK., <tt>
129 register</tt> to insert and update the info on the application and to
130 log what was done.
131
132 <p>
133
134 <li> Run <tt>linkup</tt> and test if the program is working.
135
136 <p>
137 </OL> <H2><A NAME="tth_sEc3">
138 3</A>&nbsp;&nbsp;Common environment settings</H2>
139
140 <p>
141 Two files are generated with the common environment settings, <tt>
142 /store/etc/src.sh</tt> and <tt>/store/etc/src.csh</tt>. One file for the
143 Bourne shell family (sh, ksh, zsh, bash, etc) and one for the C shell
144 family (csh, tcsh). These files are generated by <tt>
145 /store/etc/internal/make-env.pl</tt> based on the content in <tt>
146 /store/etc/ENV/ENV-*</tt>. They are regenerate every time the nightly
147 commands are being run.
148
149 <p>
150 The format is quite simple, with '#' as the comment marker, and the
151 fields in the env lines being
152 'username;group;priority;type;variable=content.
153
154 <p>
155
156 <blockquote>
157 <pre>
158 #
159 # Set path, check if directories exists.
160 *:*:1:p:PATH=/store/gnu/bin:/store/opt/*/bin
161 *:*:2:p:PATH=/store/bin:/store/sbin
162 !0:*:5:p:PATH=/usr/games
163 #
164 # Include in path without checking for the directories
165 *:*:1:n:XFILESEARCHPATH=/store/lib/X11/app-defaults/%N
166 *:*:9:n:XFILESEARCHPATH=/usr/local/lib/X11/%L/app-defaults/%N
167 #
168 # Single variable
169 *:*:9:s:PAGER=more
170 </pre>
171 </blockquote>
172
173 <p>
174 Username and group must be '*' or user or group id number. '!'
175 negates the test. In the example, this make sure user root (0) do not
176 get /usr/games as part of the PATH.
177
178 <p>
179 The path environment type 'p' and 'n' will remove duplicate entries,
180 and only keep the highest priority entry. The single entry
181 environment 's' will only keep the highest priority entry. The
182 priorities is sorted as perl strings, '12' having lower priority then
183 '9'.
184
185 <p>
186 The 'p' env type content might use filename globbing, as shown with
187 <tt>/store/opt/*/bin</tt>.
188
189 <p>
190 If you are installing an application which requires special
191 environment settings, the best way to handle this is to use a small
192 shell wrapper to set the environment and then call the program.
193 Renaming the binaries from <tt>file</tt> to <tt>file.exe</tt> and making a
194 new shell script <tt>file</tt> which sets the environment is the best
195 way. Only when this is no option, you should use the
196 etc/ENV/ENV-application files. I suggest naming the files en ENV/
197 after the application they belong to, i.e ENV-netscape for netscape
198 env settings and ENV-less for less env settings.
199
200 <p>
201 <H2><A NAME="tth_sEc4">
202 4</A>&nbsp;&nbsp;MIME mailcap files</H2>
203
204 <p>
205 When installing MIME content handlers, one wants to make them
206 automatically available in mail programs and web browsers. This is
207 done by placing a file in <tt>/store/etc/mailcaps/</tt>. The files are
208 named <tt>mailca-&lt;app&#62;-&lt;priority&#62;</tt>, and looks like normal MIME
209 mailcap entries:
210
211 <p>
212
213 <blockquote>
214 <pre>
215 audio/x-mpeg; /store/bin/mpg123 %s;
216 </pre></blockquote>
217
218 <p>
219 Based on these files, a list of MIME content handlers are generated
220 into <tt>/store/etc/mailcap</tt> by <tt>
221 /store/etc/internal/make-mailcap.pl</tt>. The priorities are sorted as
222 numbers.
223
224 <p>
225 <H2><A NAME="tth_sEc5">
226 5</A>&nbsp;&nbsp;Emacs info and default.el files</H2>
227
228 <p>
229 <H3><A NAME="tth_sEc5.1">
230 5.1</A>&nbsp;&nbsp;Emacs info directory</H3>
231
232 <p>
233 All emacs info files should be installed in <tt>/store/info/</tt>. These
234 files can (and probably should) be compressed with <tt>gzip</tt>. Based
235 on the content of this subdirectory, a emacs info directory file (<tt>
236 /store/info/dir</tt>) is generated by <tt>
237 /store/etc/internal/make-emacs-dir.pl</tt>. This program requires a
238 section like this in the info files:
239
240 <p>
241
242 <blockquote>
243 <pre>
244 INFO-DIR-SECTION Programming
245 START-INFO-DIR-ENTRY
246 * Cpp: (cpp). The GNU C preprocessor.
247 END-INFO-DIR-ENTRY
248 </pre></blockquote>
249
250 <p>
251 All emacs info and texinfo files should have a section like this. If
252 it is missing, send a patch to the author. When working with .texi
253 files, a section like this will make sure the resulting info files
254 will be included in the info/dir file:
255
256 <p>
257
258 <blockquote>
259 <pre>
260 @dircategory Programming
261 @direntry
262 * Cpp: (cpp). The GNU C preprocessor.
263 @end direntry
264 </pre></blockquote>
265
266 <p>
267 <H3><A NAME="tth_sEc5.2">
268 5.2</A>&nbsp;&nbsp;Emacs default.el</H3>
269
270 <p>
271 Generates <tt>/store/lib/emacs/site-lisp/default.el</tt> and <tt>
272 /store/share/emacs/site-lisp/default.el</tt> from <tt>default.el-&lt;app&#62;</tt>
273 in the same directory.
274
275 <p>
276 <H2><A NAME="tth_sEc6">
277 6</A>&nbsp;&nbsp;Netscape plugins</H2>
278
279 <p>
280 To make sure Netscape finds the installed plugins, they must be
281 installed in a common directory, and environment <tt>
282 NPX_PLUGIN_PATH</tt> must be set to point to this directory. The
283 environment should be set in a wrapper shell to make sure it is always
284 set when netscape is running.
285
286 <p>
287 I propose using <tt>/store/opt/ns-plugins/</tt> as this common directory.
288 I suggest naming the Netscape plugin applications with prefix '<tt>
289 nsp-</tt>', to make it easier to track the different netscape plugins
290 available.
291
292 <p>
293 <H2><A NAME="tth_sEc7">
294 7</A>&nbsp;&nbsp;GIMP plugins</H2>
295
296 <p>
297 [I do not know enough about gimp to make a suggestion here.]
298
299 <p>
300 <H2><A NAME="tth_sEc8">
301 8</A>&nbsp;&nbsp;List of recently installed applications</H2>
302
303 <p>
304 To make it easier for the users to keep track of the applications
305 available in /store, the script <tt>/store/etc/internal/news.pl</tt>
306 generates UNIX news files in <tt>/store/news</tt>. These files can then
307 be accessed by news(1) to get a list of recently installed
308 applications.
309
310 <p>
311 <H2><A NAME="tth_sEc9">
312 9</A>&nbsp;&nbsp;Various tools</H2>
313
314 <p>
315 - store-pere
316
317 <p>
318 check-libtool-libs.pl findold.pl nightly-fix-suid.pl sourcewatch.pl
319 chkapps.pl fix-docdirs.pl prognews.pl usage.pl
320 collectusage.pl showusage.pl vusage.pl
321
322 <p>
323 compare-linktrees store-app-dependson
324
325 <p>
326 <H2><A NAME="tth_sEc10">
327 10</A>&nbsp;&nbsp;Build-all - parallel multiplatform autocompile</H2>
328
329 <p>
330 The buildall system consist of the following configuration files:
331
332 <p>
333
334 <UL>
335 <br>\~{}store/etc/master.conf Site specific configuration (information about master store
336 etc).
337
338 <p>
339
340 <br>\~{}store/etc/buildhosts The list Store architectures to compile for, and the hosts to
341 compile the application for this architecture.
342
343 <p>
344
345 <br>\$appdir/buildinfo The application specific information, located in the
346 application master directory.
347
348 <p>
349 </UL>The following programs are part of buildall:
350
351 <p>
352
353 <UL>
354 <br>/store/bin/build-all The program called when starting to compile. This must be run
355 in the application master directory.
356
357 <p>
358
359 <br>/store/etc/internal/buildsubs Script called by build-all to do the work required.
360
361 <p>
362
363 <br>/store/bin/pm-touch-compiled Perl module compile support script.
364
365 <p>
366
367 <br>/store/etc/internal/etc/pm-a-by-a Mapping mellom store-arkitektur og Perl5 arkitekturnavn
368
369 <p>
370 </UL> <H3><A NAME="tth_sEc10.1">
371 10.1</A>&nbsp;&nbsp;buildinfo variables</H3>
372
373 <p>
374
375 <H2>References</H2>
376
377 <p>
378 Store documentation, http://www.pvv.org/&#126;arnej/store/storedoc.html
379
380 <p>
381 Automatisk kompilering av Store-programmer på alle plattformer
382
383 <p>
384 ==============================================================
385
386 <p>
387 Petter Reinholdtsen &lt;pere@td.org.uit.no&#62;, 1999-07-27
388
389 <p>
390 IT-avdelingen bruker et system kalt 'build-all' hentet fra NTNU for
391 dette. Når det virker går kompilering mye raskere enn før. Når det
392 ikke virker gjøres kompilering som før. Kopi av NTNUs buildinfo filer
393 ligger i store-applikasjon build-all/ntnu-buildinfo/
394
395 <p>
396 For å autokompilere for flere arkitekturer lager du et /bin/sh script
397 'buildinfo' i applikasjonskatalogen på master, parallelt med fila
398 'registration', for å sette endel variabler. Deretter kjører du
399 'build-all'. Hvis alt gikk bra, har du etter en stund kompilert opp
400 applikasjonen for alle plattformer. Sjekk out.* for å se hvordan det
401 går med bygging av applikasjonen.
402
403 <p>
404 Når kompileringen er ferdig på alle plattformer (siste linje i out.*
405 er "...done"), så kjøres chkapp og register på vanlig måte.
406
407 <p>
408 Eksempelfil for GNU configure programmer:
409
410 <p>
411 appname=zsh
412 version=3.1.5
413 buildtype=GNU
414
415 <p>
416 Eksempelfil for Perl5 moduler:
417
418 <p>
419 appname=Net-Netmask.pm
420 version=1.6
421 buildtype=pm
422
423 <p>
424 Følgende variabler kan settes:
425
426 <p>
427 appname
428 Navn på applikasjonen som skal genereres, dvs katalognavnet i
429 Master Store. Må settes, ingen default.
430 version
431 Versjon på applikasjonen som skal genereres. Må settes, ingen
432 default.
433 buildtype
434 Hvordan kompilering av applikasjonen skal gjøres. Må settes,
435 ingen default. Følgende er støttet:
436
437 <p>
438 X xmkmf og make
439 GNU GNU Autoconf oppsett
440 pm Perl5 module, dvs applikasjon med 'Makefile.PL'
441 make ???. Forutsetter at konfigurering allerede er gjort.
442
443 <p>
444 prefix
445 Kan være blank. Default er '/store'.
446 confstring
447 Kan være blank. Parameter til configure for buildtype GNU.
448 Default er '-prefix=$prefix'.
449 confcmd
450 Kan være blank, da brukes confstring eller standard for buildtype
451 GNU ('./configure $confstring').
452 maketargets
453 Kan være blank. Parameter til make. Default er intet
454 parameter.
455 installtargets
456 Kan være blank. Parameter til make for a installere
457 applikasjonen. Default for X er 'install install.man', for
458 alle andre 'install'
459 linkdownfirst
460 linkupafter
461 Kan være blank. Liste over applikasjoner som linkes henholdsvis
462 ned og opp fra linktreet før og etter installasjon.
463 Space-separert liste.
464 postpostinstcmds
465 Kan være blank. Kommando som kjøres etter postinst på
466 maskinen er installasjonen ble gjennomført.
467 linkupthis
468 Liste over applikasjoner som skal linkes opp før kompilering.
469 Formatet er 'app versjon store', og flere applikasjoner skilles
470 med skråstrek(/). Eksempel:
471 linkupthis='glib 1.2.2/gtk 1.2.2'
472 rsh
473 Kan være blank. Hvilken kommando som brukes for å kjøre
474 kommandoer på andre maskiner. Default er 'ssh -x'.
475 nice
476 Kan være blank. Nive-nivå for 'configure'- og
477 'make'-kommendoene. Default er 'nice -15'
478 timeout
479 Kan være blank. Timeout-verdi for postinst. Default er 25.
480
481 <p>
482 Tilgjengelige shell-variabler i confcmd og postpostinstcmds:
483
484 <p>
485 SARCH Store-arkitektur
486 PMA Perl5 arkitekturnavn (for pm buildtype)
487
488 <p>
489 Buildall-systemet består av følgende filer:
490
491 <p>
492 /store/bin/build-all
493 Oppstart-scriptet som kjøres fra master-dir for applikasjonen
494 /store/etc/internal/buildsubs
495 Skriptet som gjør jobben
496 /store/etc/internal/etc/pm-a-by-a
497 Mapping mellom store-arkitektur og Perl5 arkitekturnavn
498 $HOME/etc/buildhosts
499 Liste over hvilke maskiner de forskjellige arkitekturene
500 kompileres på.
501 $HOME/etc/master.conf
502 Informasjon om master-store.
503 $appdir/buildinfo
504 Informasjon om applikasjonen som skal kompileres
505
506 <p>
507
508 <p><hr><small>File translated from
509 T<sub><font size="-1">E</font></sub>X
510 by <a href="http://hutchinson.belmont.ma.us/tth/">
511 T<sub><font size="-1">T</font></sub>H</a>,
512 version 2.67.<br>On 4 Oct 2000, 18:36.</small>
513 </HTML>