Re: Media Packages Vs. Ports

2010-09-25 Thread Matthew Seaman
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: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Media Packages Vs. Ports

2010-09-24 Thread Devin Teske
On Fri, 2010-09-24 at 10:54 -0400, Rick Miller wrote: 
> I've created the package and copied it to the networked media.  How do
> I edit the INDEX file so that it knows how to get the file?

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.

In addition, here's a guide that I wrote long ago:

HOWTO: Interpret the obfuscated `INDEX' file located on FreeBSD CD-ROMs.

AUTHOR: Devin Teske
DATE: January 1st, 2006
LAST MODIFIED: February 24th, 2006 09:45:54

PURPOSE:

   This file  documents the file format of  `/packages/INDEX'  file located on
   FreeBSD installation CD-ROMs  and  conveys  what  it is  used for  (and its
   importance).

 1. Foreword
 2. The INDEX File
 3. The FreeBSD INDEX File Format
 3a. FreeBSD-5.2 and FreeBSD-4.10 or Lower
 3b. FreeBSD-5.3 and FreeBSD-4.11 or Higher
 3c. FreeBSD-6.0 or Higher
 4. Field Definitions
 5. Field Population
 6. References

===

1. FOREWORD

   This document describes the format of the `/packages/INDEX' file located on
   the FreeBSD installation CD-ROM. Depending on which FreeBSD release version
   you are working with,  the format may vary.  Documented below you will find
   3 versions commonly used.

   Common  between  each  version,  is that  each line  (delimited by the new-
   line character) corresponds to a singl e package (found in `packages/All').
   It is possible to have additional fields  beyond the last field (for custom
   purposes) as they will be ignored by sysinstall.

===

2. THE INDEX FILE

   The INDEX file (located on the FreeBSD installation CD-ROMs) is a file that
   is read by sysinstall (see sysinstall(8)) for the installation of ancillary
   packages (located in `/packages').  When sysinstall displays an interactive
   menu for the selection of these packages,  it uses the INDEX file  (located
   at `/packages/INDEX')  to display information such as the package name, the
   package description, and what categories to place it in.

   If sysinstall  is scripted,  then the  interactive menu  may  or may not be
   invoked (if not, then the categories/description fields may be omitted).

   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.

===

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

===

4. FIELD DEFINITIONS

   package
  This is the name of the package.  This should be the name of the file as
  it appears in  `/packages/All' without the  `.tgz' suffix. This value is
  used for finding the package  tarball and is also displayed in the left-
  hand column of the interactive package selection menu of sysinstall.

   port-origin
  The package origin  (as a qualified  pathname).  Basically,  this is the
  origin of the package with a  `/usr/ports/'  prefix.  Even if you do not
  install the Ports Collection  (which installs Makefiles and other infor-
  mation), this should be populated respectively.

   

Re: Media Packages Vs. Ports

2010-09-24 Thread Lowell Gilbert
Rick Miller  writes:

> On Tue, Sep 21, 2010 at 3:55 PM, Adam Vande More  
> wrote:
>> On Tue, Sep 21, 2010 at 11:41 AM,  wrote:
>>>
>>>  Is it possible to take a port, make a package of it and put it in the
>>> packages directory of my own media?
>>
>> Sure it's easy.  When build a port you can issue a make package command, or
>> you can use pkg_create to create packages from installed ported.  A common
>> approach to this is build all your updates in a jail, make packages of them,
>> then delete package from the host and install the newly built ones from the
>> jail.  Very small, if any downtime.  You can use the jail to create pkg's
>> for a custom repository too.
>
> I've created the package and copied it to the networked media.  How do
> I edit the INDEX file so that it knows how to get the file?

I'm not sure what you're saying here, but I think what you want is just
to set the PACKAGEROOT variable.  If you want to create your own install
disks, the release(7) manual will point you in the right direction.  If
you're doing a network install, you need to lay out the package
directories the same way as the install media.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Re: Media Packages Vs. Ports

2010-09-24 Thread vrwmiller

On Sep 24, 2010 10:54am, Rick Miller  wrote:
On Tue, Sep 21, 2010 at 3:55 PM, Adam Vande More amvandem...@gmail.com>  
wrote:



> On Tue, Sep 21, 2010 at 11:41 AM, vrwmil...@gmail.com> wrote:



>>



>> Is it possible to take a port, make a package of it and put it in the



>> packages directory of my own media?



>


> Sure it's easy. When build a port you can issue a make package command,  
or


> you can use pkg_create to create packages from installed ported. A  
common


> approach to this is build all your updates in a jail, make packages of  
them,


> then delete package from the host and install the newly built ones from  
the



> jail. Very small, if any downtime. You can use the jail to create pkg's



> for a custom repository too.





I've created the package and copied it to the networked media. How do



I edit the INDEX file so that it knows how to get the file?


I did figure out one way to get this to work. I copied the entry for the  
port from the ports index file into the packages index file and it worked.  
Whether or not it's an appropriate way, I am unsure.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Media Packages Vs. Ports

2010-09-24 Thread Rick Miller
On Tue, Sep 21, 2010 at 3:55 PM, Adam Vande More  wrote:
> On Tue, Sep 21, 2010 at 11:41 AM,  wrote:
>>
>>  Is it possible to take a port, make a package of it and put it in the
>> packages directory of my own media?
>
> Sure it's easy.  When build a port you can issue a make package command, or
> you can use pkg_create to create packages from installed ported.  A common
> approach to this is build all your updates in a jail, make packages of them,
> then delete package from the host and install the newly built ones from the
> jail.  Very small, if any downtime.  You can use the jail to create pkg's
> for a custom repository too.

I've created the package and copied it to the networked media.  How do
I edit the INDEX file so that it knows how to get the file?


-- 
Take care
Rick Miller
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Re: Media Packages Vs. Ports

2010-09-22 Thread vrwmiller

Thanks, Adam. This is most helpful. I appreciate it.

On Sep 21, 2010 3:55pm, Adam Vande More  wrote:

On Tue, Sep 21, 2010 at 11:41 AM, vrwmil...@gmail.com> wrote:



Hi all,




I am performing PXE boots and automated installs of FreeBSD 8.1-RELEASE  
with a custom sysinstall.cfg file which identifies packages that are to  
be installed in addition to the distributions. We have need to install  
compat6x-amd64 and I'd like to have this done during install.  
Unfortunately, it does not appear that this package exists in the FreeBSD  
media from which the install occurs. However, it is available through the  
ports collection.




You'll probably want to do something like this:



http://bsdbased.com/2010/03/23/freebsd-binary-package-repository-howto



FWIW, that's not the end all, be all to setting up your own package  
repository just a reasonably simple method.






What is the relationship between the packages directory on the media and  
the ports collection?

http://www.freebsd.org/doc/handbook/packages-using.html



Packages associated with a RELEASE also ultimately come from the ports  
tree. However, those RELEASE packages come from a ports tree that was put  
into slush, then frozen. This means those packages had more testing and  
tweaking.




Is it possible to take a port, make a package of it and put it in the  
packages directory of my own media?





Sure it's easy. When build a port you can issue a make package command,  
or you can use pkg_create to create packages from installed ported. A  
common approach to this is build all your updates in a jail, make  
packages of them, then delete package from the host and install the newly  
built ones from the jail. Very small, if any downtime. You can use the  
jail to create pkg's for a custom repository too.




http://www.mail-archive.com/freebsd-questions@freebsd.org/msg228757.html
--
Adam Vande More


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Media Packages Vs. Ports

2010-09-21 Thread Adam Vande More
On Tue, Sep 21, 2010 at 11:41 AM,  wrote:

> Hi all,
>
> I am performing PXE boots and automated installs of FreeBSD 8.1-RELEASE
> with a custom sysinstall.cfg file which identifies packages that are to be
> installed in addition to the distributions. We have need to install
> compat6x-amd64 and I'd like to have this done during install. Unfortunately,
> it does not appear that this package exists in the FreeBSD media from which
> the install occurs. However, it is available through the ports collection.
>

You'll probably want to do something like this:

http://bsdbased.com/2010/03/23/freebsd-binary-package-repository-howto

FWIW, that's not the end all, be all to setting up your own package
repository just a reasonably simple method.


>
> What is the relationship between the packages directory on the media and
> the ports collection?


http://www.freebsd.org/doc/handbook/packages-using.html

Packages associated with a RELEASE also ultimately come from the ports
tree.  However, those RELEASE packages come from a ports tree that was put
into slush, then frozen.  This means those packages had more testing and
tweaking.

 Is it possible to take a port, make a package of it and put it in the
> packages directory of my own media?
>

Sure it's easy.  When build a port you can issue a make package command, or
you can use pkg_create to create packages from installed ported.  A common
approach to this is build all your updates in a jail, make packages of them,
then delete package from the host and install the newly built ones from the
jail.  Very small, if any downtime.  You can use the jail to create pkg's
for a custom repository too.

http://www.mail-archive.com/freebsd-questions@freebsd.org/msg228757.html

-- 
Adam Vande More
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"