From owner-p4-projects@FreeBSD.ORG Thu Jul 13 14:06:44 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 19EAF16A4E9; Thu, 13 Jul 2006 14:06:44 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B37F716A4E2 for ; Thu, 13 Jul 2006 14:06:43 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B4A143D60 for ; Thu, 13 Jul 2006 14:06:42 +0000 (GMT) (envelope-from gabor@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6DE6gSC026651 for ; Thu, 13 Jul 2006 14:06:42 GMT (envelope-from gabor@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6DE6gOY026648 for perforce@freebsd.org; Thu, 13 Jul 2006 14:06:42 GMT (envelope-from gabor@FreeBSD.org) Date: Thu, 13 Jul 2006 14:06:42 GMT Message-Id: <200607131406.k6DE6gOY026648@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@FreeBSD.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 101467 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2006 14:06:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=101467 Change 101467 by gabor@gabor_spitfire on 2006/07/13 14:06:30 Add some explanation what DESTDIR is for and how to write DESTDIR-compliant ports. Affected files ... .. //depot/projects/soc2006/gabor_docs/porters-handbook/book.sgml#3 edit Differences ... ==== //depot/projects/soc2006/gabor_docs/porters-handbook/book.sgml#3 (text+ko) ==== @@ -4757,7 +4757,7 @@ USE_X_PREFIX - The port installs in X11BASE, not + The port installs in X11BASE_REL, not PREFIX. @@ -6778,17 +6778,33 @@ - <makevar>PREFIX</makevar> + <makevar>PREFIX</makevar> and <makevar>DESTDIR</makevar> + Firstly, you should completely unerstand what these two + variables are for. PREFIX determines the + location where all ports should install in the current environemt. + This is usually /usr/local, or + /opt in other operating systems. You + can set PREFIX to everything you want, See the + . This way it will have a better chance of working if the system administrator has moved the whole /usr/local tree somewhere else. + + For writing DESTDIR-compliant ports, note that + LOCALBASE, LINUXBASE, + X11BASE, DOCSDIR, + EXAMPLESDIR, DESKTOPDIR + variables already contain DESTDIR, so + DESTDIR/LOCALBASE is + definitely wrong, but you can use LOCALBASE_REL if + you need a variable relative to DESTDIR. + Similarly, you can use LINUXBASE_REL and + X11BASE_REL variables as well. + + You have to use these variables correctly + in your ports Makefile, esepecially in + custom targets, to ensure each files are installed to the + corect place. For dependencies, using LOCALBASE + is still correct, since we want to check for dependencies + in DESTDIR. If everything is correct, set + DESTDIR_READY to indicate that your port + is ready to be used with DESTDIR. + + In packing lists, or in pkg-* scripts you + can still use %%LOCALBASE%%, + %%LINUXBASE%% and %%X11BASE%% + expansions, since they represent relative paths here. This ambiguity + can be frustrating at first, but this actually simplifies the process + of writing DESTDIR-compliant ports. We did not use to + have DESTDIR support by our ports infrastructure, + and one of the major goals was to avoid modifying a tons of ports, + so we just changed LOCALBASE in the + infrastructure instead of changing that in tons of individual ports. + With a little workaround, LOCALBASE, + LINUXBASE and X11BASE + are still overrideable, though.