From owner-freebsd-doc@FreeBSD.ORG Fri Aug 4 17:00:34 2006 Return-Path: X-Original-To: freebsd-doc@hub.freebsd.org Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5199F16A5C4 for ; Fri, 4 Aug 2006 17:00:34 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE8DC43D69 for ; Fri, 4 Aug 2006 17:00:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k74H0VWQ035830 for ; Fri, 4 Aug 2006 17:00:31 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k74H0VoA035829; Fri, 4 Aug 2006 17:00:31 GMT (envelope-from gnats) Resent-Date: Fri, 4 Aug 2006 17:00:31 GMT Resent-Message-Id: <200608041700.k74H0VoA035829@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gabor Kovesdan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13C2916A4DA; Fri, 4 Aug 2006 16:52:04 +0000 (UTC) (envelope-from root@catv-50635cb6.catv.broadband.hu) Received: from catv-50635cb6.catv.broadband.hu (catv-50635cb6.catv.broadband.hu [80.99.92.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32DC943D45; Fri, 4 Aug 2006 16:52:03 +0000 (GMT) (envelope-from root@catv-50635cb6.catv.broadband.hu) Received: by catv-50635cb6.catv.broadband.hu (Postfix, from userid 0) id AB8F628A0C3; Fri, 4 Aug 2006 18:52:02 +0200 (CEST) Message-Id: <20060804165202.AB8F628A0C3@catv-50635cb6.catv.broadband.hu> Date: Fri, 4 Aug 2006 18:52:02 +0200 (CEST) From: Gabor Kovesdan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Gabor Kovesdan Subject: docs/101365: [patch] Document DESTDIR support in porters-handbook X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gabor Kovesdan List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 17:00:34 -0000 >Number: 101365 >Category: docs >Synopsis: [patch] Document DESTDIR support in porters-handbook >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Aug 04 17:00:26 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Gabor Kovesdan >Release: FreeBSD 6.1-STABLE i386 >Organization: n/a >Environment: System: FreeBSD spitfire 6.1-STABLE FreeBSD 6.1-STABLE #0: Sat Jul 29 18:31:18 CEST 2006 gabor@spitfire:/usr/src/sys/i386/compile/SPITFIRE i386 >Description: Document the recently added DESTDIR support. >How-To-Repeat: >Fix: --- porters-handbook.diff begins here --- Index: book.sgml =================================================================== RCS file: /usr/cvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v retrieving revision 1.740 diff -u -r1.740 book.sgml --- book.sgml 3 Aug 2006 19:01:34 -0000 1.740 +++ book.sgml 4 Aug 2006 16:49:21 -0000 @@ -3942,6 +3942,18 @@ There are some more things you have to take into account when you create a port. This section explains the most common of those. + + Building in jails + + Note, that the behavior of OSVERSION has been + changed recently. Now, it gets the __FreeBSD_version + from the userland, since it makes more sense for the ports, than the + kernel. You can still override it, if you really have to get it from + the kernel. + + + Shared Libraries @@ -4758,7 +4770,7 @@ USE_X_PREFIX - The port installs in X11BASE, not + The port installs in X11BASE_REL, not PREFIX. @@ -6779,17 +6791,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, DATADIR, + 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. + PREFIX is an absolute path. but relative + to DESTDIR. If you want to refer to the + fully qualified destination you can use TARGETDIR, + which resolves to DESTDIR/PREFIX. + + 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. + + In packing lists, or in pkg-* scripts you + can still use %%LOCALBASE%%, + %%LINUXBASE%% and %%X11BASE%% + expansions, since they represent relative paths there. 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. --- porters-handbook.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: