Initial IBM OpenAFS 1.0 tree
[openafs.git] / src / WINNT / doc / install / Documentation / en_US / html / CmdRef / auarf053.htm
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3//EN">
2 <HTML><HEAD>
3 <TITLE>Administration Reference</TITLE>
4 <!-- Begin Header Records  ========================================== -->
5 <!-- /tmp/idwt3190/auarf000.scr converted by idb2h R4.2 (359) ID      -->
6 <!-- Workbench Version (AIX) on 5 Nov 1999 at 13:58:29                -->
7 <META HTTP-EQUIV="updated" CONTENT="Fri, 05 Nov 1999 13:58:29">
8 <META HTTP-EQUIV="review" CONTENT="Sun, 05 Nov 2000 13:58:29">
9 <META HTTP-EQUIV="expires" CONTENT="Mon, 05 Nov 2001 13:58:29">
10 </HEAD><BODY>
11 <!-- (C) IBM Corporation 2000. All Rights Reserved    --> 
12 <BODY bgcolor="ffffff"> 
13 <!-- End Header Records  ============================================ -->
14 <A NAME="Top_Of_Page"></A>
15 <H1>Administration Reference</H1>
16 <HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf052.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Bot_Of_Page"><IMG SRC="../bot.gif" BORDER="0" ALT="[Bottom of Topic]"></A> <A HREF="auarf054.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P> 
17 <P>
18 <H2><A NAME="HDRPACKAGECONFIG" HREF="auarf002.htm#ToC_51">package Configuration File</A></H2>
19 <P><STRONG>Purpose</STRONG>
20 <A NAME="IDX4038"></A>
21 <A NAME="IDX4039"></A>
22 <A NAME="IDX4040"></A>
23 <P>Provides instructions for the <B>package</B> command
24 <P><STRONG>Description</STRONG>
25 <P>The <B>package</B> configuration file defines the file system elements
26 that the <B>package</B> command creates or alters on the local disk of an
27 AFS client machine it is configuring. Use the <B>-config</B> or
28 <B>-fullconfig</B> argument to the <B>package</B> command to identify
29 the configuration file to use.
30 <P><B>Summary of Configuration File Instructions</B>
31 <P>The configuration file can include one or more instances of each of the
32 following instructions, each on its own line. A more detailed
33 description of each instruction&#39;s syntax follows this list.
34 <DL>
35 <P><DT><B>B
36 </B><DD>Defines a block special device, such as a disk, which deals with input in
37 units of multi-byte command blocks
38 <P><DT><B>C
39 </B><DD>Defines a character special device, such as a terminal or tty, which deals
40 with input in single character units
41 <P><DT><B>D
42 </B><DD>Creates a directory
43 <P><DT><B>F
44 </B><DD>Creates or alters a file to match the contents of a specified source file
45 <P><DT><B>L
46 </B><DD>Creates a symbolic link
47 <P><DT><B>S
48 </B><DD>Defines a socket, which is a communications device for UDP and TCP/IP
49 connections
50 <P><DT><B>%define
51 </B><DD>Defines a variable or declares a string as defined
52 <P><DT><B>%ifdef
53 </B><DD>Specifies an action to perform if a certain string is declared or defined
54 <P><DT><B>%ifndef
55 </B><DD>Specifies an action to perform if a certain string is not declared or
56 defined
57 <P><DT><B>%include
58 </B><DD>Includes a library file
59 <P><DT><B>%undef
60 </B><DD>Declares a string not to be defined, or a variable no longer to have a
61 value
62 </DL>
63 <P><B>The B and C Instructions for Defining Block and Character Special
64 Devices</B>
65 <A NAME="IDX4041"></A>
66 <A NAME="IDX4042"></A>
67 <A NAME="IDX4043"></A>
68 <A NAME="IDX4044"></A>
69 <A NAME="IDX4045"></A>
70 <A NAME="IDX4046"></A>
71 <A NAME="IDX4047"></A>
72 <A NAME="IDX4048"></A>
73 <A NAME="IDX4049"></A>
74 <A NAME="IDX4050"></A>
75 <A NAME="IDX4051"></A>
76 <A NAME="IDX4052"></A>
77 <A NAME="IDX4053"></A>
78 <A NAME="IDX4054"></A>
79 <A NAME="IDX4055"></A>
80 <P>The <B>B</B> instruction in a <B>package</B> configuration file
81 defines a block special device, such as a disk, that deals with input in units
82 of multi-byte command blocks. The <B>C</B> instruction defines a
83 character special device, such as a terminal or tty, that deals with input in
84 single character units. They share a common syntax&#58;
85 <PRE>   {<B>B </B>| <B>C</B>}   <VAR>device_name</VAR>  <VAR>major_device</VAR>  <VAR>minor_device</VAR>  <VAR>owner</VAR>  <VAR>group</VAR>  <VAR>mode_bits</VAR>
86    
87 </PRE>
88 <P>where
89 <DL>
90 <P><DT><B>B
91 </B><DD>Indicates the definition of a block special device. It must be a
92 capital letter.
93 <P><DT><B>C
94 </B><DD>Indicates the definition of character special device. It must be a
95 capital letter.
96 <P><DT><B><VAR>device_name</VAR>
97 </B><DD>Names the special device to define. To learn the name format
98 appropriate to the machine&#39;s system type, consult the hardware or
99 operating system documentation.
100 <P><DT><B><VAR>major_device</VAR>
101 </B><DD>Specifies the device&#39;s major device number in decimal format.
102 To learn the correct value for the machine&#39;s system type, consult the
103 hardware or operating system documentation.
104 <P><DT><B><VAR>minor_device</VAR>
105 </B><DD>Specifies the device&#39;s minor device number in one of hexadecimal,
106 octal, or decimal format. Precede a hexadecimal number with the string
107 <B>0x</B> (zero and the letter <B>x</B>) or an octal number with a
108 <B>0</B> (zero). A number without either prefix is interpreted as a
109 decimal. To learn the correct value for the machine&#39;s system type,
110 consult the hardware or operating system documentation.
111 <P><DT><B><VAR>owner</VAR>
112 </B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
113 the device&#39;s owner in the output from the UNIX <B>ls -l</B>
114 command.
115 <P><DT><B><VAR>group</VAR>
116 </B><DD>Specifies the group name or UNIX group ID (GID) of the group to be
117 designated the device&#39;s group in the output from the UNIX <B>ls
118 -lg</B> command.
119 <P><DT><B><VAR>mode_bits</VAR>
120 </B><DD>Defines the device&#39;s UNIX mode bits. Acceptable values are the
121 standard three- or four-digit numbers corresponding to combinations of
122 permissions. Examples&#58; <B>755</B> corresponds to
123 <B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
124 </DL>
125 <P><B>The D Instruction for Creating a Directory</B>
126 <A NAME="IDX4056"></A>
127 <A NAME="IDX4057"></A>
128 <A NAME="IDX4058"></A>
129 <A NAME="IDX4059"></A>
130 <A NAME="IDX4060"></A>
131 <A NAME="IDX4061"></A>
132 <A NAME="IDX4062"></A>
133 <P>The <B>D</B> instruction in a <B>package</B> configuration file
134 creates a directory on the local disk. If a symbolic link, file, or
135 other element on the local disk has the same name, it is replaced with a
136 directory. If the directory already exists, its owner, group, and mode
137 bits are changed if necessary to conform with the instruction. The
138 instruction has the following syntax&#58;
139 <PRE>   <B>D</B>[<VAR>update_code</VAR>]  <VAR>directory</VAR>  <VAR>owner</VAR>  <VAR>group</VAR>  <VAR>mode_bits</VAR>
140    
141 </PRE>
142 <P>where
143 <DL>
144 <P><DT><B>D
145 </B><DD>Indicates the creation of a directory. It must be a capital
146 letter.
147 <P><DT><B><VAR>update_code</VAR>
148 </B><DD>Modulates the directory creation instruction. It is optional and
149 follows the letter <B>D</B> directly, without an intervening space.
150 Choose one of the two acceptable values&#58; 
151 <DL>
152 <P><DT><B>X
153 </B><DD>Indicates that the directory is a <B>lost+found</B> directory (used by
154 the <B>fsck</B> program).
155 <P><DT><B>R
156 </B><DD>Removes any subdirectory (along its contents) or file that exists in the
157 existing directory on the local disk but for which an instruction does not
158 appear in the configuration file.
159 </DL>
160 <P><DT><B><VAR>directory</VAR>
161 </B><DD>Specifies the full pathname of the directory to create.
162 <P><DT><B><VAR>owner</VAR>
163 </B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
164 the directory&#39;s owner in the output from the UNIX <B>ls -ld</B>
165 command.
166 <P><DT><B><VAR>group</VAR>
167 </B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
168 the directory&#39;s group in the output from the UNIX <B>ls -lgd</B>
169 command.
170 <P><DT><B><VAR>mode_bits</VAR>
171 </B><DD>Defines the directory&#39;s UNIX mode bits. Acceptable values are
172 the standard three- or four-digit numbers corresponding to combinations of
173 permissions. Examples&#58; <B>755</B> corresponds to
174 <B>drwxr-xr-x</B>, and <B>644</B> to <B>drw-r--r--</B>.
175 </DL>
176 <P><B>The F Instruction for Creating or Updating a File</B>
177 <A NAME="IDX4063"></A>
178 <A NAME="IDX4064"></A>
179 <A NAME="IDX4065"></A>
180 <A NAME="IDX4066"></A>
181 <A NAME="IDX4067"></A>
182 <A NAME="IDX4068"></A>
183 <A NAME="IDX4069"></A>
184 <P>The <B>F</B> instruction in a <B>package</B> configuration file
185 creates or updates a file on the local disk by copying in the contents of the
186 indicated source file, which can reside in AFS or on the local disk. If
187 the <B>package</B> command interpreter cannot access the source file, it
188 exits without executing any instruction in the configuration file.
189 <P>If a file with the same name already exists on disk, the <B>package</B>
190 command overwrites it with the contents of the source file, unless the
191 <B>I</B> update code is used to prevent that. To add a
192 <B>.old</B> extension to the current version of the file, include
193 the <B>O</B> update code. To have the machine reboot automatically
194 after the <B>package</B> program completes, include the <B>Q</B>
195 update code.
196 <P>If a symbolic link, directory, or other element on the local disk has the
197 same name, it is replaced with the file (a directory&#39;s contents are first
198 removed as necessary).
199 <P>The instruction has the following syntax&#58;
200 <PRE>   <B>F</B>[<VAR>update_code</VAR>]  <VAR>file</VAR>  <VAR>source_file</VAR>  [<VAR>owner  group  mode_bits</VAR>]
201    
202 </PRE>
203 <P>where
204 <DL>
205 <P><DT><B>F
206 </B><DD>Indicates the creation or update of a file. It must be a capital
207 letter.
208 <P><DT><B><VAR>update_code</VAR>
209 </B><DD>Modulates the file creation instruction. It is optional and follows
210 the letter <B>F</B> directly, without an intervening space. Choose
211 one or more of the four acceptable values, and list them in any order&#58; 
212 <DL>
213 <P><DT><B>A
214 </B><DD>Indicates that the pathname in the <VAR>source_file</VAR> field is the
215 complete pathname of the source file, including the filename. If this
216 argument is omitted, the <B>package</B> command appends the pathname in
217 the <VAR> file</VAR> field to the pathname in the <VAR>source_file</VAR> field to
218 derive the source file&#39;s full name. This code allows the source
219 and target filenames to differ.
220 <P><DT><B>I
221 </B><DD>Preserves the existing file called <VAR>file</VAR>, rather than overwriting
222 it.
223 <P><DT><B>O
224 </B><DD>Saves the existing version of the file by appending a
225 <B>.old</B> extension to it.
226 <P><DT><B>Q
227 </B><DD>Causes the <B>package</B> command to exit with status code
228 <B>4</B> if it overwrites the file. If the standard
229 <B>package</B>-related changes have been made to the machine&#39;s AFS
230 initialization file, then status code <B>4</B> causes the machine to
231 reboot automatically. Use this code when the machine must reboot if
232 updates to the file are to have any effect (for example, if the operating
233 system file--<B>/vmunix</B> or equivalent--has changed).
234 </DL>
235 <P><DT><B><VAR>file</VAR>
236 </B><DD>Specifies the complete pathname on the local disk of the file to create or
237 update, including the filename as the final element.
238 <P><DT><B><VAR>source_file</VAR>
239 </B><DD>Specifies the pathname (local or AFS) of the file to copy to the local
240 disk.
241 <P>If the <B>A</B> update code is included, specify the source file&#39;s
242 complete pathname. Otherwise, the <B>package</B> command derives
243 the source file&#39;s full name by appending the <VAR>file</VAR> pathname to
244 this pathname. For example, if the <B>A</B> update code is not
245 included and the file <B>/afs/abc.com/rs_aix42/bin/grep</B> is the
246 source file for the <B>/bin/grep</B> binary, the proper value in this
247 field is <B>/afs/abc.com/rs_aix42</B>.
248 <P><DT><B><VAR>owner</VAR>
249 </B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
250 the file&#39;s owner in the output from the UNIX <B>ls -l</B>
251 command. 
252 <P>To copy the source file&#39;s owner to the target file, leave this field
253 empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR> fields
254 must also be empty.
255 <P><DT><B><VAR>group</VAR>
256 </B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
257 the file&#39;s group in the output from the UNIX <B>ls -lg</B>
258 command. 
259 <P>To copy the source file&#39;s group to the target file, leave this field
260 empty. In this case, the <VAR> owner</VAR> and <VAR>mode_bits</VAR> fields
261 must also be empty.
262 <P><DT><B><VAR>mode_bits</VAR>
263 </B><DD>Defines the file&#39;s UNIX mode bits. Acceptable values are the
264 standard three- or four-digit numbers corresponding to combinations of
265 permissions. Examples&#58; <B>755</B> corresponds to
266 <B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>. 
267 <P>To copy the source file&#39;s mode bits to the target file, leave this
268 field empty. In this case, the <VAR>owner</VAR> and <VAR>group</VAR> fields
269 must also be empty.
270 </DL>
271 <P><B>The L Instruction for Creating a Symbolic Link</B>
272 <A NAME="IDX4070"></A>
273 <A NAME="IDX4071"></A>
274 <A NAME="IDX4072"></A>
275 <A NAME="IDX4073"></A>
276 <A NAME="IDX4074"></A>
277 <A NAME="IDX4075"></A>
278 <A NAME="IDX4076"></A>
279 <P>The <B>L</B> instruction in a <B>package</B> configuration file
280 creates a symbolic link on the local disk to a directory or file that exists
281 either in AFS or elsewhere on the local disk. As with the standard UNIX
282 <B>ln -s</B> command, the link is created even if the actual file or
283 directory does not exist.
284 <P>If a file or directory on the local disk already has the same name, the
285 <B>package</B> command replaces it with a symbolic link.
286 <P>The instruction has the following syntax&#58;
287 <PRE>   <B>L</B>[<VAR>update_code</VAR>]  <VAR>link</VAR>  <VAR>actual_path</VAR>  [<VAR>owner  group  mode_bits</VAR>]
288     
289 </PRE>
290 <P>where
291 <DL>
292 <P><DT><B>L
293 </B><DD>Indicates the creation of a symbolic link. It must be a capital
294 letter.
295 <P><DT><B><VAR>update_code</VAR>
296 </B><DD>Modulates the link creation instruction. It is optional and follows
297 the letter <B>L</B> directly, without an intervening space. Choose
298 one or both of the acceptable values, and list them in any order&#58; 
299 <DL>
300 <P><DT><B>A
301 </B><DD>Indicates that the pathname in the <VAR>actual_path</VAR> field is the
302 complete pathname of the actual directory or file (including the filename for
303 a file). If this argument is omitted, the <B>package</B> command
304 appends the value in the <VAR>link</VAR> field to the pathname in the
305 <VAR>actual_path</VAR> field to derive the actual directory or file&#39;s full
306 name. This code allows the name of the symbolic link and actual
307 directory or file to differ.
308 <P><DT><B>I
309 </B><DD>Preserves the existing symbolic link called <VAR>link</VAR>, rather than
310 overwriting it.
311 </DL>
312 <P><DT><B><VAR>link</VAR>
313 </B><DD>Specifies the complete local disk pathname of the symbolic link to
314 create.
315 <P><DT><B><VAR>actual_path</VAR>
316 </B><DD>Specifies the pathname (local or AFS) of the directory or file to which
317 the link refers. If the <B>A</B> update code is included, specify
318 the directory or file&#39;s complete pathname. Otherwise, the
319 <B>package</B> command derives the actual directory or file&#39;s full
320 name by appending the value in the <VAR>link</VAR> field to this
321 pathname. For example, if the <B>A</B> update code is not included
322 and <B>/etc/ftpd</B> is a symbolic link to the file
323 <B>/afs/abc.com/sun4x_56/etc/ftpd</B>, the proper value in this
324 field is <B>/afs/abc.com/sun4x_56</B>.
325 <P>The <B>package</B> command interpreter correctly handles pathnames that
326 begin with the <B>./</B> (period, slash) or
327 <B>../</B> (two periods, slash) notation, interpreting them
328 relative to the current working directory from which the <B>package</B>
329 command is invoked.
330 <P><DT><B><VAR>owner</VAR>
331 </B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
332 the symbolic link&#39;s owner in the output from the UNIX <B>ls -l</B>
333 command.
334 <P>To designate the issuer of the <B>package</B> command (usually, the
335 local superuser <B>root</B>) as the symbolic link&#39;s owner, leave this
336 field empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR>
337 fields must also be empty.
338 <P><DT><B><VAR>group</VAR>
339 </B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
340 the link&#39;s group in the output from the UNIX <B>ls -lg</B>
341 command.
342 <P>To have the symbolic link&#39;s group match the default group associated
343 with the <B>package</B> command&#39;s issuer, leave this field
344 empty. The issuer is usually the local superuser <B>root</B> and
345 the default group is designated in the issuer&#39;s entry in the local
346 <B>/etc/passwd</B> file or equivalent. If this field is left empty,
347 the <VAR>owner</VAR> and <VAR>mode_bits</VAR> fields must also be empty.
348 <P><DT><B><VAR>mode_bits</VAR>
349 </B><DD>Defines the symbolic link&#39;s UNIX mode bits. Acceptable values
350 are the standard three- or four-digit numbers corresponding to combinations of
351 permissions. Examples&#58; <B>755</B> corresponds to
352 <B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
353 <P>Leaving this field empty sets the symbolic link&#39;s mode bits to
354 <B>777</B> (<B>rwxrwxrwx</B>). In this case, the <VAR>owner</VAR>
355 and <VAR>group</VAR> fields must also be empty.
356 </DL>
357 <P><B>The S Instruction for Creating a Socket</B>
358 <A NAME="IDX4077"></A>
359 <A NAME="IDX4078"></A>
360 <A NAME="IDX4079"></A>
361 <A NAME="IDX4080"></A>
362 <A NAME="IDX4081"></A>
363 <A NAME="IDX4082"></A>
364 <A NAME="IDX4083"></A>
365 <P>The <B>S</B> instruction in a <B>package</B> configuration file
366 creates a socket (a communications device for UDP or TCP/IP connections) on
367 the local disk. The instruction has the following syntax&#58;
368 <PRE>   <B>S</B>  <VAR>socket</VAR> [<VAR>owner  group  mode_bits</VAR>]
369    
370 </PRE>
371 <P>where
372 <DL>
373 <P><DT><B>S
374 </B><DD>Indicates the creation of a socket. It must be a capital
375 letter.
376 <P><DT><B><VAR>socket</VAR>
377 </B><DD>Names the socket. The proper format depends on the local
378 machine&#39;s operating system.
379 <P><DT><B><VAR>owner</VAR>
380 </B><DD>Specifies the username or UNIX user ID (UID) of the user to be designated
381 the socket&#39;s owner in the output from the UNIX <B>ls -l</B>
382 command.
383 <P>To designate the issuer of the <B>package</B> command (usually, the
384 local superuser <B>root</B>) as the socket&#39;s owner, leave this field
385 empty. In this case, the <VAR>group</VAR> and <VAR>mode_bits</VAR> fields
386 must also be empty.
387 <P><DT><B><VAR>group</VAR>
388 </B><DD>Specifies the name or UNIX group ID (GID) of the group to be designated
389 the socket&#39;s group in the output from the UNIX <B>ls -lg</B>
390 command.
391 <P>To have the symbolic link&#39;s group match the default group associated
392 with the <B>package</B> command&#39;s issuer, leave this field
393 empty. The issuer is usually the local superuser <B>root</B> and
394 the default group is designated in the issuer&#39;s entry in the local
395 <B>/etc/passwd</B> file or equivalent. If this field is left empty,
396 the <VAR>owner</VAR> and <VAR>mode_bits</VAR> fields must also be empty.
397 <P><DT><B><VAR>mode_bits</VAR>
398 </B><DD>Defines the socket&#39;s UNIX mode bits. Acceptable values are the
399 standard three- or four-digit numbers corresponding to combinations of
400 permissions. Examples&#58; <B>755</B> corresponds to
401 <B>rwxr-xr-x</B>, and <B>644</B> to <B>rw-r--r--</B>.
402 <P>Leaving this field empty sets the symbolic link&#39;s mode bits to
403 <B>777</B> (<B>rwxrwxrwx</B>), modulated by the cell&#39;s
404 umask. In this case, the <VAR>owner</VAR> and <VAR>group</VAR> fields must
405 also be empty.
406 </DL>
407 <P><B>The %define or %undef Instructions Declaring or Undeclaring a
408 Definition</B>
409 <A NAME="IDX4084"></A>
410 <A NAME="IDX4085"></A>
411 <A NAME="IDX4086"></A>
412 <A NAME="IDX4087"></A>
413 <A NAME="IDX4088"></A>
414 <A NAME="IDX4089"></A>
415 <P>The <B>%define</B> instruction in a <B>package</B> configuration
416 file declares or defines a variable, depending on its number of
417 arguments&#58;
418 <UL>
419 <P><LI>If followed by a single argument, it declares that argument to be
420 defined. The argument is then available as a controller when mentioned
421 in <B>%ifdef</B> and <B>%ifndef</B> statements, which evaluate to
422 <B>true</B> and <B>false</B> respectively.
423 <P><LI>If followed by two arguments, it defines the second argument as the value
424 of the first. When the first argument appears later in this prototype
425 or other prototype or library files as a variable--surrounded by curly
426 braces and preceded by a dollar sign, as in the example
427 <TT>${variable}</TT>--the <B>package</B> command interpreter
428 substitutes the second argument for it.
429 </UL>
430 <P>The <B>%undef</B> statement negates the effect of a previous
431 <B>%define</B> statement, declaring its argument to be defined no longer,
432 or to have a value no longer if it is a variable.
433 <P>The syntax for the two types of instruction are as follows&#58;
434 <PRE>   %define  <VAR>declaration</VAR>
435    %define  <VAR>variable</VAR>  <VAR>value</VAR>
436    %undef  <VAR>declaration</VAR>
437    %undef  <VAR>variable</VAR>
438    
439 </PRE>
440 <P>where
441 <DL>
442 <P><DT><B>%define
443 </B><DD>Indicates a definition statement.
444 <P><DT><B>%undef
445 </B><DD>Indicates a statement that negates a definition.
446 <P><DT><B><VAR>declaration</VAR>
447 </B><DD>Names the string being declared by a <B>%define</B> statement, or
448 negated by an <B>%undef</B> statement.
449 <P><DT><B><VAR>variable</VAR>
450 </B><DD>Specifies the name of the variable that a <B>%define</B> statement is
451 defining, or an <B>%undef</B> statement is negating.
452 <P><DT><B><VAR>value</VAR>
453 </B><DD>Specifies the value to substitute for the string in the <VAR>variable</VAR>
454 field when it appears in the appropriate format (surrounded by curly braces
455 and preceded by a dollar sign, as in the example <TT>${variable}</TT>), in
456 this or other prototype and library files. It can include one or more
457 words.
458 </DL>
459 <P><B>The %ifdef and %ifndef Instructions for Specifying a Conditional
460 Action to Perform</B>
461 <A NAME="IDX4090"></A>
462 <A NAME="IDX4091"></A>
463 <A NAME="IDX4092"></A>
464 <A NAME="IDX4093"></A>
465 <A NAME="IDX4094"></A>
466 <A NAME="IDX4095"></A>
467 <P>The <B>%ifdef</B> instruction in a <B>package</B> configuration
468 file specifies one or more actions to perform if the indicated string has been
469 declared by a single-argument <B>%define</B> statement, or is a variable
470 for which a value has been defined by a two-argument <B>%define</B>
471 statement.
472 <P>Similarly, the <B>%ifndef</B> instruction specifies one or more actions
473 to perform if the indicated string has not been declared or is a variable
474 without a value, either because no <B>%define</B> statement has defined it
475 or an <B>%undef</B> statement has undefined it.
476 <P>In both cases, the optional <B>%else</B> statement specifies one or
477 more alternate actions to perform if the first statement evaluates to
478 <B>false</B>. (For an <B>%ifdef</B> statement, the
479 <B>%else</B> statement is executed if the indicated string has never been
480 declared or is a variable without a value, or if an <B>%undef</B>
481 statement has undefined either one; for an <B>%ifndef</B> statement,
482 it is executed if the string has been declared or is a variable with a
483 value.)
484 <P>It is possible to nest any number of <B>%ifdef</B> and
485 <B>%ifndef</B> statements.
486 <P>The two types of statement share a common syntax&#58;
487 <PRE>   %ifdef | ifndef   <VAR>declaration</VAR> 
488                                   <VAR>action</VAR><SUP>+</SUP>
489    [%else [<VAR>declaration</VAR>] 
490                   <VAR>alternate_action</VAR><SUP>+</SUP>]
491    %endif <VAR>declaration</VAR>
492    
493 </PRE>
494 <P>where
495 <DL>
496 <P><DT><B>ifdef
497 </B><DD>Indicates that the statement evaluates as <B>true</B> if the string in
498 the <VAR>declaration</VAR> field is declared or is a variable with a defined
499 value.
500 <P><DT><B>ifndef
501 </B><DD>Indicates that the statement evaluates as <B>true</B> if the string in
502 the <VAR>declaration</VAR> field is not declared or is a variable without a
503 defined value.
504 <P><DT><B><VAR>declaration</VAR>
505 </B><DD>Specifies the string that must be declared or the variable name that must
506 have a defined value for an <B>%ifdef</B> statement to evaluate as
507 <B>true</B>, which results in the specified action being performed.
508 For an <B>%ifndef</B> statement, the string must not be declared or the
509 variable must have no defined value for the statement to evaluate as
510 <B>true</B>. The first and third occurrences of
511 <VAR>declaration</VAR> (the latter following the string <B>%endif</B>) are
512 required. The second occurrence (following the string <B>%else</B>)
513 is optional, serving only to clarify to which <B>%ifdef</B> or
514 <B>%ifndef</B> statement the <B>%else</B> statement belongs.
515 <P><DT><B><VAR>action</VAR>
516 </B><DD>Specifies each action to perform if the <B>%ifdef</B> or
517 <B>%ifndef</B> statement evaluates as <B>true</B>. Each action
518 must appear on a separate line. Acceptable types of actions are other
519 statements beginning with a percent sign and definition instructions.
520 <P><DT><B><VAR>alternate_action</VAR>
521 </B><DD>Specifies each action to perform if the <B>%ifdef</B> or
522 <B>%ifndef</B> statement evaluates to <B>false</B>. Each action
523 must appear on a separate line. Acceptable types of actions are other
524 statements beginning with a percent sign and definition instructions.
525 </DL>
526 <P><B>The %include Instruction for Including a Library File</B>
527 <A NAME="IDX4096"></A>
528 <A NAME="IDX4097"></A>
529 <A NAME="IDX4098"></A>
530 <P>The <B>%include</B> instruction in a <B>package</B> configuration
531 file includes the contents of the indicated library file in a configuration
532 file that results from the compilation of the prototype file in which the
533 <B>%include</B> instruction appears. It has the following
534 syntax&#58;
535 <PRE>   %include  <VAR>pathname</VAR>
536    
537 </PRE>
538 <P>where
539 <DL>
540 <P><DT><B>%include
541 </B><DD>Indicates a library file include statement.
542 <P><DT><B><VAR>pathname</VAR>
543 </B><DD>Specifies the complete pathname of the library file to include. It
544 can be in AFS or on the local disk, and can include one or more
545 variables.
546 </DL>
547 <P><STRONG>Cautions</STRONG>
548 <P>The configuration file must be completely correct. If there are any
549 syntax errors or incorrect values, the <B>package</B> command interpreter
550 exits without executing any instruction.
551 <P><STRONG>Examples</STRONG>
552 <P>The following example <B>B</B> and <B>C</B> instructions define a
553 disk <B>/dev/hd0a</B> with major and minor device numbers <B>1</B> and
554 <B>0</B> and mode bits of <B>-rw-r--r--</B>, and a tty
555 <B>/dev/ttyp5</B> with major and minor device numbers <B>6</B> and
556 <B>5</B> and mode bits of <B>-rw-rw-rw</B>. In both cases, the
557 owner is <B>root</B> and the owning group <B>wheel</B>.
558 <PRE>   B /dev/hd0a 1 0 root wheel 644
559    C /dev/ttyp5 6 5 root wheel 666
560    
561 </PRE>
562 <P>The following example <B>D</B> instruction creates the local
563 <B>/usr</B> directory with owner <B>root</B> and group
564 <B>wheel</B> and mode bits of <B>drwxr-xr-x</B>. The
565 <B>R</B> update code removes any files and subdirectories that reside in
566 the <B>/usr</B> directory (if it already exists) but do not appear in the
567 configuration file.
568 <PRE>   DR /usr root wheel 755
569    
570 </PRE>
571 <P>The following example <B>F</B> instruction, appropriate for a machine
572 running AIX 4.2 in the ABC Corporation cell, creates or updates the
573 local disk file <B>/bin/grep</B>, using
574 <B>/afs/abc.com/rs_aix42/bin/grep</B> as the source.
575 <PRE>   F /bin/grep /afs/abc.com/rs_aix42 root wheel 755
576    
577 </PRE>
578 <P>The next example <B>F</B> instruction creates the
579 <B>/usr/vice/etc/ThisCell</B> file and specifies an absolute pathname for
580 the source file, as indicated by the <B>A</B> update code. The
581 <B>Q</B> code makes the <B>package</B> command return status code 4 as
582 it exits, prompting a reboot of the machine if the standard
583 <B>package</B>-related changes have been made to the machine&#39;s AFS
584 initialization file. No values are provided for the owner, group and
585 mode bits, so the file inherits them from the source file.
586 <PRE>   FAQ /usr/vice/etc/ThisCell /afs/abc.com/common/etc/ThisCell
587    
588 </PRE>
589 <P>The following example <B>L</B> instruction, appropriate for a machine
590 running AIX 4.2 in the ABC Corporation cell, creates a symbolic link
591 from <B>/etc/ftpd</B> on the local disk to the file
592 <B>/afs/abc.com/rs_aix42/etc/ftpd</B>.
593 <PRE>   L /etc/ftpd /afs/abc.com/rs_aix42 root wheel 644
594    
595 </PRE>
596 <P>The following example <B>S</B> instruction defines the socket
597 <B>/dev/printer</B>.
598 <PRE> 
599    S /dev/printer root wheel 777
600    
601 </PRE>
602 <P>The following example <B>%define</B> instruction defines the value for
603 the variable <TT>${diskmode}</TT>. This variable is used elsewhere in
604 the template to fill the <VAR>owner_name</VAR>, <VAR>group_name</VAR>, and
605 <VAR>mode_bits</VAR> fields in a <B>D</B>, <B>F</B>, or <B>L</B>
606 instruction.
607 <PRE>   %define diskmode root wheel 644
608     
609 </PRE>
610 <P>The following example <B>%undef</B> instruction declares the string
611 <B>afsd</B> not to be defined.
612 <PRE>   %undef afsd
613    
614 </PRE>
615 <P>The following example <B>%ifdef</B> instruction specifies that if the
616 string <TT>rs_aix42</TT> is currently declared, then when the prototype file
617 containing the instruction is compiled the three indicated library files are
618 included. There is no alternate action defined. There must be
619 <B>%define</B> statements earlier in the prototype file to declare
620 <B>rs_aix42</B> and to assign a value to the <TT>${wsadmin}</TT>
621 variable.
622 <PRE>   %ifdef rs_aix42
623    %include ${wsadmin}/lib/rs_aix42.readonly
624    %include ${wsadmin}/lib/rs_aix42.generic
625    %include ${wsadmin}/lib/rs_aix42.generic.dev
626    %endif rs_aix42
627    
628 </PRE>
629 <P>The following example <B>%ifndef</B> instruction, appropriate for the
630 State University cell, defines <TT>stateu.edu</TT> as the value of
631 the <TT>${cell}</TT> variable if it does not already have a value.
632 <PRE>   %ifndef cell
633    %define cell stateu.edu
634    %endif cell
635    
636 </PRE>
637 <P>The following example <B>%include</B> instruction includes the library
638 file <B>base.generic</B> from the <B>lib</B> subdirectory of
639 the directory in which <B>package</B>-related files reside. The
640 <TT>${wsadmin}</TT> variable resolves to an actual pathname (such as
641 <B>/afs/abc.com/wsadmin</B>) during compilation.
642 <PRE>   %include ${wsadmin}/lib/base.generic
643    
644 </PRE>
645 <P><STRONG>Related Information</STRONG>
646 <P><A HREF="auarf204.htm#HDRPACKAGE">package</A>
647 <P>
648 <HR><P ALIGN="center"> <A HREF="../index.htm"><IMG SRC="../books.gif" BORDER="0" ALT="[Return to Library]"></A> <A HREF="auarf002.htm#ToC"><IMG SRC="../toc.gif" BORDER="0" ALT="[Contents]"></A> <A HREF="auarf052.htm"><IMG SRC="../prev.gif" BORDER="0" ALT="[Previous Topic]"></A> <A HREF="#Top_Of_Page"><IMG SRC="../top.gif" BORDER="0" ALT="[Top of Topic]"></A> <A HREF="auarf054.htm"><IMG SRC="../next.gif" BORDER="0" ALT="[Next Topic]"></A> <A HREF="auarf284.htm#HDRINDEX"><IMG SRC="../index.gif" BORDER="0" ALT="[Index]"></A> <P> 
649 <!-- Begin Footer Records  ========================================== -->
650 <P><HR><B> 
651 <br>&#169; <A HREF="http://www.ibm.com/">IBM Corporation 2000.</A>  All Rights Reserved 
652 </B> 
653 <!-- End Footer Records  ============================================ -->
654 <A NAME="Bot_Of_Page"></A>
655 </BODY></HTML>