From owner-freebsd-ports@FreeBSD.ORG Wed Mar 5 06:03:48 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49D08DD for ; Wed, 5 Mar 2014 06:03:48 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC2D07A0 for ; Wed, 5 Mar 2014 06:03:47 +0000 (UTC) Received: from [192.168.0.100] ([87.139.233.65]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LzYY2-1XFbRp1e9i-014guz; Wed, 05 Mar 2014 07:03:39 +0100 Message-ID: <5316BE3C.1000007@gmx.de> Date: Wed, 05 Mar 2014 07:03:40 +0100 From: olli hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: Staging - set owner/group/mode in pkg-plist for empty directory References: <20140304143052.GA22995@hiMolde.no> <5315FB56.3000601@gmx.de> <20140304224706.GA17997@hiMolde.no> In-Reply-To: <20140304224706.GA17997@hiMolde.no> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ngZh4VbE/J1iv75HLKxa91hB23quPEH1u2n1NaXbLnUgAHOLB60 HyZt5Nfx0WIzpMhr3ODHRWeoU/he/IbcDSJC2U5gngXPWP2myDAbkK/vkeW8Ms4Te/GUcSZ X+qR3hJQ8knRSKbZVUk/UP4bVDxKt9Fvydbc5MrPf5n2N8QDMs/Pz5DnyB8VaNUatfVeXyL KXFhndjHwMdWdrlTPwlAg== Cc: "Hans F. Nordhaug" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 06:03:48 -0000 On 2014-03-04 23:47, Hans F. Nordhaug wrote: > * olli hauer [2014-03-04]: >> On 2014-03-04 15:30, Hans F. Nordhaug wrote: >>> Hi, >>> >>> I'm trying to add staging to the Piwik port (at the same time as >>> updating to the new 2.1.0 release). AFAIK it's not possible to >>> set owner/group/mode for a directory in pkg-plist, only for files. >>> Is that correct? >>> >>> Piwik comes with an empty tmp directory that needs to be writable >>> by the webserver. Using CHMOD naivly in the post-install target >>> doesn't work. >>> >>> What is the correct work-around? >>> >>> Regards, >>> Hans >>> >>> PS! I can't test the port anymore with porttools ("port test"). >>> I always get: >>> >>> ------- >>> [...] >>> ===> Building package for piwik-2.1.0 >>> Creating package /usr/ports/www/piwik/work/piwik-2.1.0.tbz >>> Registering depends:. >>> pkg_create: couldn't resolve path for prefix: /tmp/piwik-2.1.0: No >>> such file or directory >>> *** [do-package] Error code 1 >>> >>> Stop in /usr/ports/www/piwik. >>> *** [package] Error code 1 >>> >>> Stop in /usr/ports/www/piwik. >>> ===> Error running make package >>> [...] >>> ------- >>> >>> Is this a known issue? I haven't upgraded to pkgng yet. >> >> >> Hi Hans, > > Hi, Olli. You sent your reply off the list, but I guess that was a > mistake so I'm sending this reply to the list. > >> I haven't used porttools once in my life, but I suspect in pkg-plist >> you miss %D/ as path prefix for the directory and in that case pkg >> creates the directory in your current working directory. > > No, that isn't the problem - several things has changed in the latest version. > >> This should work. >> @exec install -m 755 -o %%WWWOWN%% -g %%WWWGRP%% -d %D/%%WWWDIR%%/tmp >> @exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/tmp > > Thx, I ended up using "@exec chown ..." at the end pkg-plist. (The empty > directory is created so I don't need "@exec install".) > >> The following patch should work for your update >> http://people.freebsd.org/~ohauer/diffs/piwik-2.1.0.diff > > Thx, but I had already written the patch - I just needed the one > missing piece ("@exec chown ..."). I did however copy the option > changes you did - much clearer code. Thx! > > Regards, > Hans Hi Hans, the creation of the empty tmp directory is required for the old pkg_create tool, with the new ports-mgmt/pkg tools this is not required since it can handle empty directories. Since you haven't upgraded to pkgng yet, you can test this yourself by creating a package cleanup local/www and installing the package. $> cd www/piwik $> make clean package && make clean $> make deinstall $> rm -rf /usr/local/www/piwik $> pkg_add $path/to/new/piwik-2.1.0.tbz Now check if the directory is there. -- Regards, olli