Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Nov 2017 03:33:07 +0800
From:      blubee blubeeme <gurenchan@gmail.com>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   flexible ports
Message-ID:  <CALM2mEmoFOCcdHzERQMgWw_WjHUkB-_Ln0O=OKwwbWO2_OgURQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
There's this section in the porters handbook:
https://www.freebsd.org/doc/en/books/porters-handbook/porting-prefix.html

this line of code just never seems to work

I've tried not only on the ports that I am testing but many simpler ports
all around the ports tree and they always fail because they're missing
something.

Can someone explain this:
make clean; make package PREFIX=3D/var/tmp/`make -V PORTNAME`

I mean I understand it's trying to make a package of x port in a tmp
directory but how could you actually get this type of tests to pass?

The value of PREFIX will be set to LOCALBASE (defaulting to /usr/local). If
USE_LINUX_PREFIX is set, PREFIX will be LINUXBASE (defaulting to
/compat/linux).

Avoiding hard-coded /usr/local paths in the source makes the port much more
flexible and able to cater to the needs of other sites. Often, this can be
accomplished by replacing occurrences of /usr/local in the port's various
Makefiles with ${PREFIX}. This variable is automatically passed down to
every stage of the build and install processes.

Make sure the application is not installing things in /usr/local instead of
PREFIX. A quick test for such hard-coded paths is:

% make clean; make package PREFIX=3D/var/tmp/`make -V PORTNAME`

If anything is installed outside of PREFIX, the package creation process
will complain that it cannot find the files.

In addition, it is worth checking the same with the stage directory support
(see Section 6.1, =E2=80=9CStaging=E2=80=9D
<https://www.freebsd.org/doc/en/books/porters-handbook/special.html#staging=
>
):

% make stage && make check-plist && make stage-qa && make package


   -

   check-plist checks for files missing from the plist, and files in the
   plist that are not installed by the port.
   -

   stage-qa checks for common problems like bad shebang, symlinks pointing
   outside the stage directory, setuid files, and non-stripped libraries...

These tests will not find hard-coded paths inside the port's files, nor
will it verify that LOCALBASE is being used to correctly refer to files
from other ports. The temporarily-installed port in /var/tmp/`make -V
PORTNAME` must be tested for proper operation to make sure there are no
problems with paths.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALM2mEmoFOCcdHzERQMgWw_WjHUkB-_Ln0O=OKwwbWO2_OgURQ>