From acce41e322cf65789dbd70cc912fcae098e75a48 Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan Date: Sat, 8 Sep 2007 18:47:34 +0000 Subject: [PATCH] - Remove obsoleted pieces of info about DESTDIR and add some new description how it works now Reviewed by: linimon --- .../books/porters-handbook/book.sgml | 57 +++---------------- 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml index 6070ddb283..96220f284e 100644 --- a/en_US.ISO8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml @@ -8839,17 +8839,20 @@ as .putsy.conf and edit it. A port will actually install into DESTDIR/PREFIX, and register with the package database in DESTDIR/var/db/pkg. - It is very important to write ports that respect - DESTDIR. + As DESTDIR is handled automatically by the + ports infrastructure via calling &man.chroot.8;, you do not + need any modifications or any extra care to write + DESTDIR-compliant ports. The value of PREFIX will be set - to LOCALBASE_REL (default + to LOCALBASE (default /usr/local). If USE_X_PREFIX or USE_IMAKE is - set, PREFIX will be X11BASE_REL (default - /usr/X11R6). If + set, PREFIX will be X11BASE + (default LOCALBASE for compatibility reasons, + but it is going to be completely removed later). If USE_LINUX_PREFIX is set, PREFIX - will be LINUXBASE_REL (default + will be LINUXBASE (default /compat/linux). Avoiding the hard-coding of /usr/local or @@ -8900,48 +8903,6 @@ as .putsy.conf and edit it. -DPAGER=\"/usr/local/bin/less\". This way it will have a better chance of working if the system administrator has moved the whole /usr/local tree somewhere else. - - Note that LOCALBASE, - LINUXBASE, X11BASE, - DOCSDIR, EXAMPLESDIR, - DATADIR, DESKTOPDIR variables - already contain DESTDIR. Using - DESTDIR LOCALBASE is - wrong. Use LOCALBASE_REL, - LINUXBASE_REL, X11BASE_REL - if you need a variable relative to DESTDIR. - To keep things terse, TARGETDIR can be used to - replace DESTDIR PREFIX. - - Example of correct usage: - - post-install: - ${INSTALL_PROGRAM} ${WRKSRC}/helper ${TARGETDIR}/bin/helper - ${INSTALL_DATA} ${WRKSRC}/guide.txt ${DOCSDIR} - - When referencing dependencies in the port, the - LOCALBASE is used, as we are working with - dependencies inside the target environment. For hardcoding file - paths in the software, LOCALBASE_REL must - be used, because the software will run inside the target - environment. - - Example of correct usage: - - RUN_DEPENDS= ${LOCALBASE}/share/gonzo/launch.dat:${PORTSDIR}/games/gonzo - -post-patch: - @${REINPLACE_CMD} -e 's|/usr/gonzo/launch.dat|${LOCALBASE_REL}/share/gonzo/launch.dat}' ${WRKSRC}/main.c - @${REINPLACE_CMD} -e 's|/etc/game.conf|${PREFIX}/etc/game.conf|' ${WRKSRC}/loader.c - -post-install: - @${INSTALL_DATA} ${WRKSRC}/example/conf ${TARGETDIR}/etc/game.conf - - In packing lists and in pkg-* scripts, - %%LOCALBASE%%, %%LINUXBASE%% - and %%X11BASE%% expansions will contain paths - stripped of DESTDIR, as all these files are - processed of a context of target environment.