From 53277fb5883dc6111d35f7d1a95f996700f0d72c Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 7 Oct 2005 18:30:17 +0000 Subject: Rewrote the sections explaining the distinfo file and the WRKSRC variable. They had been out-of-date and lacked complete sentences. --- doc/guide/files/components.xml | 125 ++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 64 deletions(-) (limited to 'doc/guide/files') diff --git a/doc/guide/files/components.xml b/doc/guide/files/components.xml index e4a196ed693..d2318090e53 100644 --- a/doc/guide/files/components.xml +++ b/doc/guide/files/components.xml @@ -1,4 +1,4 @@ - + Package components - files, directories and contents @@ -30,7 +30,7 @@ PKGNAME is the name of the package, as used by pkgsrc. You only need to provide it if it - differs from DISTNAME. Usually it is the directory name together + differs from DISTNAME. Usually it is the directory name together with the version number. It must match the regular expression ^[A-Za-z0-9][A-Za-z0-9-_.+]*$, that is, it starts with a letter or digit, and contains only letters, digits, @@ -170,11 +170,41 @@ SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ Other variables that affect the build: - WRKSRC: The directory where - the interesting distribution files of the package are found. The - default is ${WRKDIR}/${DISTNAME}, which - works for most packages. + + + WRKSRC: The directory where the + interesting distribution files of the package are found. The + default is ${WRKDIR}/${DISTNAME}, which + works for most packages. + + If a package doesn't create a subdirectory for itself + (most GNU software does, for instance), but extracts itself in + the current directory, you should set WRKSRC= + ${WRKDIR}. + + If a package doesn't create a subdirectory with the name + of DISTNAME but some different name, set + WRKSRC to point to the proper name in + ${WRKDIR}, for example WRKSRC= + ${WRKDIR}/${DISTNAME}/unix. See lang/tcl and x11/tk for other examples. + + The name of the working directory created by pkgsrc is + taken from the WRKDIR_BASENAME variable. By + default, its value is work. If you want + to use the same pkgsrc tree for building different kinds of + binary packages, you can change the variable according to your + needs. Two other variables handle common cases of setting + WRKDIR_BASENAME individually. If + OBJHOSTNAME is defined in + /etc/mk.conf, the first component of the + host's name is attached to the directory name. If + OBJMACHINE is defined, the platform name is + attached, which might look like work.i386 + or work.sparc. + Please pay attention to the following gotchas: @@ -202,37 +232,30 @@ SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ <filename>distinfo</filename> - Most important, the mandatory message digest, or checksum, of all the - distfiles needed for the package to compile, confirming they match the - original file distributed by the author. This ensures that the - distfile retrieved from the Internet has not been corrupted during - transfer or altered by a malign force to introduce a security hole. - It is generated using the make makesum command. - The digest algorithm used was, at one stage, md5, but that was felt - lacking compared to sha1, and so sha1 is now the default algorithm. - The distfile size is also generated and stored in new distinfo files. - The pkgtools/digest utility - calculates all of the digests in the distinfo file, and it provides - various different algorithms. At the current time, the algorithms - provided are: - md5, rmd160, - sha1, sha256, - sha384 and sha512. - - Some packages have different sets of distfiles on a per architecture - basis, for example www/navigator). These are kept in the - same distinfo file and care should be taken when upgrading such a - package to ensure distfile information is not lost. - - The message digest/checksum for all the official patches found in the - patches/ directory (see - ) for the package is also stored in - the distinfo file. This is a message - digest/checksum of all lines in the patch file except the &os; RCS Id. - This file is generated by invoking make - makepatchsum (or make mps if you're - in a hurry). + The distinfo file contains the message + digest, or checksum, of each distfile needed for the package. This + ensures that the distfiles retrieved from the Internet have not been + corrupted during transfer or altered by a malign force to introduce + a security hole. Due to recent rumor about weaknesses of digest + algorithms, all distfiles are protected using both SHA1 and RMD160 + message digests, as well as the file size. + + The distinfo file also contains the + checksums for all the patches found in the + patches directory (see ). + + To regenerate the distinfo file, use the + make makedistinfo or make mdi + command. + + Some packages have different sets of distfiles depending on + the platform, for example www/navigator). These are kept in the same + distinfo file and care should be taken when + upgrading such a package to ensure distfile information is not + lost. + @@ -366,7 +389,7 @@ SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ MESSAGE - Display this file after installation of the package. + This file is displayed after installation of the package. Useful for things like legal notices on almost-free software and hints for updating config files after installing modules for apache, PHP etc. @@ -395,32 +418,6 @@ SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ The default is ${.CURDIR}/work or ${.CURDIR}/work.${MACHINE_ARCH} if OBJMACHINE is set. - - If a package doesn't create a subdirectory for itself (like - GNU software does, for instance), but extracts itself in the - current directory, you should set WRKSRC - accordingly, e.g. editors/sam - again, but the quick answer is: - - WRKSRC= ${WRKDIR} - - If a package doesn't create a subdir with the name of - DISTNAME but some different name, set - WRKSRC to point to the proper name in - ${WRKDIR}. See lang/tcl and - x11/tk for examples, and here is - another one: - - WRKSRC= ${WRKDIR}/${DISTNAME}/unix - - The name of the working directory created by pkgsrc is - work by default. If the same pkgsrc tree - should be used on several different platforms, the variable - OBJMACHINE can be set in /etc/mk.conf to - attach the platform to the directory name, - e.g. work.i386 or - work.sparc. -- cgit v1.2.3