| | 1 | {{{ |
| | 2 | #!html |
| | 3 | <H2>NAME</H2> |
| | 4 | |
| | 5 | mkencap - Encap package creation tool |
| | 6 | <A NAME="lbAC"> </A> |
| | 7 | <H2>SYNOPSIS</H2> |
| | 8 | |
| | 9 | <B>mkencap [options] -b [-DUPCBIT] \ |
| | 10 | <BR> |
| | 11 | |
| | 12 | <BR> [-m m4_cmd] [-M m4_outfile] \ |
| | 13 | <BR> |
| | 14 | |
| | 15 | <BR> [-d download_dir] [-F environment_file] \ |
| | 16 | <BR> |
| | 17 | |
| | 18 | <BR> [-O build_tree] [-S src_tree] profile |
| | 19 | <P> |
| | 20 | mkencap [options] \ |
| | 21 | <BR> |
| | 22 | |
| | 23 | <BR> [ -e [-n] [-a "encapinfo_directive ..."] ] \ |
| | 24 | <BR> |
| | 25 | |
| | 26 | <BR> [ -c [-o outfile] ] pkgspec</B> |
| | 27 | <A NAME="lbAD"> </A> |
| | 28 | <H2>VERSION</H2> |
| | 29 | |
| | 30 | This man page documents version 2.3 of <B>mkencap</B>. |
| | 31 | <A NAME="lbAE"> </A> |
| | 32 | <H2>DESCRIPTION</H2> |
| | 33 | |
| | 34 | <B>mkencap</B> is a tool to help create <I>Encap</I> 2.1 packages. It can |
| | 35 | create package directories, generate <I>encapinfo</I> files, and create |
| | 36 | package archives. |
| | 37 | <A NAME="lbAF"> </A> |
| | 38 | <H2>MODES</H2> |
| | 39 | |
| | 40 | Any combination of these modes may be specified when <B>mkencap</B> is |
| | 41 | invoked. Directory initialization is done first, if selected. Then, |
| | 42 | if the <I>encapinfo</I> file is needed, it is created. Finally, a tar |
| | 43 | archive is created if desired. |
| | 44 | <DL COMPACT> |
| | 45 | <DT><B>-b</B> |
| | 46 | |
| | 47 | <DD> |
| | 48 | Build the package from a profile. If the <I>-b</I> option is specified, |
| | 49 | <I>package</I> should be the path to the file containing the package's |
| | 50 | profile. (See <B>PACKAGE PROFILE OPTIONS</B> below for other related |
| | 51 | options.) |
| | 52 | <DT><B>-e</B> |
| | 53 | |
| | 54 | <DD> |
| | 55 | Create an <I>encapinfo</I> file in the package directory. |
| | 56 | (See <B>ENCAPINFO OPTIONS</B> below for other related options.) |
| | 57 | <DT><B>-c</B> |
| | 58 | |
| | 59 | <DD> |
| | 60 | Create archive. <B>mkencap</B> will create a (optionally compressed) |
| | 61 | tar archive of <I>package</I>. (See <B>ARCHIVE CREATION OPTIONS</B> |
| | 62 | below for other related options.) |
| | 63 | </DL> |
| | 64 | <P> |
| | 65 | |
| | 66 | If none of these options are selected, <B>mkencap</B> will create an |
| | 67 | <I>encapinfo</I> file and a tar archive. |
| | 68 | <A NAME="lbAG"> </A> |
| | 69 | <H2>GENERAL OPTIONS</H2> |
| | 70 | |
| | 71 | These options may be used in combination with any other options: |
| | 72 | <DL COMPACT> |
| | 73 | <DT><B>-E encap_format</B> |
| | 74 | |
| | 75 | <DD> |
| | 76 | Specify the Encap package format version of the new package. The |
| | 77 | default is <I>2.1</I>. |
| | 78 | <DT><B>-p platform</B> |
| | 79 | |
| | 80 | <DD> |
| | 81 | Set the package's Encap platform name to <I>platform</I>. If this option |
| | 82 | is not specified, the platform name is set to that of the host that |
| | 83 | <B>mkencap</B> is running on. |
| | 84 | <DT><B>-A platform_suffix</B> |
| | 85 | |
| | 86 | <DD> |
| | 87 | Appends <I>platform_suffix</I> to the package's Encap platform name. |
| | 88 | <DT><B>-f</B> |
| | 89 | |
| | 90 | <DD> |
| | 91 | Force <B>mkencap</B> to overwrite an existing <I>encapinfo</I> file. |
| | 92 | <DT><B>-q</B> |
| | 93 | |
| | 94 | <DD> |
| | 95 | Quiet mode. Only error messages are output to stdout. |
| | 96 | <DT><B>-s source_dir</B> |
| | 97 | |
| | 98 | <DD> |
| | 99 | Tells <B>mkencap</B> to use <I>source_dir</I> as the <I>Encap</I> source |
| | 100 | directory. If the source is not specified but the target is, |
| | 101 | <B>mkencap</B> will assume the relative path from the target to the |
| | 102 | source is <I>encap/</I>. If neither is specified, <B>mkencap</B> will check the |
| | 103 | contents of the ENCAP_SOURCE environment variable. If that is |
| | 104 | not set, it will use the default set at compile-time (usually |
| | 105 | <I>/usr/local/encap</I>). |
| | 106 | <DT><B>-t target_dir</B> |
| | 107 | |
| | 108 | <DD> |
| | 109 | Tells <B>mkencap</B> to use <I>target_dir</I> as the <I>Encap</I> target |
| | 110 | directory. If the target is not specified but the source is, |
| | 111 | <B>mkencap</B> will assume the relative path from the source to the |
| | 112 | target is <I>../</I>. If neither is specified, <B>mkencap</B> will check the |
| | 113 | contents of the <B>ENCAP_TARGET</B> environment variable. If that is |
| | 114 | not set, it will use the default set at compile-time (usually |
| | 115 | <I>/usr/local</I>). |
| | 116 | <DT><B>-v</B> |
| | 117 | |
| | 118 | <DD> |
| | 119 | Increase verbosity. This option can be specified multiple times. |
| | 120 | <DT><B>-V</B> |
| | 121 | |
| | 122 | <DD> |
| | 123 | Print <B>mkencap</B> version and compile-time defaults. |
| | 124 | </DL> |
| | 125 | <A NAME="lbAH"> </A> |
| | 126 | <H2>PACKAGE PROFILE OPTIONS</H2> |
| | 127 | |
| | 128 | These options are only meaningful when processing package profiles (see |
| | 129 | <I>-b</I> option above): |
| | 130 | <DL COMPACT> |
| | 131 | <DT><B>-D</B> |
| | 132 | |
| | 133 | <DD> |
| | 134 | Download source distribution if not already present. The downloaded |
| | 135 | file is placed in the common source tree. |
| | 136 | <DT><B>-U</B> |
| | 137 | |
| | 138 | <DD> |
| | 139 | Unpack source distribution. |
| | 140 | <DT><B>-P</B> |
| | 141 | |
| | 142 | <DD> |
| | 143 | Apply any necessary patches to source distribution. |
| | 144 | <DT><B>-C</B> |
| | 145 | |
| | 146 | <DD> |
| | 147 | Configure source distribution. |
| | 148 | <DT><B>-B</B> |
| | 149 | |
| | 150 | <DD> |
| | 151 | Build source distribution. |
| | 152 | <DT><B>-I</B> |
| | 153 | |
| | 154 | <DD> |
| | 155 | Install source distribution to create an Encap package. |
| | 156 | (This usually needs to be done as <I>root</I>.) |
| | 157 | <DT><B>-T</B> |
| | 158 | |
| | 159 | <DD> |
| | 160 | Tidy source distribution. |
| | 161 | </DL> |
| | 162 | <P> |
| | 163 | |
| | 164 | If none of the <I>-DUPCBIT</I> options are selected, the default |
| | 165 | is <I>-DUPCB</I>. |
| | 166 | <DL COMPACT> |
| | 167 | <DT><B>-m m4_cmd</B> |
| | 168 | |
| | 169 | <DD> |
| | 170 | Use the command <I>m4_cmd</I> to preprocess the package profile. |
| | 171 | If the <I>-m</I> option is not specified, <B>mkencap</B> will check the |
| | 172 | <I>MKENCAP_M4_COMMAND</I> environment variable. If that variable is |
| | 173 | unset, <B>mkencap</B> will use the string "m4", which means that it will |
| | 174 | use the first <B>m4</B> binary available in the <I>PATH</I>. |
| | 175 | <P> |
| | 176 | <B>Note:</B> |
| | 177 | |
| | 178 | The preprocessing command must point to GNU <B>m4</B>. If the |
| | 179 | first <B>m4</B> binary in your <I>PATH</I> is not GNU <B>m4</B>, you must |
| | 180 | use either the <I>MKENCAP_M4_COMMAND</I> environment variable or the |
| | 181 | <I>-m</I> option to specify the path to GNU <B>m4</B>. |
| | 182 | <P> |
| | 183 | This option can be used to simply override which <B>m4</B> binary is |
| | 184 | used, as in: |
| | 185 | <P> |
| | 186 | <BR> mkencap -m /usr/local/bin/m4 -b pkgspec.ep |
| | 187 | <P> |
| | 188 | However, it can also be used to add options to be passed to the <B>m4</B> |
| | 189 | command, as in: |
| | 190 | <P> |
| | 191 | <BR> mkencap -m "m4 -Dmacro=value" -b pkgspec.ep |
| | 192 | <DT><B>-d download_dir</B> |
| | 193 | |
| | 194 | <DD> |
| | 195 | Tells <B>mkencap</B> where to put source files as they are downloaded. |
| | 196 | If the <I>-d</I> option is not specified, <B>mkencap</B> will check the |
| | 197 | <I>MKENCAP_DOWNLOAD_DIR</I> environment variable. If that variable is |
| | 198 | unset, <B>mkencap</B> will use the default set at compile-time (usually |
| | 199 | <I>/usr/local/src</I>). |
| | 200 | <DT><B>-F environment_file</B> |
| | 201 | |
| | 202 | <DD> |
| | 203 | Tells <B>mkencap</B> to read environment variable settings from |
| | 204 | <I>environment_file</I>. If the <I>-F</I> option is not specified, |
| | 205 | <B>mkencap</B> will use the default set at compile-time (usually |
| | 206 | <I>/usr/local/etc/mkencap_environment</I>). |
| | 207 | <DT><B>-S src_tree</B> |
| | 208 | |
| | 209 | <DD> |
| | 210 | Tells <B>mkencap</B> where the common source tree is located. For |
| | 211 | packages that can be built in a seperate directory from where the source |
| | 212 | code is located, the source code will be stored in the common source |
| | 213 | tree. If the <I>-S</I> option is not specified, <B>mkencap</B> will check |
| | 214 | the <I>MKENCAP_SRC_TREE</I> environment variable. If that variable is |
| | 215 | unset, <B>mkencap</B> will store the source code in the build tree. |
| | 216 | <DT><B>-O build_tree</B> |
| | 217 | |
| | 218 | <DD> |
| | 219 | Tells <B>mkencap</B> where the build tree is located. The build tree is |
| | 220 | used for building packages from source code. If the <I>-O</I> option is |
| | 221 | not specified, <B>mkencap</B> will check the <I>MKENCAP_BUILD_TREE</I> |
| | 222 | environment variable. If that variable is unset, <B>mkencap</B> will |
| | 223 | use the default set at compile-time (usually <I>/usr/local/src</I>). |
| | 224 | <P> |
| | 225 | If the build tree path contains the string "%p", it will be replaced |
| | 226 | with the platform name. |
| | 227 | <DT><B>-M m4_outfile</B> |
| | 228 | |
| | 229 | <DD> |
| | 230 | Tells <B>mkencap</B> to write the output of <B>m4</B> to the file |
| | 231 | <I>m4_outfile</I>. If <I>m4_outfile</I> is "-", the output will be |
| | 232 | written to <I>stdout</I>. |
| | 233 | <P> |
| | 234 | This option is useful for debugging problems caused by <B>m4</B> |
| | 235 | preprocessing. |
| | 236 | </DL> |
| | 237 | <A NAME="lbAI"> </A> |
| | 238 | <H2>ENCAPINFO OPTIONS</H2> |
| | 239 | |
| | 240 | These options are only meaningful when creating an <I>encapinfo</I> file |
| | 241 | (see <I>-e</I> option above): |
| | 242 | <DL COMPACT> |
| | 243 | <DT><B>-n</B> |
| | 244 | |
| | 245 | <DD> |
| | 246 | Do not add default <I>contact</I>, <I>date</I>, and <I>platform</I> fields to |
| | 247 | the <I>encapinfo</I> file. |
| | 248 | <P> |
| | 249 | When adding the <I>contact</I> field, <B>mkencap</B> will first check the |
| | 250 | environment variable <I>ENCAP_CONTACT</I>. If unset, it will use the |
| | 251 | username of the invoking user and the hostname of the host it was run on. |
| | 252 | <DT><B>-a encapinfo_directive ...</B> |
| | 253 | |
| | 254 | <DD> |
| | 255 | Adds the specified directive to the <I>encapinfo</I> file. Syntax checking |
| | 256 | is done to ensure that the line is parsable. |
| | 257 | </DL> |
| | 258 | <A NAME="lbAJ"> </A> |
| | 259 | <H2>ARCHIVE CREATION OPTIONS</H2> |
| | 260 | |
| | 261 | This option is only meaningful when creating an archive file (see |
| | 262 | <I>-c</I> option above): |
| | 263 | <DL COMPACT> |
| | 264 | <DT><B>-o outfile</B> |
| | 265 | |
| | 266 | <DD> |
| | 267 | Specify the output filename when creating an archive. If the filename ends |
| | 268 | in <I>.tgz</I> or <I>.gz</I>, it is compressed using <B><A HREF="http://www.gzip.org/">gzip</A></B>(1). If the |
| | 269 | filename ends in <I>.Z</I>, it is compressed using <B><A HREF="http://en.wikipedia.org/wiki/Compress">compress</A></B>(1). If |
| | 270 | the filename ends in <I>.bz2</I>, it is compressed using <B><A HREF="http://www.bzip.org/">bzip2</A></B>(1). |
| | 271 | <P> |
| | 272 | For Encap 2.0 packages, the default is <I>pkgspec.tar.gz</I>. |
| | 273 | <P> |
| | 274 | For Encap 2.1 packages, the default is |
| | 275 | <I>pkgspec-encap-platform.tar.gz</I>. The <I>platform</I> string will be |
| | 276 | read from the <I>encapinfo</I> file. |
| | 277 | </DL> |
| | 278 | <A NAME="lbAK"> </A> |
| | 279 | <H2>EXAMPLES</H2> |
| | 280 | |
| | 281 | To create an <I>encapinfo</I> file for the package "pkg-2.1" with the |
| | 282 | directives "linkname bin/foo quux" and "linkname man/man1/foo.1 quux.1": |
| | 283 | <P> |
| | 284 | <DL COMPACT><DT><DD> |
| | 285 | mkencap -ea "linkname bin/foo quux" \ |
| | 286 | <BR> |
| | 287 | |
| | 288 | <BR> -a "linkname man/man1/foo.1 quux.1" pkg-2.1 |
| | 289 | </DL> |
| | 290 | |
| | 291 | <P> |
| | 292 | To create an <I>encapinfo</I> file for the package "pkg-3.0" containing |
| | 293 | the directives "exclude bin/burfle" and "linkdir lib/pkg", and create |
| | 294 | an archive of the package in your home directory: |
| | 295 | <P> |
| | 296 | <DL COMPACT><DT><DD> |
| | 297 | mkencap -a "exclude bin/burfle" -a "linkname lib/pkg" \ |
| | 298 | <BR> |
| | 299 | |
| | 300 | <BR> -o ~/pkg-3.0-encap-share.tgz pkg-3.0 |
| | 301 | </DL> |
| | 302 | |
| | 303 | <A NAME="lbAL"> </A> |
| | 304 | <H2>ENVIRONMENT VARIABLES</H2> |
| | 305 | |
| | 306 | <B>ENCAP_SOURCE</B> |
| | 307 | |
| | 308 | <BR> |
| | 309 | |
| | 310 | <B>ENCAP_TARGET</B> |
| | 311 | |
| | 312 | <BR> |
| | 313 | |
| | 314 | <B>ENCAP_CONTACT</B> |
| | 315 | |
| | 316 | <BR> |
| | 317 | |
| | 318 | <B>MKENCAP_DOWNLOAD_DIR</B> |
| | 319 | |
| | 320 | <BR> |
| | 321 | |
| | 322 | <B>MKENCAP_SRC_TREE</B> |
| | 323 | |
| | 324 | <BR> |
| | 325 | |
| | 326 | <B>MKENCAP_BUILD_TREE</B> |
| | 327 | |
| | 328 | <BR> |
| | 329 | |
| | 330 | <B>MKENCAP_M4_COMMAND</B> |
| | 331 | |
| | 332 | <A NAME="lbAM"> </A> |
| | 333 | <H2>FILES</H2> |
| | 334 | |
| | 335 | <I>/usr/local/encap/pkgname/encapinfo</I> |
| | 336 | |
| | 337 | <BR> |
| | 338 | |
| | 339 | <I>/usr/local/etc/mkencap_environment</I> |
| | 340 | |
| | 341 | <A NAME="lbAN"> </A> |
| | 342 | <H2>SEE ALSO</H2> |
| | 343 | |
| | 344 | <B><A HREF="/projects/bcfg2/wiki/EncapManEpkg">epkg</A></B>(1), |
| | 345 | |
| | 346 | <B><A HREF="/projects/bcfg2/wiki/EncapManEncapProfile">encap_profile</A></B>(5) |
| | 347 | |
| | 348 | <BR> |
| | 349 | |
| | 350 | The Encap Archive (<I><A HREF="http://www.encap.org/">http://www.encap.org/</A></I>) |
| | 351 | <A NAME="lbAO"> </A> |
| | 352 | <H2>AUTHOR</H2> |
| | 353 | |
| | 354 | Mark D. Roth <<A HREF="mailto:roth@feep.net">roth@feep.net</A>> |
| | 355 | </BODY> |
| | 356 | }}} |