Subject: Re: First question
To: None <tech-pkg@netbsd.org>
From: Klaus Heinz <k.heinz.nov.zwei@onlinehome.de>
List: tech-pkg
Date: 11/12/2002 15:37:47
Diego Linke - GAMK wrote:

> The my make file is:

> DEPENDS+=       ncurses:../../devel/ncurses

You don't need to add a DEPENDS line for ncurses if you include the
appropriate buildlink2,mk file, as you do below (see also chapter 8/8.1
of pkgsrc/Packages.txt).

> DEPENDS+=       fping:../../net/fping

If you don't care which version of 'fping' is used, you must do it
like this:

  DEPENDS+=       fping-[0-9]*:../../net/fping

To quote one of the pkgsrc maintainers: 'Use Versions!',
:-)
  

> CFLAGS+=        -I${LOCALBASE}/include -L${LOCALBASE}/lib
> GNU_CONFIGURE=          YES
> USE_GMAKE=              YES
> USE_BUILDLINK2=         YES
> .include "../../devel/ncurses/buildlink2.mk"
> .include "../../mk/bsd.pkg.mk"

> I need that the flag -I${LOCALBASE}/include -L${LOCALBASE}/lib, either
> include in command cc.

As Jeremy Reed already wrote, setting or adding (as you do above) to the
CFLAGS variable only works if the Makefile system of the program you
want to compile accepts CFLAGS from the shell environment.

You can verify this by adding temporarily a line that says
'echo "CFLAGS is now: ${CFLAGS}"' to the main target's actions in the
program Makefile in the WRKSRC directory and try to 'make build' in the
pkgsrc directory for your package.
If that does not show the values you added above, then the other option
is to change the Makefile (or Makefile.in) directly by patching it
during the 'patch' stage of pkgsrc (see chapter 7.2 of Packages.txt).

I have installed pkgsrc/pkgtools/pkgdiff for this purpose, as
recommended by pkgsrc/Packages.txt. Using 'pkgvi' and 'mkpatches' it is
easy to produce the necessary patches.

I recommend to read pkgsrc/Packages.txt carefully. Although it does not
answer _all_ questions, it got me started on the right track.

ciao
     Klaus