From root@catv-50635cb6.catv.broadband.hu Fri Aug 4 16:52:04 2006 Return-Path: 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 Reply-To: Gabor Kovesdan To: FreeBSD-gnats-submit@freebsd.org Cc: Gabor Kovesdan Subject: [patch] Document DESTDIR support in porters-handbook X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 101365 >Category: docs >Synopsis: [patch] Document DESTDIR support in porters-handbook >Confidential: no >Severity: non-critical >Priority: medium >Responsible: pav >State: closed >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Aug 04 17:00:26 GMT 2006 >Closed-Date: Sun Aug 06 18:06:24 GMT 2006 >Last-Modified: Sun Aug 06 18:06:24 GMT 2006 >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: Responsible-Changed-From-To: freebsd-doc->pav Responsible-Changed-By: pav Responsible-Changed-When: Fri Aug 4 17:19:58 UTC 2006 Responsible-Changed-Why: This text will need some work. I'll try to fix it up over weekend. http://www.freebsd.org/cgi/query-pr.cgi?pr=101365 State-Changed-From-To: open->closed State-Changed-By: pav State-Changed-When: Sun Aug 6 18:05:26 UTC 2006 State-Changed-Why: A text based on your patch was committed to the Porter's Handbook. Note that I completely skipped the debate about OSVERSION retrieval. There was no mention of the exact mechanism how that value is obtained before, and I see no need to add a text about change in that. This kind of material should go to CHANGES instead. http://www.freebsd.org/cgi/query-pr.cgi?pr=101365 >Unformatted: