Media Packages Vs. Ports

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Sep 25 07:38:38 UTC 2010


On 25/09/2010 01:10:57, Devin Teske wrote:

> HINT: If you created the package from the ports tree, you can say "make
> describe" in the package's top-level port directory
> (e.g. /usr/ports/pkg_origin/some_pkg). This will produce a line that can
> be added to the INDEX file without much modification, if any.

Not quite.  The make describe output differs from the INDEX entry lines
in  two important ways:

    * make describe only includes the immediate dependencies of the
      port.  The INDEX contains the sum, recursively, of the ports
      dependencies, the dependences of the dependencies, etc. etc. There
      are some subtleties to do with RUN_DEPENDS or LIB_DEPENDS,
      compared to BUILD_DEPENDS.

    * The dependency entries produced in the make describe output are
      directories in the ports tree, whereas the the INDEX uses the
      corresponding package names. eg.  /usr/ports/www/apache22 vs
      (at the moment) apache-2.2.16_1

>    When  sysinstall is  in the process of  installing the  packages,  it first
>    makes sure that all the run-dependencies (listed in the INDEX file for that
>    package) are installed. If a package that is listed in the `run-deps' field
>    is not  installed,  sysinstall installs it before  installing the requested
>    package. After installing any dependent packages (recursively),  sysinstall
>    then  unpacks  the  requested  package  and  reads  its  packing-list  (the
>    `+CONTENTS'  file within  the package  tarball).  All package  dependencies
>    listed inside the package's packing-list  MUST  be installed before-hand or
>    else sysinstall will generate an error. Therefore, all package dependencies
>    that appear in the packing list MUST be present in the  `run-deps' field of
>    the INDEX file. There reverse is not true, however. A dependency may appear
>    in the INDEX file and not in the package's packing-list.

It's pkg_add(1) that does the dependency chasing in general -- and it
doesn't need access to an INDEX file: pkg dependencies are recorded in
the pkg file itself, and pkg_add knows how to fetch the dependencies
from the same place the original pkg file came from.  See pkg_add(1),
particulary the description of the '-r' option and the ENVIRONMENT section.

> ===============================================================================
> 
> 3. THE FREEBSD INDEX FILE FORMAT
> 
>    3a. FREEBSD-5.2 AND FREEBSD-4.10 OR LOWER
> 
>       package|port-origin|install-prefix|comment|port-desc-file|maintainer|  \ 
>       categories|build-deps|run-deps|www-site
> 
>    3b. FREEBSD-5.3 AND FREEBSD-4.11 OR HIGHER
> 
>       package|port-origin|install-prefix|comment|port-desc-file|maintainer|  \ 
>       categories|build-deps|run-deps|www-site|unknown|unknown|unknown
> 
>       I have never seen the  11th,  12th,  or 13th field  populated.  So their
>       purpose remains unknown.
> 
>    3c. FREEBSD-6.0 OR HIGHER
> 
>       package|port-origin|install-prefix|comment|port-desc-file|maintainer|  \ 
>       categories|build-deps|run-deps|www-site|unknown|unknown|unknown|disc

The unknown fields here are essentially the contents of the following
make variables from the port:

   EXTRACT_DEPENDS
   PATCH_DEPENDS
   FETCH_DEPENDS

Like the run and build depends, these are expanded to include the sum of
all their dependencies.  These fields are frequently empty, but they
certainly aren't unused:

% cut -d '|' -f 11 < INDEX-8 | grep '.' | wc -l
    7129
% cut -d '|' -f 12 < INDEX-8 | grep '.' | wc -l
    6173
% cut -d '|' -f 13 < INDEX-8 | grep '.' | wc -l
       3

(that's out of about 22000 INDEX entries currently)

> 6. REFERENCES
> 
>    The information  in this document  is the result  of many hours of reverse-
>    engineering and testing. Little or no sources on this topic have been found
>    online.  Even when  the  subject matter  was found  online,  the amount  of
>    information on the topic was anemic.


I found the best resource was reading the code of the make-index script,
here:

http://www.freebsd.org/cgi/cvsweb.cgi/ports/Tools/make_index

You can also look at my ports-mgmt/p5-FreeBSD-Portindex programs which
have quite a lot of explanatory commenting.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20100925/cd610d1e/signature.pgp


More information about the freebsd-questions mailing list