From owner-freebsd-ports@freebsd.org Sun Aug 14 15:03:23 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E113ABBA85C for ; Sun, 14 Aug 2016 15:03:23 +0000 (UTC) (envelope-from martin@waschbuesch.de) Received: from relay.waschbuesch.it (relay.waschbuesch.it [IPv6:2a00:cba0:0:100::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.waschbuesch.it", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A23581EA7; Sun, 14 Aug 2016 15:03:23 +0000 (UTC) (envelope-from martin@waschbuesch.de) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=waschbuesch.de; s=dkim; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dufidrQUHgdYLxJCIgsIDkdVRwuKtqrlfYRqFqj1StU=; b=UgggKntfzukXbR5Rmcq3hOWYk 08OX6PGL/CgjbdBQo0ut9JyHMHS+INvEFSinPY/cLknDokWoonOSpPI+/e4eLl68UwHVBsFyGpO0c MrxToWQ0FMCD+jWWLrWd/ofUpb2Dff9edT5nrInwid1rhzOEMt8X1Kktv43oocKj8RIDk=; Received: by relay.waschbuesch.it with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim) (envelope-from ) id 1bYwwT-000O40-5P; Sun, 14 Aug 2016 15:03:13 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: questions about Makefile From: =?utf-8?Q?Martin_Waschb=C3=BCsch?= In-Reply-To: <466E8D27808DEDCCA467EE3A@atuin.in.mat.cc> Date: Sun, 14 Aug 2016 17:03:13 +0200 Cc: freebsd-ports@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4DB836A4-6E10-4AAA-8F9A-683FA72534B7@waschbuesch.de> References: <0506A35B-3E3C-47D9-898F-2C61C89F4898@waschbuesch.de> <466E8D27808DEDCCA467EE3A@atuin.in.mat.cc> To: Mathieu Arnold X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2016 15:03:24 -0000 > Am 14.08.2016 um 15:37 schrieb Mathieu Arnold : >=20 > +--On 13 ao=C3=BBt 2016 10:34:27 +0200 Martin Waschb=C3=BCsch > 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.=