From owner-svn-doc-all@FreeBSD.ORG Thu Mar 6 18:32:16 2014 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EB39361; Thu, 6 Mar 2014 18:32:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3AA89DE; Thu, 6 Mar 2014 18:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26IWFtv038474; Thu, 6 Mar 2014 18:32:15 GMT (envelope-from mat@svn.freebsd.org) Received: (from mat@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26IWFVk038473; Thu, 6 Mar 2014 18:32:15 GMT (envelope-from mat@svn.freebsd.org) Message-Id: <201403061832.s26IWFVk038473@svn.freebsd.org> From: Mathieu Arnold Date: Thu, 6 Mar 2014 18:32:15 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r44155 - head/en_US.ISO8859-1/books/porters-handbook/makefiles X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:32:16 -0000 Author: mat (ports committer) Date: Thu Mar 6 18:32:15 2014 New Revision: 44155 URL: http://svnweb.freebsd.org/changeset/doc/44155 Log: Update the Makefiles chapter. Sponsored by: Absolight Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Thu Mar 6 18:09:37 2014 (r44154) +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Thu Mar 6 18:32:15 2014 (r44155) @@ -56,6 +56,14 @@ You should set PORTNAME to the base name of your port, and PORTVERSION to the version number of the port. + + + Package name should be unique among all of the ports + tree, check that there is not already a port with the same + PORTNAME and if there is add one of PKGNAMEPREFIX + or PKGNAMESUFFIX. + @@ -302,7 +310,7 @@ PORTEPOCH= 1 - + <varname>PKGNAMEPREFIX</varname> and <varname>PKGNAMESUFFIX</varname> @@ -439,6 +447,14 @@ PORTEPOCH= 1 + + Package name should be unique among all of the ports + tree, check that there is not already a port with the same + PORTNAME and if there is add one of PKGNAMEPREFIX + or PKGNAMESUFFIX. + + Here are some (real) examples on how to convert the name as called by the software authors to a suitable package name: @@ -1470,7 +1486,9 @@ PORTEPOCH= 1 DISTNAME is the name of the port as called by the authors of the software. DISTNAME defaults to - ${PORTNAME}-${PORTVERSION}, so override it + ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}, + and DISTVERSION defaults to + ${PORTVERSION} so override it only if necessary. DISTNAME is only used in two places. First, the distribution file list (DISTFILES) defaults to @@ -1483,9 +1501,25 @@ PORTEPOCH= 1 ${PORTNAME}-${PORTVERSION}-scheme can be handled automatically by setting DISTVERSION. - PORTVERSION and DISTNAME - will be derived automatically, but can of course be - overridden. The following table lists some examples: + PORTVERSION will be derived from it + automatically. + + + Only one of PORTVERSION and + DISTVERSION can be set at a time. If you + set DISTVERSION and the derived + PORTVERSION is not right, do not use + DISTVERSION, set + PORTVERSION to the right value and set + DISTNAME with PORTNAME + with either some computation of + PORTVERSION or the verbatim upstream + version. + + + The following table lists some examples of + DISTVERSION and the derived + PORTVERSION: @@ -1525,7 +1559,7 @@ PORTEPOCH= 1 PKGNAMESUFFIX do not affect DISTNAME. Also note that if WRKSRC is equal to - work/${PORTNAME}-${PORTVERSION} while + work/${DISTNAME} while the original source archive is named something other than ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}, you should probably leave DISTNAME @@ -1558,22 +1592,20 @@ PORTEPOCH= 1 If the original tarball is part of one of the popular archives such as SourceForge, GNU, or Perl CPAN, you may be able refer to those sites in an easy compact form using - MASTER_SITE_* - (e.g., MASTER_SITE_SOURCEFORGE, - MASTER_SITE_GNU and - MASTER_SITE_PERL_CPAN). Simply set - MASTER_SITES to one of these variables and - MASTER_SITE_SUBDIR to the path within the - archive. Here is an example: + predefined macros (e.g., SF, + GNU or CPAN). Simply + set MASTER_SITES to one of these values. + Here is an example: - MASTER_SITES= ${MASTER_SITE_GNU} -MASTER_SITE_SUBDIR= make + MASTER_SITES= GNU/make - Or you can use a condensed format: + Or you can use the older expanded format, though there + really are no reason to do so: - MASTER_SITES= GNU/make + MASTER_SITES= ${MASTER_SITE_GNU} +MASTER_SITE_SUBDIR= make - These variables are defined in + These values and variables are defined in /usr/ports/Mk/bsd.sites.mk. There are new entries added all the time, so make sure to check the latest version of this file before submitting a port. @@ -1634,6 +1666,16 @@ MASTER_SITE_SUBDIR= stardict/WyabdcRealP + GH + /${GH_ACCOUNT}/${GH_PROJECT}/legacy.tar.gz/${GH_TAGNAME}?dummy=/ + + + + GHC + /downloads/${GH_ACCOUNT}/${GH_PROJECT}/ + + + GNOME /pub/GNOME/sources/${PORTNAME}/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} @@ -1644,12 +1686,27 @@ MASTER_SITE_SUBDIR= stardict/WyabdcRealP + HORDE + /pub/${PORTNAME} + + + + LOGILAB + /pub/${PORTNAME} + + + + MATE + /releases/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} + + + MOZDEV /pub/mozdev/${PORTNAME:L} - PERL_CPAN + CPAN /pub/CPAN/modules/by-module/${PORTNAME:C/-.*//} @@ -1764,7 +1821,8 @@ EXTRACT_ONLY= source.tar.gzDo not worry if the patches are compressed; they will be decompressed automatically if the filenames end with - .gz or .Z. + .Z, .gz, + .bz2 or .xz. If the patch is distributed with some other files, such as documentation, in a gzipped tarball, you @@ -3088,11 +3146,7 @@ LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/b OPTIONS_DEFINE= BAR BAR_DESC= Bar support -.include <bsd.port.options.mk> - -.if ${PORT_OPTIONS:MBAR} -LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar -.endif +BAR_LIB_DEPENDS= libbar.so:${PORTSDIR}/foo/bar Testing option variables is the correct method. It will @@ -3462,17 +3516,8 @@ BAR_DESC= Support feature bar OPTIONS_DEFAULT=FOO -.include <bsd.port.options.mk> - -.if ${PORT_OPTIONS:MFOO} -CONFIGURE_ARGS+=--with-foo -.else -CONFIGURE_ARGS+=--without-foo -.endif - -.if ${PORT_OPTIONS:MBAR} -RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar -.endif +FOO_CONFIGURE_WITH= foo +BAR_RUN_DEPENDS= bar:${PORTSDIR}/bar/bar .include <bsd.port.mk> @@ -3484,6 +3529,11 @@ RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar .if ! ${PORT_OPTIONS:MEXAMPLES} CONFIGURE_ARGS+=--without-examples .endif + + Though, you should use the following so that the + configure knob is really enabled and disabled when the + option is. + EXAMPLES_CONFIGURE_WITH= examples @@ -3507,22 +3557,12 @@ SSL_DESC= Build with OpenSSL support OPTIONS_DEFAULT= PGSQL LDAP SSL -.include <bsd.port.options.mk> +PGSQL_USE= pgsql=yes +PGSQL_CONFIGURE_WITH= postgres -.if ${PORT_OPTIONS:MPGSQL} -USE_PGSQL= yes -CONFIGURE_ARGS+= --with-postgres -.else -CONFIGURE_ARGS+= --without-postgres -.endif +ICU_LIB_DEPENDS= libicuuc.so:${PORTSDIR}/devel/icu -.if ${PORT_OPTIONS:MICU} -LIB_DEPENDS+= libicuuc.so:${PORTSDIR}/devel/icu -.endif - -.if ! ${PORT_OPTIONS:MEXAMPLES} -CONFIGURE_ARGS+= --without-examples -.endif +EXAMPLES_CONFIGURE_WITH= examples # Check other OPTIONS @@ -3559,9 +3599,9 @@ CONFIGURE_ARGS+= --without-examples There is no need to add these to - OPTIONS_DEFAULT. To have them show up - in the options selection dialog, however, they must be - added to OPTIONS_DEFINE. + OPTIONS_DEFAULT. To have them active, + and show up in the options selection dialog, however, they + must be added to OPTIONS_DEFINE. @@ -3598,12 +3638,8 @@ CONFIGURE_ARGS+= --enable-foo Correct Handling of an Option - .if ${PORT_OPTIONS:MFOO} -LIB_DEPENDS+= libfoo.so:${PORTSDIR}/devel/foo -CONFIGURE_ARGS+= --enable-foo -.else -CONFIGURE_ARGS+= --disable-foo -.endif + FOO_LIB_DEPENDS= libfoo.so:${PORTSDIR}/devel/foo +FOO_CONFIGURE_ENABLE= foo In the second example, the library libfoo is explicitly