From owner-freebsd-ports@FreeBSD.ORG Sun May 6 09:40:24 2007 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFF9916A403 for ; Sun, 6 May 2007 09:40:24 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.187.76.162]) by mx1.freebsd.org (Postfix) with ESMTP id 0A35A13C44C for ; Sun, 6 May 2007 09:40:23 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.1/8.14.1) with ESMTP id l469e4w5007125; Sun, 6 May 2007 10:40:07 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) Authentication-Results: smtp.infracaninophile.co.uk from=m.seaman@infracaninophile.co.uk; sender-id=permerror; spf=permerror X-SenderID: Sendmail Sender-ID Filter v0.2.14 smtp.infracaninophile.co.uk l469e4w5007125 Message-ID: <463DA274.5040902@infracaninophile.co.uk> Date: Sun, 06 May 2007 10:40:04 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.0 (X11/20070420) MIME-Version: 1.0 To: Garrett Cooper References: <463D87E7.9080903@u.washington.edu> In-Reply-To: <463D87E7.9080903@u.washington.edu> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Sun, 06 May 2007 10:40:17 +0100 (BST) X-Virus-Scanned: ClamAV 0.90.2/3211/Sat May 5 23:05:40 2007 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_POLICY_TESTING, DK_POLICY_SIGNSOME,NO_RELAYS autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-ports Subject: Re: Question about fields in INDEX files X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2007 09:40:24 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Garrett Cooper wrote: > Hello all, > As part of my Google SoC project I'm taking a look at INDEX-{ver} > and revising it to fit Berkeley DB objects combined with pkg_*, much > like pkgdb does. > > I have a few questions about the meanings of the fields though and > their use. I'm using net/DarwinStreamingServer as an example, because > it's short, and contains all of the fields I could find present in all > of the INDEX entries, and this comes from INDEX-7, not INDEX-5 or INDEX-6. > > ======= > Entry: > ======= > DarwinStreamingServer-5.5.4_1|/usr/ports/net/DarwinStreamingServer|/usr/local|Darwin > Streaming Server, a MP3, MPEG4 and QuickTime streaming > server|/usr/ports/net/DarwinStreamingServer/pkg-descr|nork@FreeBSD.org|net||p5-Net-SSLeay-1.30_1 > perl-5.8.8|http://developer.apple.com/darwin/projects/streaming/||| > > ======= > > The fields are as following (separated by pipes): > 1. [Port name (without category)]-[version][{:_revision}] > 2. Full path to port. > 3. Installation prefix (?) > 4. Comment > 5. Full path to pkg-descr file > 6. Maintainer > 7. Category > 8. [unknown] -- blank field > 9. Direct dependencies > 10. Developer's / Project's Webpage > 11., 12. [unknown] (x2) -- blank fields > > ======= > > If someone can correct me on the meanings of these fields, that would be > fantastic. Also, if someone can help me discover the secret identities > of some of the unknown fields (in particular the last 2 blank fields), > that would be helpful as well. I understand that the majority of these > lines do come from the Makefiles, but I'm not sure what additional > fields could be involved in this. > > Also, I was wondering if fields 3. and 5. are really necessary in the > INDEX file. 3. can be user specified, or default to a particular value. > > Also, 5. can be automatically assumed to {2.}/pkg-descr in all cases > that I've seen. So, given this observation is there any real case that > this assumption would be false? > > Thanks for any and all help! > -Garrett Been there, done that. Take a look at the code in Port.pm from my FreeBSD::Portindex stuff. Particularly the print() method: # # Print out one line of the INDEX file # sub print ($*;$) { my $self = shift; my $fh = shift; my $allports = shift; my $counter = shift; print $fh $self->PKGNAME(), '|'; print $fh $self->ORIGIN(), '|'; print $fh $self->STUFF(), '|'; print $fh $self->_chase_deps( $allports, 'BUILD_DEPENDS' ), '|'; print $fh $self->_chase_deps( $allports, 'RUN_DEPENDS' ), '|'; print $fh $self->WWW(), '|'; print $fh $self->_chase_deps( $allports, 'EXTRACT_DEPENDS' ), '|'; print $fh $self->_chase_deps( $allports, 'PATCH_DEPENDS' ), '|'; print $fh $self->_chase_deps( $allports, 'FETCH_DEPENDS' ), "\n"; counter( \%::Config, $counter ); return $self; } STUFF is the amalgamation of fields 3,4,5,6,7 which you've already identified. The PREFIX (field 3) is usually /usr/local although for a limited time there are still a number of X11 related entries using /usr/X11R6. Similarly the pkg-desc (field 5) is almost always /usr/ports///pkg-descr -- but there are a significant number of exceptions, which are slave ports. Eg. compare these two INDEX entries: % grep ^mod_jk INDEX-6 mod_jk-1.2.21,1|/usr/ports/www/mod_jk|/usr/local|Apache JK module for connecting to Tomcat using AJP1X|/usr/ports/www/mod_jk/pkg-descr|girgen@FreeBSD.org|www|apache-1.3.37_3 expat-2.0.0_1 gettext-0.16.1_1 gmake-3.81_1 libiconv-1.9.2_2 perl-5.8.8|apache-1.3.37_3 expat-2.0.0_1 perl-5.8.8|http://tomcat.apache.org/connectors-doc/||| mod_jk-ap2-1.2.21|/usr/ports/www/mod_jk-apache2|/usr/local|Apache2 JK module for connecting to Tomcat using AJP1X|/usr/ports/www/mod_jk-apache2/../mod_jk/pkg-descr|girgen@FreeBSD.org|www|apache-2.0.59 expat-2.0.0_1 gettext-0.16.1_1 gmake-3.81_1 libiconv-1.9.2_2 perl-5.8.8|apache-2.0.59 expat-2.0.0_1 libiconv-1.9.2_2 perl-5.8.8|http://tomcat.apache.org/connectors-doc/||| Note that either of these fields can vary with local customization as well -- nothing says that you've always got to keep the ports tree rooted at /usr/ports or install everything with a prefix of /usr/local, although if you change any of that, you're going to be building your own INDEX anyhow. The 5 'DEPENDS' entries in the last 6 fields consist of the output of various FOO_DEPENDS variables from the port's Makefile processed to turn the port origins 'editors/emacs21' into the package names 'emacs-21.3_9' These values are then combined in various ways, ie. RUN_DEPENDS in the Index file is the combination of the values from the $RUN_DEPENDS and $LIB_DEPENDS variables from the Makefile, plus the accumulated sum of the RUN_DEPENDS for each of the dependencies, and each of their dependencies, recursively. eg. If '$EXTRACT_DEPENDS' in the port Makefile is set to: EXTRACT_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio then the EXTRACT_DEPENDS field in the Index will be set to: perl-5.8.8 rpm2cpio-1.2_2 ie. the direct dependency rpm2cpio-1.2_2 plus all of the RUN_DEPENDS for rpm2cpio-1.2_2, vis perl-5.8.8. Perl doesn't have any other RUN_DEPENDS so the expansion stops there. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGPaJ08Mjk52CukIwRCJ+dAJ0YEt6iNRhiWrgTTbHtQAANQ0mpNACfQwoC JIBs3yGT0sT8vHugSJvobCY= =C+w6 -----END PGP SIGNATURE-----