From owner-freebsd-ports@freebsd.org Sun Aug 14 14:37:12 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 D265CBBA09B for ; Sun, 14 Aug 2016 14:37:12 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from prod2.absolight.net (prod2.absolight.net [79.143.243.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "plouf.absolight.net", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 88BCE115F for ; Sun, 14 Aug 2016 14:37:12 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from prod2.absolight.net (localhost [127.0.0.1]) by prod2.absolight.net (Postfix) with ESMTP id 9ED45BDCAC; Sun, 14 Aug 2016 16:37:10 +0200 (CEST) Received: from atuin.in.mat.cc (wireless3.caths.cam.ac.uk [131.111.225.6]) by prod2.absolight.net (Postfix) with ESMTPA id 58718BDC77; Sun, 14 Aug 2016 16:37:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by atuin.in.mat.cc (Postfix) with ESMTP id E3E3C66A06D2; Sun, 14 Aug 2016 15:37:09 +0100 (BST) Date: Sun, 14 Aug 2016 15:37:09 +0200 From: Mathieu Arnold To: =?UTF-8?Q?Martin_Waschb=C3=BCsch?= , freebsd-ports@freebsd.org Subject: Re: questions about Makefile Message-ID: <466E8D27808DEDCCA467EE3A@atuin.in.mat.cc> In-Reply-To: <0506A35B-3E3C-47D9-898F-2C61C89F4898@waschbuesch.de> References: <0506A35B-3E3C-47D9-898F-2C61C89F4898@waschbuesch.de> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="==========DCDB310F3CC08ED4F32C==========" 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 14:37:12 -0000 --==========DCDB310F3CC08ED4F32C========== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline +--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. You should use :patch, so that the sources are properly patched for = FreeBSD. | 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? That doesn't work because: 1) the base directory of a workdir is changeable with WRKDIRPREFIX 2) If zabbix gets updated, it breaks. you have to use something like: ZABBIX_WRKSRC!=3D cd ${.CURDIR:H:H}/net-mgmt/zabbix3-agent && make -V = WRKSRC | 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... | ;-) 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. --=20 Mathieu Arnold --==========DCDB310F3CC08ED4F32C========== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQJ8BAEBCgBmBQJXsIIVXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzQUI2OTc4OUQyRUQxMjEwNjQ0MEJBNUIz QTQ1MTZGMzUxODNDRTQ4AAoJEDpFFvNRg85Iq7MP/jwdkDzjPuAWhhxvC1ZtfdL1 v4DOa4QWQGYzQyZHe7bxdwJtAZPV2D4b7rCgmcuPORnxy+jdrYLcGRj53i9heXX3 Cm/0wbz7YjmXNXpcORPpc2vH4NYx6AP0FtW5MgSlfxuXnofSLncljmnHDptE6JU6 04mpAgfSSDoplP0JRurU7JDNxiUuzvi4T5mlL30kfVCxZ3egxyCcwXVaPYdgtSdA GjZILe/s1nsyfqlznEsABMRk65mQM0SMLhK/1iLTFXFVcfVaAlF5LmBzL2FiqXAS U5VjZudrIY9qC6ewUSjEe8G26H+Xs5nc39qX49fEcqUfIBhNA2FCfJFa2UcWprck WCHKa2HOXHaW8tGTXF25fmV8mHK1EYniY5a89XjqxI1uRVWqva9PL4II131Th79Q Wu7c8Am+4wTerHHaYSwgH6VwEMUOVZI6V+bSNcOHJfHU5M8Zbws9r+e05vTkQJAX ZnTwKXuouOF1nvh4oU+ou0eCc4rbpcgPpm4uay4dUZ5r47/HPALDgjs2ukDs723D GeBCNbrhQO1R2mfWW54SCEezFBLgA4GY3QtSCu4Fx5Yq5b+ojg2lTozku3upnu5T NdpWct2VeF4HDT/JuX/Cm12wu/PbaSBmXpqRzMjyvTFC7DuBSjexmrF6g/o+Ii3l vwlkaS3b4KsNdn2L1wZH =0bnp -----END PGP SIGNATURE----- --==========DCDB310F3CC08ED4F32C==========--