| | 1 | {{{ |
| | 2 | #!html |
| | 3 | <H2>NAME</H2> |
| | 4 | |
| | 5 | encap_profile - Encap package creation information |
| | 6 | <A NAME="lbAC"> </A> |
| | 7 | <H2>VERSION</H2> |
| | 8 | |
| | 9 | This man page documents version 1.0 of the Encap profile format. |
| | 10 | <A NAME="lbAD"> </A> |
| | 11 | <H2>DESCRIPTION</H2> |
| | 12 | |
| | 13 | Encap profiles contain all the information needed to build an Encap |
| | 14 | package. The profile is an XML document. |
| | 15 | <A NAME="lbAE"> </A> |
| | 16 | <H3>THE BASICS OF XML</H3> |
| | 17 | |
| | 18 | As with any XML document, the first line of the profile must be: |
| | 19 | <P> |
| | 20 | <DL COMPACT><DT><DD> |
| | 21 | <?xml version="1.0"?> |
| | 22 | </DL> |
| | 23 | |
| | 24 | <P> |
| | 25 | An XML element with content looks like this: |
| | 26 | <P> |
| | 27 | <DL COMPACT><DT><DD> |
| | 28 | <PRE> |
| | 29 | <element attribute="value" ...> |
| | 30 | content |
| | 31 | </element> |
| | 32 | </PRE> |
| | 33 | |
| | 34 | </DL> |
| | 35 | |
| | 36 | <P> |
| | 37 | An empty element looks like this: |
| | 38 | <P> |
| | 39 | <DL COMPACT><DT><DD> |
| | 40 | <element attribute="value" ... /> |
| | 41 | </DL> |
| | 42 | |
| | 43 | <P> |
| | 44 | Element names are case-sensitive. |
| | 45 | <P> |
| | 46 | The "<" and ">" characters need to be replaced with predefined entity |
| | 47 | tags "&lt;" and "&gt;" when they're not part of an element tag, just |
| | 48 | like in HTML. However, for whole blocks of text that may contain |
| | 49 | these special characters, you can enclose them like this: |
| | 50 | <P> |
| | 51 | <DL COMPACT><DT><DD> |
| | 52 | <PRE> |
| | 53 | <![CDATA[ |
| | 54 | echo foo > output |
| | 55 | ]]> |
| | 56 | </PRE> |
| | 57 | |
| | 58 | </DL> |
| | 59 | |
| | 60 | <P> |
| | 61 | If for some reason you need to include the "]]>" string within a CDATA |
| | 62 | section, you can replace the ">" with its entity tag, just like you'd |
| | 63 | do outside of a CDATA section (i.e., "]]&gt;"). |
| | 64 | <P> |
| | 65 | The XML comment delimiters are "<!--" and "-->". |
| | 66 | <A NAME="lbAF"> </A> |
| | 67 | <H3>PROFILE STRUCTURE</H3> |
| | 68 | |
| | 69 | Here's a high-level summary of the hierarchical relationship of the |
| | 70 | elements described below: |
| | 71 | <P> |
| | 72 | <DL COMPACT><DT><DD> |
| | 73 | <PRE> |
| | 74 | <encap_profile> |
| | 75 | <notes> |
| | 76 | <ChangeLog> |
| | 77 | <change> |
| | 78 | <prereq> |
| | 79 | <environment> |
| | 80 | <prepare> |
| | 81 | <source> |
| | 82 | <unpack> |
| | 83 | <patch> |
| | 84 | <configure> |
| | 85 | <build> |
| | 86 | <install> |
| | 87 | <clean> |
| | 88 | <prepackage> |
| | 89 | <include_file> |
| | 90 | <encapinfo> |
| | 91 | </PRE> |
| | 92 | |
| | 93 | </DL> |
| | 94 | |
| | 95 | <A NAME="lbAG"> </A> |
| | 96 | <H3>The <encap_profile> Element</H3> |
| | 97 | |
| | 98 | The <I><encap_profile></I> element is the root XML element of the package |
| | 99 | profile. All other elements must be contained within the |
| | 100 | <I><encap_profile></I> element. |
| | 101 | <P> |
| | 102 | The <I><encap_profile></I> element supports the following attributes: |
| | 103 | <DL COMPACT> |
| | 104 | <DT><I>profile_ver</I> |
| | 105 | |
| | 106 | <DD> |
| | 107 | Indicates what version of the Encap Profile format is being used. |
| | 108 | This attribute is mandatory and must have the value "1.0". |
| | 109 | <DT><I>pkgspec</I> |
| | 110 | |
| | 111 | <DD> |
| | 112 | Sets the full name of the package to be created. This attribute is |
| | 113 | mandatory. |
| | 114 | </DL> |
| | 115 | <P> |
| | 116 | |
| | 117 | Example: |
| | 118 | <P> |
| | 119 | <DL COMPACT><DT><DD> |
| | 120 | <PRE> |
| | 121 | <encap_profile profile_ver="1.0" pkgspec="foo-1.0+1"> |
| | 122 | ... |
| | 123 | </encap_profile> |
| | 124 | </PRE> |
| | 125 | |
| | 126 | </DL> |
| | 127 | |
| | 128 | <A NAME="lbAH"> </A> |
| | 129 | <H3>The <notes> Element</H3> |
| | 130 | |
| | 131 | This optional element may contain arbitrary text. It is intended to |
| | 132 | store README-style notes. |
| | 133 | <P> |
| | 134 | Example: |
| | 135 | <P> |
| | 136 | <DL COMPACT><DT><DD> |
| | 137 | <PRE> |
| | 138 | <notes> |
| | 139 | These are human-readable notes about a profile. |
| | 140 | </notes> |
| | 141 | </PRE> |
| | 142 | |
| | 143 | </DL> |
| | 144 | |
| | 145 | <A NAME="lbAI"> </A> |
| | 146 | <H3>The <ChangeLog> and <change> Elements</H3> |
| | 147 | |
| | 148 | The <I><ChangeLog></I> element is composed of one or more <I><change></I> |
| | 149 | elements that document changes to the profile. The <I><ChangeLog></I> |
| | 150 | element itself supports no attributes. |
| | 151 | <P> |
| | 152 | The <I><change></I> element supports the following attributes: |
| | 153 | <DL COMPACT> |
| | 154 | <DT><I>date</I> |
| | 155 | |
| | 156 | <DD> |
| | 157 | Optional. Indicates the date of the ChangeLog entry. |
| | 158 | <DT><I>version</I> |
| | 159 | |
| | 160 | <DD> |
| | 161 | Required. Indicates the version of the package to which the ChangeLog |
| | 162 | entry applies. |
| | 163 | </DL> |
| | 164 | <P> |
| | 165 | |
| | 166 | Example: |
| | 167 | <P> |
| | 168 | <DL COMPACT><DT><DD> |
| | 169 | <PRE> |
| | 170 | <ChangeLog> |
| | 171 | <change version="1.0+1"> |
| | 172 | Fixed a bug in the postinstall script from version 1.0. |
| | 173 | </change> |
| | 174 | <change version="1.0"> |
| | 175 | Initial release. |
| | 176 | </change> |
| | 177 | </ChangeLog> |
| | 178 | </PRE> |
| | 179 | |
| | 180 | </DL> |
| | 181 | |
| | 182 | <A NAME="lbAJ"> </A> |
| | 183 | <H3>The <prereq> Element</H3> |
| | 184 | |
| | 185 | The <I><prereq></I> element specifies a build-time prerequisite package. |
| | 186 | It may be specified zero or more times, but must be empty. It supports |
| | 187 | the following attributes: |
| | 188 | <DL COMPACT> |
| | 189 | <DT><I>package</I> |
| | 190 | |
| | 191 | <DD> |
| | 192 | Required. Specifies the pkgspec of the required package. |
| | 193 | <DT><I>use_bin</I> |
| | 194 | |
| | 195 | <DD> |
| | 196 | Optional. If set to "yes", prepends <I>package</I>'s <I>bin</I> subdirectory |
| | 197 | to the <B>PATH</B> environment variable. |
| | 198 | <DT><I>use_lib</I> |
| | 199 | |
| | 200 | <DD> |
| | 201 | Optional. If set to "yes", adds <I>package</I>'s <I>include</I> and |
| | 202 | <I>lib</I> subdirectories to the <B>CPPFLAGS</B> and <B>LDFLAGS</B> |
| | 203 | environment variables. |
| | 204 | </DL> |
| | 205 | <P> |
| | 206 | |
| | 207 | Example: |
| | 208 | <P> |
| | 209 | <DL COMPACT><DT><DD> |
| | 210 | <prereq package="bar-2.5.1" /> |
| | 211 | </DL> |
| | 212 | |
| | 213 | <A NAME="lbAK"> </A> |
| | 214 | <H3>The <environment> Element</H3> |
| | 215 | |
| | 216 | Specifies an environment setting. It may be specified zero or more |
| | 217 | times, but must be empty. It supports the following attributes: |
| | 218 | <DL COMPACT> |
| | 219 | <DT><I>variable</I> |
| | 220 | |
| | 221 | <DD> |
| | 222 | Required. The name of the environment variable. |
| | 223 | <DT><I>value</I> |
| | 224 | |
| | 225 | <DD> |
| | 226 | Optional. The new value for the variable. |
| | 227 | <DT><I>type<TT> </TT></I> |
| | 228 | |
| | 229 | <DD> |
| | 230 | Optional. Specifies how the value should be interpretted. If set<BR> |
| | 231 | to "prepend", the value is prepended to the existing value. If set to |
| | 232 | "append", the content is appended to the existing value. If set to "set", |
| | 233 | the value completely replaces the existing value. If set to "unset", |
| | 234 | the variable is unset. The default is "set". |
| | 235 | </DL> |
| | 236 | <P> |
| | 237 | |
| | 238 | Example: |
| | 239 | <P> |
| | 240 | <DL COMPACT><DT><DD> |
| | 241 | <PRE> |
| | 242 | <environment |
| | 243 | variable="PATH" |
| | 244 | value=":/usr/local/bin" |
| | 245 | type="append" |
| | 246 | /> |
| | 247 | </PRE> |
| | 248 | |
| | 249 | </DL> |
| | 250 | |
| | 251 | <P> |
| | 252 | See the <B>ENVIRONMENT VARIABLES</B> section below for more information |
| | 253 | on how environment variables are set and used. |
| | 254 | <A NAME="lbAL"> </A> |
| | 255 | <H3>The <prepare> Element</H3> |
| | 256 | |
| | 257 | The <I><prepare></I> element specifies a set of commands to be executed |
| | 258 | before any <I><source></I> elements are processed. It supports the |
| | 259 | following attributes: |
| | 260 | <DL COMPACT> |
| | 261 | <DT><I>type</I> |
| | 262 | |
| | 263 | <DD> |
| | 264 | Optional. Specifies how the contents should be interpretted. If set to |
| | 265 | "prepend", the content is executed before the existing prepare action. |
| | 266 | If set to "append", the content is executed after the existing prepare |
| | 267 | action. If set to "set", the contents are executed instead of the existing |
| | 268 | prepare action. If set to "unset", the prepare action is unset. |
| | 269 | The default is "set". |
| | 270 | </DL> |
| | 271 | <P> |
| | 272 | |
| | 273 | The prepare action is executed in whatever directory <B>mkencap</B> |
| | 274 | was invoked in. By default, no prepare commands are executed. |
| | 275 | <P> |
| | 276 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 277 | <I><prepare></I> commands are executed. |
| | 278 | <A NAME="lbAM"> </A> |
| | 279 | <H3>The <source> Element</H3> |
| | 280 | |
| | 281 | Specifies a source (which in this context means "anything you need to |
| | 282 | download to build the package"). It may be specified multiple times, |
| | 283 | but must be specified at least once. It supports the following |
| | 284 | attributes: |
| | 285 | <DL COMPACT> |
| | 286 | <DT><I>url</I> |
| | 287 | |
| | 288 | <DD> |
| | 289 | Required. A whitespace-delimited list of one or more URLs where the |
| | 290 | source can be downloaded. |
| | 291 | <P> |
| | 292 | Note that the basename of each URL in the list must be the same. No |
| | 293 | checking is done to ensure that they do not differ, but the results are |
| | 294 | undefined if they are not identical. |
| | 295 | <DT><I>subdir</I> |
| | 296 | |
| | 297 | <DD> |
| | 298 | Optional. The name of the subdirectory into which the source files will |
| | 299 | be unpacked (if different from the name of the source archive). |
| | 300 | <DT><I>create_subdir </I> |
| | 301 | |
| | 302 | <DD> |
| | 303 | If set to "yes", the subdirectory specified by the "subdir" attribute |
| | 304 | is created and cd'd to before running the unpack action (see below). |
| | 305 | The default is "no". |
| | 306 | <DT><I>build_subdir</I> |
| | 307 | |
| | 308 | <DD> |
| | 309 | Optional. If set, it denotes a relative path from the source directory |
| | 310 | where the configure, build, install, and clean actions are invoked. |
| | 311 | <DT><I>use_objdir</I> |
| | 312 | |
| | 313 | <DD> |
| | 314 | Set to "yes" or "no" to indicate whether software can be built in |
| | 315 | an objdir. Defaults to "yes". |
| | 316 | </DL> |
| | 317 | <P> |
| | 318 | |
| | 319 | The <source> element contains zero or more of the following elements, |
| | 320 | which are described below: |
| | 321 | <DL COMPACT> |
| | 322 | <DT>*<DD> |
| | 323 | <I><unpack></I> |
| | 324 | |
| | 325 | <DT>*<DD> |
| | 326 | <I><patch></I> |
| | 327 | |
| | 328 | <DT>*<DD> |
| | 329 | <I><configure></I> |
| | 330 | |
| | 331 | <DT>*<DD> |
| | 332 | <I><build></I> |
| | 333 | |
| | 334 | <DT>*<DD> |
| | 335 | <I><install></I> |
| | 336 | |
| | 337 | <DT>*<DD> |
| | 338 | <I><clean></I> |
| | 339 | |
| | 340 | </DL> |
| | 341 | <P> |
| | 342 | |
| | 343 | Example: |
| | 344 | <P> |
| | 345 | <DL COMPACT><DT><DD> |
| | 346 | <PRE> |
| | 347 | <source |
| | 348 | url="<A HREF="ftp://ftp.isc.org/isc/bind-8.3.3/bind-src.tar.gz">ftp://ftp.isc.org/isc/bind-8.3.3/bind-src.tar.gz</A>" |
| | 349 | subdir="bind-8.3.3" |
| | 350 | use_objdir="no" |
| | 351 | /> |
| | 352 | </PRE> |
| | 353 | |
| | 354 | </DL> |
| | 355 | |
| | 356 | <A NAME="lbAN"> </A> |
| | 357 | <H3>The <unpack> Element</H3> |
| | 358 | |
| | 359 | Specifies a set of shell commands to use to unpack the source |
| | 360 | archives. The following attributes are supported: |
| | 361 | <DL COMPACT> |
| | 362 | <DT><I>type</I> |
| | 363 | |
| | 364 | <DD> |
| | 365 | Optional. Specifies how the contents should be interpretted. If set |
| | 366 | to "prepend", the content is executed before the existing unpack |
| | 367 | action. If set to "append", the content is executed after the existing |
| | 368 | unpack action. If set to "set", the contents are executed instead |
| | 369 | of the existing unpack action. If set to "unset", the unpack |
| | 370 | action is unset. The default is "set". |
| | 371 | </DL> |
| | 372 | <P> |
| | 373 | |
| | 374 | If the <I><source></I> element's "use_objdir" attribute is enabled and |
| | 375 | <B>mkencap</B>'s common source directory is set, the unpack action is |
| | 376 | executed in the common source directory. Otherwise, the unpack action |
| | 377 | is executed in a subdirectory of the build tree that is named after the |
| | 378 | pkgspec of the profile. |
| | 379 | <P> |
| | 380 | By default, <B>mkencap</B> will unpack the source archive directly without |
| | 381 | using any commands specified in the profile. If the <I><unpack></I> |
| | 382 | element is present, <B>mkencap</B> will execute the specified commands |
| | 383 | instead of unpacking the source archive directly. |
| | 384 | <P> |
| | 385 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 386 | <I><unpack></I> commands are executed. |
| | 387 | <A NAME="lbAO"> </A> |
| | 388 | <H3>The <patch> Element</H3> |
| | 389 | |
| | 390 | Specifies a patch to be applied to the source files before building |
| | 391 | the package. It may be specified zero or more times. It supports the |
| | 392 | following attributes: |
| | 393 | <DL COMPACT> |
| | 394 | <DT><I>url</I> |
| | 395 | |
| | 396 | <DD> |
| | 397 | Optional. A whitespace-delimited list of one or more URLs where the |
| | 398 | patch can be downloaded. |
| | 399 | <DT><I>options</I> |
| | 400 | |
| | 401 | <DD> |
| | 402 | Options to pass to the patch command. Defaults to "-p1". |
| | 403 | <DT><I>from_dir</I> |
| | 404 | |
| | 405 | <DD> |
| | 406 | Optional. Subdirectory in which to execute the patch command. |
| | 407 | </DL> |
| | 408 | <P> |
| | 409 | |
| | 410 | The content of the <I><patch></I> element is the text of the patch file. |
| | 411 | It should be left empty if the "url" attribute is specified. |
| | 412 | <P> |
| | 413 | Example: |
| | 414 | <P> |
| | 415 | <DL COMPACT><DT><DD> |
| | 416 | <PRE> |
| | 417 | <patch |
| | 418 | url="<A HREF="ftp://ftp.feep.net/pub/software/authsrv/openssh-3.4p1-tis-auth.diff">ftp://ftp.feep.net/pub/software/authsrv/openssh-3.4p1-tis-auth.diff</A>" |
| | 419 | /> |
| | 420 | </PRE> |
| | 421 | |
| | 422 | </DL> |
| | 423 | |
| | 424 | <A NAME="lbAP"> </A> |
| | 425 | <H3>The <configure> Element</H3> |
| | 426 | |
| | 427 | Specifies a set of shell commands to use to configure the source |
| | 428 | archives. The following attributes are supported: |
| | 429 | <DL COMPACT> |
| | 430 | <DT><I>type<TT> </TT></I> |
| | 431 | |
| | 432 | <DD> |
| | 433 | Optional. Specifies how the contents should be interpretted. If set<BR> |
| | 434 | to "prepend", the content is executed before the existing configuration |
| | 435 | action. If set to "append", the content is executed after the existing |
| | 436 | configuration action. If set to "set", the contents are executed instead |
| | 437 | of the existing configuration action. If set to "unset", the configure |
| | 438 | action is unset. The default is "set". |
| | 439 | </DL> |
| | 440 | <P> |
| | 441 | |
| | 442 | The configuration action is executed in the ${builddir} directory, which |
| | 443 | is created first if it doesn't exist. The default configuration action |
| | 444 | is: |
| | 445 | <P> |
| | 446 | <DL COMPACT><DT><DD> |
| | 447 | <PRE> |
| | 448 | ${srcdir}/configure \ |
| | 449 | --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \ |
| | 450 | --sysconfdir="${ENCAP_TARGET}/etc" |
| | 451 | </PRE> |
| | 452 | |
| | 453 | </DL> |
| | 454 | |
| | 455 | <P> |
| | 456 | Example: |
| | 457 | <P> |
| | 458 | <DL COMPACT><DT><DD> |
| | 459 | <PRE> |
| | 460 | <configure> |
| | 461 | xmkmf |
| | 462 | ${MAKE} includes |
| | 463 | </configure> |
| | 464 | </PRE> |
| | 465 | |
| | 466 | </DL> |
| | 467 | |
| | 468 | <P> |
| | 469 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 470 | <I><configure></I> commands are executed. |
| | 471 | <A NAME="lbAQ"> </A> |
| | 472 | <H3>The <build> Element</H3> |
| | 473 | |
| | 474 | Specifies a set of shell commands to use to build the source archives. |
| | 475 | The following attributes are supported: |
| | 476 | <DL COMPACT> |
| | 477 | <DT><I>type<TT> </TT></I> |
| | 478 | |
| | 479 | <DD> |
| | 480 | Optional. Specifies how the contents should be interpretted. If set<BR> |
| | 481 | to "prepend", the content is executed before the existing build action. |
| | 482 | If set to "append", the content is executed after the existing build |
| | 483 | action. If set to "set", the contents are executed instead of the |
| | 484 | existing build action. If set to "unset", the build action is unset. |
| | 485 | The default is "set". |
| | 486 | </DL> |
| | 487 | <P> |
| | 488 | |
| | 489 | The build action is executed in the ${builddir} directory. The default |
| | 490 | build action is: |
| | 491 | <P> |
| | 492 | <DL COMPACT><DT><DD> |
| | 493 | ${MAKE} |
| | 494 | </DL> |
| | 495 | |
| | 496 | <P> |
| | 497 | Example: |
| | 498 | <P> |
| | 499 | <DL COMPACT><DT><DD> |
| | 500 | <PRE> |
| | 501 | <build type="append"> |
| | 502 | ${MAKE} certificate TYPE=dummy |
| | 503 | </build> |
| | 504 | </PRE> |
| | 505 | |
| | 506 | </DL> |
| | 507 | |
| | 508 | <P> |
| | 509 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 510 | <I><build></I> commands are executed. |
| | 511 | <A NAME="lbAR"> </A> |
| | 512 | <H3>The <install> Element</H3> |
| | 513 | |
| | 514 | The <I><install></I> element specifies how the <I><source></I> instance that |
| | 515 | contains it should be installed. It supports the following attributes: |
| | 516 | <DL COMPACT> |
| | 517 | <DT><I>type</I> |
| | 518 | |
| | 519 | <DD> |
| | 520 | Optional. Specifies how the contents should be interpretted. If set to |
| | 521 | "prepend", the content is executed before the existing installation action. |
| | 522 | If set to "append", the content is executed after the existing installation |
| | 523 | action. If set to "set", the contents are executed instead of the existing |
| | 524 | installation action. If set to "unset", the install action is unset. |
| | 525 | The default is "set". |
| | 526 | </DL> |
| | 527 | <P> |
| | 528 | |
| | 529 | The installation action is executed in the ${builddir} directory. The |
| | 530 | default installation action is: |
| | 531 | <P> |
| | 532 | <DL COMPACT><DT><DD> |
| | 533 | <PRE> |
| | 534 | ${MAKE} install sysconfdir="${ENCAP_SOURCE}/${ENCAP_PKGNAME}/etc" |
| | 535 | </PRE> |
| | 536 | |
| | 537 | </DL> |
| | 538 | |
| | 539 | <P> |
| | 540 | Example: |
| | 541 | <P> |
| | 542 | <DL COMPACT><DT><DD> |
| | 543 | <PRE> |
| | 544 | <install type="append"> |
| | 545 | cp ssh_prng_cmds ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/ssh_prng_cmds |
| | 546 | cp moduli.out ${ENCAP_SOURCE}/${ENCAP_PKGNAME}/moduli |
| | 547 | </install> |
| | 548 | </PRE> |
| | 549 | |
| | 550 | </DL> |
| | 551 | |
| | 552 | <P> |
| | 553 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 554 | <I><install></I> commands are executed. |
| | 555 | <A NAME="lbAS"> </A> |
| | 556 | <H3>The <clean> Element</H3> |
| | 557 | |
| | 558 | The <I><clean></I> element specifies how the <I><source></I> instance that |
| | 559 | contains it should be cleaned up. It supports the following attributes: |
| | 560 | <DL COMPACT> |
| | 561 | <DT><I>type</I> |
| | 562 | |
| | 563 | <DD> |
| | 564 | Optional. Specifies how the contents should be interpretted. If set |
| | 565 | to "prepend", the content is executed before the existing clean action. |
| | 566 | If set to "append", the content is executed after the existing clean |
| | 567 | action. If set to "set", the contents are executed instead of the |
| | 568 | existing clean action. If set to "unset", the clean action is unset. |
| | 569 | The default is "set". |
| | 570 | </DL> |
| | 571 | <P> |
| | 572 | |
| | 573 | The clean action is executed in the ${builddir} directory. The |
| | 574 | default clean action is: |
| | 575 | <P> |
| | 576 | <DL COMPACT><DT><DD> |
| | 577 | ${MAKE} clean |
| | 578 | </DL> |
| | 579 | |
| | 580 | <P> |
| | 581 | Example: |
| | 582 | <P> |
| | 583 | <DL COMPACT><DT><DD> |
| | 584 | <clean type="unset" /> |
| | 585 | </DL> |
| | 586 | |
| | 587 | <P> |
| | 588 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 589 | <I><clean></I> commands are executed. |
| | 590 | <A NAME="lbAT"> </A> |
| | 591 | <H3>The <prepackage> Element</H3> |
| | 592 | |
| | 593 | The <I><prepackage></I> element specifies a set of commands to be executed |
| | 594 | after every <I><source></I> element has been built and installed but befor the |
| | 595 | package has been created. It supports the following attributes: |
| | 596 | <DL COMPACT> |
| | 597 | <DT><I>type</I> |
| | 598 | |
| | 599 | <DD> |
| | 600 | Optional. Specifies how the contents should be interpretted. If set to |
| | 601 | "prepend", the content is executed before the existing prepackage action. |
| | 602 | If set to "append", the content is executed after the existing prepackage |
| | 603 | action. If set to "set", the contents are executed instead of the existing |
| | 604 | prepackage action. If set to "unset", the install action is unset. |
| | 605 | The default is "set". |
| | 606 | </DL> |
| | 607 | <P> |
| | 608 | |
| | 609 | The prepackage action is executed in the "${ENCAP_SOURCE}/${ENCAP_PKGNAME}" |
| | 610 | directory. The default prepackage action is: |
| | 611 | <P> |
| | 612 | <DL COMPACT><DT><DD> |
| | 613 | <PRE> |
| | 614 | find . -name lib -prune -o \ |
| | 615 | \( -perm -0100 -o -perm -0010 -o -perm -0001 \) \ |
| | 616 | -type f -print | xargs ${STRIP} |
| | 617 | </PRE> |
| | 618 | |
| | 619 | </DL> |
| | 620 | |
| | 621 | <P> |
| | 622 | Example: |
| | 623 | <P> |
| | 624 | <DL COMPACT><DT><DD> |
| | 625 | <prepackage type="unset" /> |
| | 626 | </DL> |
| | 627 | |
| | 628 | <P> |
| | 629 | See <B>COMMAND ELEMENTS</B> below for more information on how the |
| | 630 | <I><prepackage></I> commands are executed. |
| | 631 | <A NAME="lbAU"> </A> |
| | 632 | <H3>The <include_file> Element</H3> |
| | 633 | |
| | 634 | This element describes an additional file to add to the package. The |
| | 635 | following attributes are supported: |
| | 636 | <DL COMPACT> |
| | 637 | <DT><I>name</I> |
| | 638 | |
| | 639 | <DD> |
| | 640 | Required. The name of the file. This must be a path name relative to |
| | 641 | the package directory. |
| | 642 | <DT><I>owner</I> |
| | 643 | |
| | 644 | <DD> |
| | 645 | Optional. The owner of the installed file. |
| | 646 | <DT><I>group</I> |
| | 647 | |
| | 648 | <DD> |
| | 649 | Optional. The group of the installed file. |
| | 650 | <DT><I>mode</I> |
| | 651 | |
| | 652 | <DD> |
| | 653 | Optional. The mode of the installed file. The default is 0644. |
| | 654 | </DL> |
| | 655 | <P> |
| | 656 | |
| | 657 | The content of the <I><include_file></I> element is the content of the file |
| | 658 | to install. Note that a single leading newline will be stripped from |
| | 659 | the content to aid in readability. |
| | 660 | <P> |
| | 661 | Example: |
| | 662 | <P> |
| | 663 | <DL COMPACT><DT><DD> |
| | 664 | <PRE> |
| | 665 | <include_file name="bin/webconf.in" mode="0755"> |
| | 666 | (...contents of file...) |
| | 667 | </include_file> |
| | 668 | </PRE> |
| | 669 | |
| | 670 | </DL> |
| | 671 | |
| | 672 | <A NAME="lbAV"> </A> |
| | 673 | <H3>The <encapinfo> Element</H3> |
| | 674 | |
| | 675 | This element contains the content of the encapinfo file to be created |
| | 676 | for the new package. It supports no attributes. |
| | 677 | <P> |
| | 678 | Note that the following encapinfo fields should <B>not</B> be specified in an |
| | 679 | <I><encapinfo></I> element, since they will be determined dynamically by |
| | 680 | <B>mkencap</B>: |
| | 681 | <DL COMPACT> |
| | 682 | <DT>*<DD> |
| | 683 | <B>date</B> |
| | 684 | |
| | 685 | <DT>*<DD> |
| | 686 | <B>contact</B> |
| | 687 | |
| | 688 | <DT>*<DD> |
| | 689 | <B>platform</B> |
| | 690 | |
| | 691 | </DL> |
| | 692 | <P> |
| | 693 | |
| | 694 | Example: |
| | 695 | <P> |
| | 696 | <DL COMPACT><DT><DD> |
| | 697 | <PRE> |
| | 698 | <encapinfo> |
| | 699 | exclude sbin/webconf.in |
| | 700 | </encapinfo> |
| | 701 | </PRE> |
| | 702 | |
| | 703 | </DL> |
| | 704 | |
| | 705 | <A NAME="lbAW"> </A> |
| | 706 | <H2>COMMAND ELEMENTS</H2> |
| | 707 | |
| | 708 | For those elements that contain commands to be executed by <B>mkencap</B>, |
| | 709 | the commands are parsed and executed the same way that they would be in |
| | 710 | a Makefile. In particular, there are a few things to bear in mind. |
| | 711 | <P> |
| | 712 | First, each command is executed in its own subshell. This means that |
| | 713 | process-specific actions like setting environment variables or changing |
| | 714 | directories will not propogate from one command to another. For |
| | 715 | example, this element does not do what you might think: |
| | 716 | <P> |
| | 717 | <DL COMPACT><DT><DD> |
| | 718 | <PRE> |
| | 719 | <!-- this will NOT work --> |
| | 720 | <configure> |
| | 721 | cd src |
| | 722 | ./configure |
| | 723 | </configure> |
| | 724 | </PRE> |
| | 725 | |
| | 726 | </DL> |
| | 727 | |
| | 728 | <P> |
| | 729 | Instead, you need to use something like this: |
| | 730 | <P> |
| | 731 | <DL COMPACT><DT><DD> |
| | 732 | <PRE> |
| | 733 | <!-- this one will work --> |
| | 734 | <configure><![CDATA[ |
| | 735 | cd src && ./configure |
| | 736 | ]]></configure> |
| | 737 | </PRE> |
| | 738 | |
| | 739 | </DL> |
| | 740 | |
| | 741 | <P> |
| | 742 | Generally, each line is interpretted as a single command. If you need |
| | 743 | a single command to span multiple lines, you can use a backslash ("\") |
| | 744 | to escape newlines. For example: |
| | 745 | <P> |
| | 746 | <DL COMPACT><DT><DD> |
| | 747 | <PRE> |
| | 748 | <configure> |
| | 749 | ${srcdir}/configure \ |
| | 750 | --prefix="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" \ |
| | 751 | --sysconfdir="${ENCAP_TARGET}/etc" |
| | 752 | </configure> |
| | 753 | </PRE> |
| | 754 | |
| | 755 | </DL> |
| | 756 | |
| | 757 | <P> |
| | 758 | Finally, <B>mkencap</B> will check the exit code of each command as it is |
| | 759 | executed. If any command fails, the package creation process will abort |
| | 760 | immediately. For example: |
| | 761 | <P> |
| | 762 | <DL COMPACT><DT><DD> |
| | 763 | <PRE> |
| | 764 | <build> |
| | 765 | ${MAKE} |
| | 766 | ${MAKE} test |
| | 767 | </build> |
| | 768 | </PRE> |
| | 769 | |
| | 770 | </DL> |
| | 771 | |
| | 772 | <P> |
| | 773 | If the "${MAKE}" command fails, <B>mkencap</B> will terminate without |
| | 774 | executing "${MAKE} test". |
| | 775 | <A NAME="lbAX"> </A> |
| | 776 | <H2>PLATFORM CONDITIONALS</H2> |
| | 777 | |
| | 778 | In order to do conditional evaluation based on platform, the profile |
| | 779 | will be preprocessed with <B>m4</B>. The following special <B>m4</B> |
| | 780 | macros have been written for this purpose: |
| | 781 | <DL COMPACT> |
| | 782 | <DT>*<DD> |
| | 783 | <B>PLATFORM_IF_EQUAL(</B><I>string</I><B>)</B> |
| | 784 | |
| | 785 | <DT>*<DD> |
| | 786 | <B>PLATFORM_IF_MATCH(</B><I>regex</I><B>)</B> |
| | 787 | |
| | 788 | <DT>*<DD> |
| | 789 | <B>PLATFORM_ELSE_IF_EQUAL(</B><I>string</I><B>)</B> |
| | 790 | |
| | 791 | <DT>*<DD> |
| | 792 | <B>PLATFORM_ELSE_IF_MATCH(</B><I>regex</I><B>)</B> |
| | 793 | |
| | 794 | <DT>*<DD> |
| | 795 | <B>PLATFORM_ELSE</B> |
| | 796 | |
| | 797 | <DT>*<DD> |
| | 798 | <B>PLATFORM_ENDIF</B> |
| | 799 | |
| | 800 | </DL> |
| | 801 | <P> |
| | 802 | |
| | 803 | The <B>*_MATCH</B> macros check the platform name against a regular |
| | 804 | expression. The <B>*_EQUAL</B> macros check the platform name against |
| | 805 | a constant string. |
| | 806 | <P> |
| | 807 | Conditional blocks cannot be nested. For example, this is illegal: |
| | 808 | <P> |
| | 809 | <DL COMPACT><DT><DD> |
| | 810 | <PRE> |
| | 811 | <!-- This is illegal! --> |
| | 812 | PLATFORM_IF_EQUAL(rs6000-aix4.3.3) |
| | 813 | --with-rundir=/etc |
| | 814 | PLATFORM_ELSE |
| | 815 | PLATFORM_IF_MATCH(.*linux) |
| | 816 | --with-rundir=/var/state |
| | 817 | PLATFORM_ELSE |
| | 818 | --with-rundir=/var/run |
| | 819 | PLATFORM_ENDIF |
| | 820 | PLATFORM_ENDIF |
| | 821 | </PRE> |
| | 822 | |
| | 823 | </DL> |
| | 824 | |
| | 825 | <P> |
| | 826 | Instead, use a conditional block with multuple options: |
| | 827 | <P> |
| | 828 | <DL COMPACT><DT><DD> |
| | 829 | <PRE> |
| | 830 | <!-- This is the right way to do it. --> |
| | 831 | PLATFORM_IF_EQUAL(rs6000-aix4.3.3) |
| | 832 | --with-rundir=/etc |
| | 833 | PLATFORM_ELSE_IF_MATCH(.*linux) |
| | 834 | --with-rundir=/var/state |
| | 835 | PLATFORM_ELSE |
| | 836 | --with-rundir=/var/run |
| | 837 | PLATFORM_ENDIF |
| | 838 | </PRE> |
| | 839 | |
| | 840 | </DL> |
| | 841 | |
| | 842 | <P> |
| | 843 | Also, the normal <B>m4</B> quoting characters are "`" and "'". Since these are |
| | 844 | frequently used in shell scripts, <B>m4</B> will be configured to use the |
| | 845 | strings "<|" and "|>" as quote delimiters instead. You will not normally |
| | 846 | need to use these delimiters, but if you run into a situation where <B>m4</B> |
| | 847 | is expanding something that you do not want it to, you can quote the |
| | 848 | text that you do not want expanded. |
| | 849 | <A NAME="lbAY"> </A> |
| | 850 | <H3>ENVIRONMENT VARIABLES</H3> |
| | 851 | |
| | 852 | Because environment variable settings can affect the build process, |
| | 853 | <B>mkencap</B> will sanitize the environment in which the build commands |
| | 854 | are run. |
| | 855 | <P> |
| | 856 | First, <B>mkencap</B> will initialize the environment to the settings |
| | 857 | found in the <I>/usr/local/etc/mkencap_environment</I> file. Next, |
| | 858 | <B>mkencap</B> will process any <I><environment></I> elements found in the |
| | 859 | package profile. And finally, <B>mkencap</B> will set the following |
| | 860 | environment variables: |
| | 861 | <DL COMPACT> |
| | 862 | <DT><B>ENCAP_PKGNAME</B> |
| | 863 | |
| | 864 | <DD> |
| | 865 | The value of the <I>pkgspec</I> attribute of the <I><encap_profile></I> |
| | 866 | element. |
| | 867 | <DT><B>ENCAP_SOURCE</B> |
| | 868 | |
| | 869 | <DD> |
| | 870 | The Encap source directory. |
| | 871 | <DT><B>ENCAP_TARGET</B> |
| | 872 | |
| | 873 | <DD> |
| | 874 | The Encap target directory. |
| | 875 | <DT><B>MKENCAP_DOWNLOAD_DIR</B> |
| | 876 | |
| | 877 | <DD> |
| | 878 | The directory used by <B>mkencap</B> to store downloaded files. |
| | 879 | <DT><B>MKENCAP_SRC_TREE</B> |
| | 880 | |
| | 881 | <DD> |
| | 882 | The common source tree used by <B>mkencap</B>. |
| | 883 | <DT><B>MKENCAP_BUILD_TREE</B> |
| | 884 | |
| | 885 | <DD> |
| | 886 | The build tree used by <B>mkencap</B>. |
| | 887 | </DL> |
| | 888 | <P> |
| | 889 | |
| | 890 | In addition, the following variables will be set on a per-<I><source></I> |
| | 891 | basis: |
| | 892 | <DL COMPACT> |
| | 893 | <DT><B>srcdir</B> |
| | 894 | |
| | 895 | <DD> |
| | 896 | The full path to the unpacked sources, based on the <I>subdir</I> and |
| | 897 | <I>use_objdir</I> attributes for the <I><source></I> and the number of |
| | 898 | sources in the package. |
| | 899 | <DT><B>builddir</B> |
| | 900 | |
| | 901 | <DD> |
| | 902 | The full path to the build directory, based on the <I>subdir</I> attribute |
| | 903 | for the <I><source></I> and the number of sources in the package. |
| | 904 | </DL> |
| | 905 | <P> |
| | 906 | |
| | 907 | All of these environment variables are available for use in shell |
| | 908 | commands. |
| | 909 | <A NAME="lbAZ"> </A> |
| | 910 | <H2>SEE ALSO</H2> |
| | 911 | |
| | 912 | <B><A HREF="/projects/bcfg2/wiki/EncapManMkencap">mkencap</A></B>(1), |
| | 913 | |
| | 914 | <B><A HREF="http://www.gnu.org/software/m4/">m4</A></B>(1) |
| | 915 | </BODY> |
| | 916 | }}} |