Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Aug 2016 17:03:13 +0200
From:      =?utf-8?Q?Martin_Waschb=C3=BCsch?= <martin@waschbuesch.de>
To:        Mathieu Arnold <mat@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: questions about Makefile
Message-ID:  <4DB836A4-6E10-4AAA-8F9A-683FA72534B7@waschbuesch.de>
In-Reply-To: <466E8D27808DEDCCA467EE3A@atuin.in.mat.cc>
References:  <0506A35B-3E3C-47D9-898F-2C61C89F4898@waschbuesch.de> <466E8D27808DEDCCA467EE3A@atuin.in.mat.cc>

next in thread | previous in thread | raw e-mail | index | archive | help

> Am 14.08.2016 um 15:37 schrieb Mathieu Arnold <mat@FreeBSD.org>:
>=20
> +--On 13 ao=C3=BBt 2016 10:34:27 +0200 Martin Waschb=C3=BCsch
> <martin@waschbuesch.de> wrote:
> | Hi all,
> |=20
> | I am in the process of creating a port for a module / plugin for
> | net-mgmt/zabbix-agent.
> |=20
> | I tried to follow the Porter's Handbook, but still have three items =
I am
> | uncertain about:
> |=20
> | 1) The plugin (obviously) relies on the zabbix-agent sources.
> | I added
> |=20
> | BUILD_DEPENDS=3D	${NONEXISTENT}:net-mgmt/zabbix3-agent:extract
> |=20
> | to make sure that the sources will always be extracted.
>=20
> You should use :patch, so that the sources are properly patched for =
FreeBSD.

Indeed! Thanks.

> | Now, how do I
> | properly reference these sources in my port? What I have right now =
(just
> | to make it compile) is this:
> |=20
> | CONFIGURE_ARGS=3D
> | 	=
--with-zabbix=3D${PORTSDIR}/net-mgmt/zabbix3-agent/work/zabbix-3.0.2
> |=20
> | Obviously, I'd want to somehow get that path without having to =
specify
> | the version number as I want to build against the version currently
> | available in ports. How do I do that? Is there any reference to =
something
> | like this in the handbook?
>=20
> That doesn't work because:
>=20
> 1) the base directory of a workdir is changeable with WRKDIRPREFIX
> 2) If zabbix gets updated, it breaks.
>=20
> you have to use something like:
>=20
> ZABBIX_WRKSRC!=3D  cd ${.CURDIR:H:H}/net-mgmt/zabbix3-agent && make -V =
WRKSRC

I'll give that a try.

> | 2) Imagine this module could be compiled against both, zabbix2-agent =
and
> | zabbix3-agent. I guess the cleanest way to support this would be =
having
> | one port per zabbix-version? If that is the case, should the whole =
thing
> | perhaps be a slave port belonging to zabbix{2,3}-agent?
> |=20
> | 3) I found that I cannot (as a normal user) successfully run 'make
> | package'. I get an error like this:
> | mkdir: /usr/ports/net-mgmt/foobar/work: Permission denied
> | Before I add 'NEED_ROOT=3Dyes' to the Makefile, are there =
requirements for
> | a normal user to build ports? e.g. does said user have to be in a =
certain
> | group, etc.? I mean, every port will have to create a workdir, and I
> | cannot imagine every port as having 'NEED_ROOT=3Dyes' in their =
Makefile...
> | ;-)
>=20
> Well, your user needs to be able to write, so, either checkout a ports =
tree
> in your home directory, and set PORTSDIR accordingly, or chown -R
> /usr/ports to your user, or set WRKDIRPREFIX to somewhere your user =
can
> write, for example /tmp.

Thank you very much, Mathieu! This is very very helpful.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DB836A4-6E10-4AAA-8F9A-683FA72534B7>