Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
michael@428 | 1 | ## |
michael@428 | 2 | ## openpkg dev -- OpenPKG Package Development Tool |
michael@428 | 3 | ## Copyright (c) 2008-2012 OpenPKG GmbH <http://openpkg.com/> |
michael@428 | 4 | ## |
michael@428 | 5 | ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208. |
michael@428 | 6 | ## All rights reserved. Licenses which grant limited permission to use, |
michael@428 | 7 | ## copy, modify and distribute this software are available from the |
michael@428 | 8 | ## OpenPKG GmbH. |
michael@428 | 9 | ## |
michael@428 | 10 | ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED |
michael@428 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@428 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@428 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@428 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@428 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@428 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@428 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@428 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@428 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@428 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@428 | 21 | ## SUCH DAMAGE. |
michael@428 | 22 | ## |
michael@428 | 23 | |
michael@428 | 24 | =pod |
michael@428 | 25 | |
michael@428 | 26 | B<openpkg dev> - OpenPKG Package Development Tool |
michael@428 | 27 | |
michael@428 | 28 | =head1 DESCRIPTION |
michael@428 | 29 | |
michael@428 | 30 | B<openpkg dev> is a package development tool for B<OpenPKG>. |
michael@428 | 31 | |
michael@428 | 32 | =head2 SOURCE PACKAGE HANDLING |
michael@428 | 33 | |
michael@428 | 34 | =over 4 |
michael@428 | 35 | |
michael@428 | 36 | =item B<openpkg dev unpack> |
michael@428 | 37 | [C<-l> I<layout>] |
michael@428 | 38 | [C<-b> I<basedir>] |
michael@428 | 39 | [C<-s>] |
michael@428 | 40 | [C<-d>] |
michael@428 | 41 | I<name>C<->I<version>C<->I<release>C<.src.rpm> |
michael@428 | 42 | |
michael@428 | 43 | Unpacks an OpenPKG source RPM package |
michael@428 | 44 | I<name>C<->I<version>C<->I<release>C<.src.rpm> into I<basedir> |
michael@428 | 45 | (default is I<name>C<->I<version>C<->I<release>) |
michael@428 | 46 | using I<layout> (default is I<structured>). |
michael@428 | 47 | Additionally, |
michael@428 | 48 | I<file-rpmmacros> |
michael@428 | 49 | configuration file is generated where |
michael@428 | 50 | C<-s> enables shared mode and |
michael@428 | 51 | C<-d> enables debug mode, see I<file-rpmmacros>. |
michael@428 | 52 | |
michael@428 | 53 | =back |
michael@428 | 54 | |
michael@428 | 55 | =head2 SOURCE PACKAGE DEVELOPMENT |
michael@428 | 56 | |
michael@428 | 57 | =over 4 |
michael@428 | 58 | |
michael@428 | 59 | =item B<openpkg dev shell> |
michael@428 | 60 | |
michael@428 | 61 | This is a convenience command which enters an interactive B<GNU Bash> |
michael@428 | 62 | shell which provides the following work environment: |
michael@428 | 63 | |
michael@428 | 64 | =over 4 |
michael@428 | 65 | |
michael@428 | 66 | =item B<Environment Variables:> |
michael@428 | 67 | |
michael@428 | 68 | OPENPKG_PREFIX "<prefix>" |
michael@428 | 69 | PS1 "\\[\\e[31;1m\\]\\u\\[\\e[0m\\]@\\h:\\w [OPENPKG_PREFIX=$OPENPKG_PREFIX]\n\\\$ " |
michael@428 | 70 | T %{_tmppath} |
michael@428 | 71 | S %{_specdir} |
michael@428 | 72 | D %{_sourcedir} |
michael@428 | 73 | |
michael@428 | 74 | =item B<Command-Line Aliases:> |
michael@428 | 75 | |
michael@428 | 76 | openpkg "${OPENPKG_PREFIX}/bin/openpkg" |
michael@428 | 77 | opd "${OPENPKG_PREFIX}/bin/openpkg dev" |
michael@428 | 78 | |
michael@428 | 79 | =item B<Command-Line Keystrokes:> |
michael@428 | 80 | |
michael@428 | 81 | ESC+x "opd unpack\n" |
michael@428 | 82 | ESC+v "opd edit\n" |
michael@428 | 83 | ESC+t "opd build -s track\n" |
michael@428 | 84 | ESC+f "opd build -s fetch\n" |
michael@428 | 85 | ESC+b "opd build\n" |
michael@428 | 86 | ESC+1 "opd build -s prep\n" |
michael@428 | 87 | ESC+2 "opd build -s compile\n" |
michael@428 | 88 | ESC+3 "opd build -s install\n" |
michael@428 | 89 | ESC+4 "opd build -s binary\n" |
michael@428 | 90 | ESC+s "opd build -s source\n" |
michael@428 | 91 | ESC+p "opd peek\n" |
michael@428 | 92 | ESC+d "opd diff\n" |
michael@428 | 93 | ESC+i "opd install\n" |
michael@428 | 94 | ESC+e "opd erase\n" |
michael@428 | 95 | ESC+l "opd lint\n" |
michael@428 | 96 | ESC+r "opd release\n" |
michael@428 | 97 | |
michael@428 | 98 | =back |
michael@428 | 99 | |
michael@428 | 100 | If option C<-s> is passed to B<openpkg dev shell> and screen(1) is |
michael@428 | 101 | available in C<$PATH>, the interactive development shell is started up |
michael@428 | 102 | in a convenient virtual screen environment. |
michael@428 | 103 | |
michael@428 | 104 | =item B<openpkg dev edit> |
michael@428 | 105 | |
michael@428 | 106 | Load spec file into editor. |
michael@428 | 107 | |
michael@428 | 108 | =over 4 |
michael@428 | 109 | |
michael@428 | 110 | =item B<Environment Variables:> |
michael@428 | 111 | |
michael@428 | 112 | EDITOR "vi" |
michael@428 | 113 | |
michael@428 | 114 | =back |
michael@428 | 115 | |
michael@428 | 116 | =item B<openpkg dev build> |
michael@428 | 117 | [C<-s> I<step>] |
michael@428 | 118 | [C<-D> I<define>[=I<value>]] |
michael@428 | 119 | [C<-w> I<variant>] |
michael@428 | 120 | |
michael@428 | 121 | Builds package steps. Default I<step> is C<all>. Option C<-D> translated |
michael@428 | 122 | into "C<--define 'I<define> I<value>'>" while option C<-w> translated |
michael@428 | 123 | into "C<--with> I<variant>". The I<step> arguments translate into the |
michael@428 | 124 | following RPM options: |
michael@428 | 125 | |
michael@428 | 126 | track: -bt |
michael@428 | 127 | fetch: -bf |
michael@428 | 128 | prep: -bp |
michael@428 | 129 | compile: -bc --short-circuit |
michael@428 | 130 | install: -bi --short-circuit |
michael@428 | 131 | binary: -bb --short-circuit |
michael@428 | 132 | source: -bs |
michael@428 | 133 | all: -ba |
michael@428 | 134 | |
michael@428 | 135 | =item B<openpkg dev peek> |
michael@428 | 136 | |
michael@428 | 137 | Peeks file list from package and tags configuration and documentation files. |
michael@428 | 138 | |
michael@428 | 139 | =item B<openpkg dev diff> |
michael@428 | 140 | |
michael@428 | 141 | Shows modifications with the help of a possibly underlying Version |
michael@428 | 142 | Control System (VCS) like CVS, Subversion, Monotone, Git, Mercurial or |
michael@428 | 143 | (as a fallback ) OSSP svs. |
michael@428 | 144 | |
michael@428 | 145 | =item B<openpkg dev install> |
michael@428 | 146 | [C<-f>] |
michael@428 | 147 | [C<-o>] |
michael@428 | 148 | [C<-n>] |
michael@428 | 149 | [C<-s>] |
michael@428 | 150 | |
michael@428 | 151 | Installs package. |
michael@428 | 152 | Option |
michael@428 | 153 | C<-f> adds C<--force>, |
michael@428 | 154 | C<-n> adds C<--nodeps> and |
michael@428 | 155 | C<-o> adds C<--oldpackage> |
michael@428 | 156 | to the underlying C<rpm> call. |
michael@428 | 157 | Option C<-s> prefixes the command with sudo(1). |
michael@428 | 158 | |
michael@428 | 159 | =item B<openpkg dev erase> |
michael@428 | 160 | [C<-f>] |
michael@428 | 161 | [C<-o>] |
michael@428 | 162 | [C<-a>] |
michael@428 | 163 | [C<-s>] |
michael@428 | 164 | |
michael@428 | 165 | Erases package. |
michael@428 | 166 | Option |
michael@428 | 167 | C<-f> adds C<--force>, |
michael@428 | 168 | C<-n> adds C<--nodeps> and |
michael@428 | 169 | C<-a> adds C<--allmatches> |
michael@428 | 170 | to the underlying C<rpm> call. |
michael@428 | 171 | Option C<-s> prefixes the command with sudo(1). |
michael@428 | 172 | |
michael@428 | 173 | =item B<openpkg dev lint> |
michael@428 | 174 | [C<-v>] |
michael@428 | 175 | [C<-b>] |
michael@428 | 176 | |
michael@428 | 177 | Lints package sources C<*.spec>, C<fsl.*>, C<rc.*> and binary package files. |
michael@428 | 178 | Option C<-v> enables verboseness. |
michael@428 | 179 | Option C<-b> disables the linting of an existing binary package file. |
michael@428 | 180 | |
michael@428 | 181 | =item B<openpkg dev release> |
michael@428 | 182 | [C<-m> I<message>] |
michael@428 | 183 | [C<-n>] |
michael@428 | 184 | |
michael@428 | 185 | Releases package specification to the repository. Unlike previous |
michael@428 | 186 | incarnations of "openpkg dev" this one is not tied to any repository or |
michael@428 | 187 | structure. The default message is created using the difference between |
michael@428 | 188 | the previous and current version of the package specification. In order |
michael@428 | 189 | to grab the previous version, the working directory and three levels |
michael@428 | 190 | towards root are checked for signs of CVS, Subversion, Monotone, Git, |
michael@428 | 191 | Mercurial or SVS information, in that order. The appropriate command is |
michael@428 | 192 | then executed to retrieve the data and the VCS found is passed to the |
michael@428 | 193 | actual release command. |
michael@428 | 194 | |
michael@428 | 195 | Finally, the command specified by the environment variable |
michael@428 | 196 | C<OPENPKG_DEV_RELEASE> or, if omitted, specified by the rpm macro |
michael@428 | 197 | C<%{openpkg_dev_release}> is run and passed the following positional |
michael@428 | 198 | arguments: |
michael@428 | 199 | |
michael@428 | 200 | =over 4 |
michael@428 | 201 | |
michael@428 | 202 | openpkg-prefix |
michael@428 | 203 | spec-dir |
michael@428 | 204 | source-dir |
michael@428 | 205 | binary-rpm-file |
michael@428 | 206 | source-rpm-file |
michael@428 | 207 | package-name |
michael@428 | 208 | package-version |
michael@428 | 209 | package-release |
michael@428 | 210 | package-version-old |
michael@428 | 211 | package-release-old |
michael@428 | 212 | commit-message |
michael@428 | 213 | vcs |
michael@428 | 214 | |
michael@428 | 215 | =back |
michael@428 | 216 | |
michael@428 | 217 | For a dry run, set C<$OPENPKG_DEV_RELEASE> to "echo" or use option "C<-n>". |
michael@428 | 218 | |
michael@428 | 219 | =back |
michael@428 | 220 | |
michael@428 | 221 | =head1 UNPACKED SOURCE RPM PACKAGE FILESYSTEM LAYOUT |
michael@428 | 222 | |
michael@428 | 223 | When an OpenPKG source RPM package |
michael@428 | 224 | I<name>C<->I<version>C<->I<release>C<.src.rpm> is unpacked to the |
michael@428 | 225 | filesystem, the following distinct filesystem layouts are known: |
michael@428 | 226 | |
michael@428 | 227 | =over 4 |
michael@428 | 228 | |
michael@428 | 229 | =item B<global> |
michael@428 | 230 | |
michael@428 | 231 | =over 4 |
michael@428 | 232 | |
michael@428 | 233 | =item I<prefix>C</RPM/SRC/>I<name>C</.openpkg/rpmmacros> |
michael@428 | 234 | |
michael@428 | 235 | =item I<prefix>C</RPM/SRC/>I<name>C</>I<name>C<.spec> |
michael@428 | 236 | |
michael@428 | 237 | =item I<prefix>C</RPM/SRC/>I<name>C</>I<packaging-source-file> |
michael@428 | 238 | |
michael@428 | 239 | =item I<prefix>C</RPM/SRC/>I<name>C</>I<thirdparty-distribution-file> |
michael@428 | 240 | |
michael@428 | 241 | =item I<prefix>C</RPM/PKG/>I<binary-rpm-package-file> |
michael@428 | 242 | |
michael@428 | 243 | =item I<prefix>C</RPM/PKG/>I<source-rpm-package-file> |
michael@428 | 244 | |
michael@428 | 245 | =item I<prefix>C</RPM/TMP/>I<temporary-file> |
michael@428 | 246 | |
michael@428 | 247 | =back |
michael@428 | 248 | |
michael@428 | 249 | This is just the "simple" filesystem layout (see below) with the |
michael@428 | 250 | I<base-dir> set to I<prefix>C</RPM/SRC/>. |
michael@428 | 251 | |
michael@428 | 252 | This is the filesystem layout used by default for building OpenPKG |
michael@428 | 253 | packages during C<openpkg build> or the underlying C<openpkg rpm |
michael@428 | 254 | --rebuild> commands. |
michael@428 | 255 | |
michael@428 | 256 | =item B<local> |
michael@428 | 257 | |
michael@428 | 258 | =over 4 |
michael@428 | 259 | |
michael@428 | 260 | =item I<base-dir>C</.openpkg/rpmmacros> |
michael@428 | 261 | |
michael@428 | 262 | =item I<base-dir>C</>I<name>C<.spec> |
michael@428 | 263 | |
michael@428 | 264 | =item I<base-dir>C</>I<packaging-source-file> |
michael@428 | 265 | |
michael@428 | 266 | =item I<base-dir>C</>I<thirdparty-distribution-file> |
michael@428 | 267 | |
michael@428 | 268 | =item I<base-dir>C</>I<binary-rpm-package-file> |
michael@428 | 269 | |
michael@428 | 270 | =item I<base-dir>C</>I<source-rpm-package-file> |
michael@428 | 271 | |
michael@428 | 272 | =item I<base-dir>C</>I<temporary-file> |
michael@428 | 273 | |
michael@428 | 274 | =back |
michael@428 | 275 | |
michael@428 | 276 | This puts everything into one directory. |
michael@428 | 277 | |
michael@428 | 278 | =item B<simple> |
michael@428 | 279 | |
michael@428 | 280 | =over 4 |
michael@428 | 281 | |
michael@428 | 282 | =item I<base-dir>C</>I<name>C</.openpkg/rpmmacros> |
michael@428 | 283 | |
michael@428 | 284 | =item I<base-dir>C</>I<name>C</>I<name>C<.spec> |
michael@428 | 285 | |
michael@428 | 286 | =item I<base-dir>C</>I<name>C</>I<packaging-source-file> |
michael@428 | 287 | |
michael@428 | 288 | =item I<base-dir>C</>I<name>C</>I<thirdparty-distribution-file> |
michael@428 | 289 | |
michael@428 | 290 | =item I<base-dir>C</>I<binary-rpm-package-file> |
michael@428 | 291 | |
michael@428 | 292 | =item I<base-dir>C</>I<source-rpm-package-file> |
michael@428 | 293 | |
michael@428 | 294 | =item I<$TMPDIR>C</openpkg/>I<temporary-file> |
michael@428 | 295 | |
michael@428 | 296 | =back |
michael@428 | 297 | |
michael@428 | 298 | This is the simple filesystem layout of an unpacked |
michael@428 | 299 | OpenPKG package. All files are simply put into a sub-directory with the |
michael@428 | 300 | I<name> of the package. |
michael@428 | 301 | |
michael@428 | 302 | This is the filesystem layout used for the quick patching of a single |
michael@428 | 303 | OpenPKG package in a stand-alone environment. |
michael@428 | 304 | |
michael@428 | 305 | =item B<structured> |
michael@428 | 306 | |
michael@428 | 307 | =over 4 |
michael@428 | 308 | |
michael@428 | 309 | =item I<base-dir>C</>I<name>C</.openpkg/rpmmacros> |
michael@428 | 310 | |
michael@428 | 311 | =item I<base-dir>C</>I<name>C</src/>I<name>C<.spec> |
michael@428 | 312 | |
michael@428 | 313 | =item I<base-dir>C</>I<name>C</src/>I<packaging-source-file> |
michael@428 | 314 | |
michael@428 | 315 | =item I<base-dir>C</>I<name>C</dst/>I<thirdparty-distribution-file> |
michael@428 | 316 | |
michael@428 | 317 | =item I<base-dir>C</>I<name>C</pkg/>[C<bin/>]I<binary-rpm-package-file> |
michael@428 | 318 | |
michael@428 | 319 | =item I<base-dir>C</>I<name>C</pkg/>[C<src/>]I<source-rpm-package-file> |
michael@428 | 320 | |
michael@428 | 321 | =item I<base-dir>C</>I<name>C</tmp/>I<temporary-file> |
michael@428 | 322 | |
michael@428 | 323 | =back |
michael@428 | 324 | |
michael@428 | 325 | This is the structured (and default) filesystem layout of an unpacked |
michael@428 | 326 | OpenPKG package. A top-level sub-directory with the I<name> of the |
michael@428 | 327 | package is created. There the package specification and all packaging |
michael@428 | 328 | source files are put into the sub-directory I<src> and all the |
michael@428 | 329 | third-party distribution files are put into the sub-directory I<dst>. |
michael@428 | 330 | |
michael@428 | 331 | This is the filesystem layout used for the development of a single |
michael@428 | 332 | OpenPKG package in a stand-alone environment. |
michael@428 | 333 | |
michael@428 | 334 | =item B<distributed> |
michael@428 | 335 | |
michael@428 | 336 | =over 4 |
michael@428 | 337 | |
michael@428 | 338 | =item I<base-dir>C</>C<.openpkg/rpmmacros> |
michael@428 | 339 | |
michael@428 | 340 | =item I<base-dir>C</>C<src/>I<name>C</>I<name>C<.spec> |
michael@428 | 341 | |
michael@428 | 342 | =item I<base-dir>C</>C<src/>I<name>C</>I<packaging-source-file> |
michael@428 | 343 | |
michael@428 | 344 | =item I<base-dir>C</>C<dst/>I<name>C</>I<thirdparty-distribution-file> |
michael@428 | 345 | |
michael@428 | 346 | =item I<base-dir>C</>C<pkg/>[C<bin/>]I<binary-rpm-package-file> |
michael@428 | 347 | |
michael@428 | 348 | =item I<base-dir>C</>C<pkg/>[C<src/>]I<source-rpm-package-file> |
michael@428 | 349 | |
michael@428 | 350 | =item I<base-dir>C</>C<tmp/>I<temporary-file> |
michael@428 | 351 | |
michael@428 | 352 | =back |
michael@428 | 353 | |
michael@428 | 354 | This is the distributed filesystem layout of an unpacked OpenPKG |
michael@428 | 355 | package. It is similar to the structured filesystem layout but the |
michael@428 | 356 | C<src> and C<dst> directories and the I<name> directory are swapped, |
michael@428 | 357 | mainly with the intention of bundling together all third-party |
michael@428 | 358 | distribution files of a large number of packages. |
michael@428 | 359 | |
michael@428 | 360 | This is the filesystem layout used for regular OpenPKG package |
michael@428 | 361 | development. |
michael@428 | 362 | |
michael@428 | 363 | =back |
michael@428 | 364 | |
michael@428 | 365 | |
michael@428 | 366 | =head1 LOCAL RPM MACROS FILE (.openpkg/rpmmacros) |
michael@428 | 367 | |
michael@428 | 368 | OpenPKG supports local RPM macros files F<.openpkg/rpmmacros> which |
michael@428 | 369 | can be used to configure RPM in a local scope. This is especially |
michael@428 | 370 | interesting to configure a local (even per-package) build environment |
michael@428 | 371 | with the help of the C<%openpkg_layout> macro. |
michael@428 | 372 | |
michael@428 | 373 | C<%openpkg_layout> |
michael@428 | 374 | [C<macrosfile=>I<filename>] |
michael@428 | 375 | [C<basedir=>I<directory>] |
michael@428 | 376 | [C<specdir=>I<directory>] |
michael@428 | 377 | [C<sourcedir=>I<directory>] |
michael@428 | 378 | [C<builddir=>I<directory>] |
michael@428 | 379 | [C<tmpdir=>I<directory>] |
michael@428 | 380 | [C<binrpmdir=>I<directory>] |
michael@428 | 381 | [C<srcrpmdir=>I<directory>] |
michael@428 | 382 | [C<shared=>I<yes-or-no>] |
michael@428 | 383 | [C<debug=>I<yes-or-no>] |
michael@428 | 384 | |
michael@428 | 385 | =over 4 |
michael@428 | 386 | |
michael@428 | 387 | =item C<macrosfile=>I<filename> |
michael@428 | 388 | |
michael@428 | 389 | Absolute file path of the C<.openpkg/rpmmacros> file where this |
michael@428 | 390 | C<%openpkg_layout> macro is defined. Usually, the intended usage is to |
michael@428 | 391 | leverage from OpenPKG RPM's special C<%{macrosfile}> macro by simply |
michael@428 | 392 | using C<macrosfile=%{macrosfile}>. This parameter is important as |
michael@428 | 393 | the default C<basename> is derived from it. |
michael@428 | 394 | |
michael@428 | 395 | =item C<basedir=>I<directory> |
michael@428 | 396 | |
michael@428 | 397 | Absolute directory path where the C<.openpkg/rpmmacros> file is |
michael@428 | 398 | located under. Usually, the intended usage is to not explicitly |
michael@428 | 399 | set this parameter but let it be determined indirectly via |
michael@428 | 400 | C<macrosfile>. The effective default value is equal to a value like |
michael@428 | 401 | C<%{realpath:%{dirname:%{realpath:%{macrosfile}}}/..}> This parameter is |
michael@428 | 402 | important as all standard filesystem layouts (see parameter C<layout>) |
michael@428 | 403 | are always at least partially based on this base directory in order |
michael@428 | 404 | to provide absolute-path-independent flexible filesystem layouts. |
michael@428 | 405 | |
michael@428 | 406 | =item C<layout=>I<layout> |
michael@428 | 407 | |
michael@428 | 408 | The name of the filesystem layout type to use. The following standard |
michael@428 | 409 | filesystem layout types are pre-defined: C<global>, C<local>, C<simple>, |
michael@428 | 410 | C<structured> (default) and C<distributed>. |
michael@428 | 411 | |
michael@428 | 412 | global macrosdir <openpkg_prefix>/etc/openpkg |
michael@428 | 413 | global macrosfile <openpkg_prefix>/etc/openpkg/rpmmacros |
michael@428 | 414 | global specdir <openpkg_prefix>/RPM/SRC/$name |
michael@428 | 415 | global sourcedir <openpkg_prefix>/RPM/SRC/$name |
michael@428 | 416 | global builddir <openpkg_prefix>/RPM/TMP |
michael@428 | 417 | global tmpdir <openpkg_prefix>/RPM/TMP |
michael@428 | 418 | global binrpmdir <openpkg_prefix>/RPM/PKG |
michael@428 | 419 | global srcrpmdir <openpkg_prefix>/RPM/PKG |
michael@428 | 420 | |
michael@428 | 421 | local macrosdir <basedir>/.openpkg |
michael@428 | 422 | local macrosfile <basedir>/.openpkg/rpmmacros |
michael@428 | 423 | local specdir <basedir> |
michael@428 | 424 | local sourcedir <basedir> |
michael@428 | 425 | local builddir <basedir> |
michael@428 | 426 | local tmpdir <basedir> |
michael@428 | 427 | local binrpmdir <basedir> |
michael@428 | 428 | local srcrpmdir <basedir> |
michael@428 | 429 | |
michael@428 | 430 | simple macrosdir <basedir>/.openpkg |
michael@428 | 431 | simple macrosfile <basedir>/.openpkg/rpmmacros |
michael@428 | 432 | simple specdir <basedir> |
michael@428 | 433 | simple sourcedir <basedir> |
michael@428 | 434 | simple builddir <tmpdir> |
michael@428 | 435 | simple tmpdir <tmpdir> |
michael@428 | 436 | simple binrpmdir <basedir>/.. |
michael@428 | 437 | simple srcrpmdir <basedir>/.. |
michael@428 | 438 | |
michael@428 | 439 | structured macrosdir <basedir>/.openpkg |
michael@428 | 440 | structured macrosfile <basedir>/.openpkg/rpmmacros |
michael@428 | 441 | structured specdir <basedir>/src |
michael@428 | 442 | structured sourcedir <basedir>/dst |
michael@428 | 443 | structured builddir <basedir>/tmp |
michael@428 | 444 | structured tmpdir <basedir>/tmp |
michael@428 | 445 | structured binrpmdir <basedir>/pkg/bin |
michael@428 | 446 | structured srcrpmdir <basedir>/pkg/src |
michael@428 | 447 | |
michael@428 | 448 | distributed macrosdir <basedir>/.openpkg |
michael@428 | 449 | distributed macrosfile <basedir>/.openpkg/rpmmacros |
michael@428 | 450 | distributed specdir <basedir>/src/<name> |
michael@428 | 451 | distributed sourcedir <basedir>/dst/<name> |
michael@428 | 452 | distributed builddir <basedir>/tmp |
michael@428 | 453 | distributed tmpdir <basedir>/tmp |
michael@428 | 454 | distributed binrpmdir <basedir>/pkg/bin |
michael@428 | 455 | distributed srcrpmdir <basedir>/pkg/src |
michael@428 | 456 | |
michael@428 | 457 | |
michael@428 | 458 | =item C<specdir=>I<directory-list> |
michael@428 | 459 | |
michael@428 | 460 | =item C<sourcedir=>I<directory-list> |
michael@428 | 461 | |
michael@428 | 462 | =item C<builddir=>I<directory-list> |
michael@428 | 463 | |
michael@428 | 464 | =item C<tmpdir=>I<directory-list> |
michael@428 | 465 | |
michael@428 | 466 | =item C<binrpmdir=>I<directory-list> |
michael@428 | 467 | |
michael@428 | 468 | =item C<srcrpmdir=>I<directory-list> |
michael@428 | 469 | |
michael@428 | 470 | These parameters correspond to the six individual directories provided |
michael@428 | 471 | by a standard layout and allow you to selectively adjust parts of a |
michael@428 | 472 | standard layout to local needs and without having to define a full |
michael@428 | 473 | standard layout yourself. |
michael@428 | 474 | |
michael@428 | 475 | The I<directory-list> is a whitespace-separated list of |
michael@428 | 476 | I<directory>[C<:>[C<+>]I<directory>] specifications which are |
michael@428 | 477 | "first-match" searched for existence. The last directory in the list |
michael@428 | 478 | is always taken as the fallback and if it is not existing it is |
michael@428 | 479 | even created on-the-fly. The I<directory-check>C<:>I<directory-use> |
michael@428 | 480 | syntax variant allows the existence test to use I<directory-check>, |
michael@428 | 481 | but expands to I<directory-use> (replace mode). The |
michael@428 | 482 | I<directory-check>C<:+>I<directory-use> syntax variant allows |
michael@428 | 483 | the existence test to use I<directory-check>, but expands to |
michael@428 | 484 | I<directory-check>I<directory-use> (append mode). For instance |
michael@428 | 485 | C<tmpdir="%{getenv:HOME)/tmp:+/openpkg %{getenv:TMPDIR}:+/openpkg |
michael@428 | 486 | /tmp/%(echo $LOGNAME)/openpkg"> will first check for ~/tmp (and then use |
michael@428 | 487 | ~/tmp/openpkg), then for $TMPDIR (and use $TMPDIR/openpkg) and finally |
michael@428 | 488 | it will use /tmp/$LOGNAME/openpkg at last resort. |
michael@428 | 489 | |
michael@428 | 490 | Paths are usually assembled by using RPM macros like |
michael@428 | 491 | C<%{l_prefix}> (the instance prefix), C<%{__openpkg_basename}> (the |
michael@428 | 492 | I<basename> parameter), C<%{realpath:<path>} (path resolution), |
michael@428 | 493 | C<%{dirname:<path>} (directory name extraction), C<%{basename:<path>} |
michael@428 | 494 | (file name extraction), etc. |
michael@428 | 495 | |
michael@428 | 496 | =item C<shared=>I<yes-or-no> |
michael@428 | 497 | |
michael@428 | 498 | This enables the I<subdir> components in the standard filesystem |
michael@428 | 499 | layouts by setting it to an automatically generated sub-directory named |
michael@428 | 500 | I<host>C<->I<arch>-I<os>. This allows one to build the same OpenPKG |
michael@428 | 501 | package in parallel on multiple hosts in a shared environment (usually |
michael@428 | 502 | on an NFS based filesystem). |
michael@428 | 503 | |
michael@428 | 504 | =item C<debug=>I<yes-or-no> |
michael@428 | 505 | |
michael@428 | 506 | This enables debug outputs which shows the effectively used directory |
michael@428 | 507 | paths. |
michael@428 | 508 | |
michael@428 | 509 | =back |
michael@428 | 510 | |
michael@428 | 511 | The generated C<.openpkg/rpmmacros> file contains the generic filesystem |
michael@428 | 512 | layout glue configuration for the particular filesystem I<layout>. |
michael@428 | 513 | |
michael@428 | 514 | =over 1 |
michael@428 | 515 | |
michael@428 | 516 | =item C<%openpkg_layout macrosfile=%{macrosfile} layout=>I<type> |
michael@428 | 517 | |
michael@428 | 518 | =back |
michael@428 | 519 | |
michael@428 | 520 | =head1 CONFIGURATION |
michael@428 | 521 | |
michael@428 | 522 | =over 4 |
michael@428 | 523 | |
michael@428 | 524 | OPENPKG_NAME="Ralf S. Engelschall" |
michael@428 | 525 | OPENPKG_MAIL="rse@openpkg.net" |
michael@428 | 526 | OPENPKG_MODE="developer" |
michael@428 | 527 | |
michael@428 | 528 | OPENPKG_PREFIX="/openpkg" |
michael@428 | 529 | OPENPKG_TMPDIR="${TMPDIR-/tmp}/openpkg" |
michael@428 | 530 | |
michael@428 | 531 | OPENPKG_VCS="cvs ci -m '<msg>' ." |
michael@428 | 532 | OPENPKG_UPLD="scp <srpm> openpkg-ftp@ftp.openpkg.org:/current/SRC/00UPLOAD/" |
michael@428 | 533 | |
michael@428 | 534 | =back |
michael@428 | 535 | |
michael@428 | 536 | =head1 ABOUT |
michael@428 | 537 | |
michael@428 | 538 | OpenPKG B<dev> is Ralf S. Engelschall's Perl-based clean-room partial |
michael@428 | 539 | re-implementation of 2008 for OpenPKG 4.0 of Thomas Lotterer's original |
michael@428 | 540 | OpenPKG B<dev> Bash-based shell from 2002. |
michael@428 | 541 | |
michael@428 | 542 | =cut |
michael@428 | 543 |