From owner-freebsd-ports@FreeBSD.ORG Wed May 14 11:49:00 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 88D32342 for ; Wed, 14 May 2014 11:49:00 +0000 (UTC) Received: from eu1sys200aog110.obsmtp.com (eu1sys200aog110.obsmtp.com [207.126.144.129]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D39F0276F for ; Wed, 14 May 2014 11:48:59 +0000 (UTC) Received: from mail-wi0-f173.google.com ([209.85.212.173]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKU3NYDz7wn3YtFs5HRsSnmyxkFUbR3hut@postini.com; Wed, 14 May 2014 11:48:59 UTC Received: by mail-wi0-f173.google.com with SMTP id bs8so7859912wib.0 for ; Wed, 14 May 2014 04:48:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:message-id:to:subject:reply-to :in-reply-to; bh=tM0qjGx2RqrnvCVF17K2mjLqMiUj4NLGTO0VyO5WrCo=; b=KthrUX3KJ19BC6DpNQQ83FH8ablXtxQ3zYM6T0PRkH9/4xGp3g8jzjjhco4ngaRD9M gG3AGi/q83kno555lykrQsICL70qdKMMinBtX9LSNQZFugnBK+hMfAxa/0gnkOpzJoF/ p735O+mgYx8yJJV+evvuEyNXw3jtMi2yHCjQVHfHdlqP05X5IdpL2yB+ekPkokmjo9cz E7NnieM24A3EXMDQ9rt/YlPJyQiYTFQLZalu8ywS97CdcZMfyd0wjMCOck4gj8ZHPRMX eOAmA66JjFMe0ktDEoTv5zR7dfYvMRQnqsh0wQF+Az0v4iT8+xOIiQ2NxUZJR4NWcgN9 7ycg== X-Gm-Message-State: ALoCoQlN4T+GJ3Tbra0+ZSPQG4/s70PoPD1wGlI8eR6HfPSe30CjN10bpUBQToOI/qIcdvODCjAf51n31sQ2TJwuDiU+D+7BR1gNUWGitbocA5yjAxxZ2IcUQA+dCOX3nEjowzoMSiGk6wTnGBBWWUL5w65kRHpKLg== X-Received: by 10.194.219.164 with SMTP id pp4mr2696333wjc.19.1400068110546; Wed, 14 May 2014 04:48:30 -0700 (PDT) X-Received: by 10.194.219.164 with SMTP id pp4mr2696327wjc.19.1400068110470; Wed, 14 May 2014 04:48:30 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (mech-cluster241.men.bris.ac.uk. [137.222.187.241]) by mx.google.com with ESMTPSA id z19sm12760324wiu.0.2014.05.14.04.48.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 May 2014 04:48:29 -0700 (PDT) Sender: Anton Shterenlikht Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8) with ESMTP id s4EBmSX3020630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 May 2014 12:48:28 +0100 (BST) (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8/Submit) id s4EBmSJx020629; Wed, 14 May 2014 12:48:28 +0100 (BST) (envelope-from mexas) Date: Wed, 14 May 2014 12:48:28 +0100 (BST) From: Anton Shterenlikht Message-Id: <201405141148.s4EBmSJx020629@mech-cluster241.men.bris.ac.uk> To: freebsd-ports@freebsd.org, matthias.andree@gmx.de Subject: Re: staging without root privileges Reply-To: mexas@bris.ac.uk In-Reply-To: <53727AA1.8050201@gmx.de> X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:49:00 -0000 >Am 13.05.2014 19:18, schrieb Anton Shterenlikht: >> https://wiki.freebsd.org/ports/StageDir >> says >> >> Make sure you tested make package as a normal user (not root). >> >> Does this refer specifically to the package target? > >build targets ("make all", "make stage", "make check-plist") and >packaging ("make package"). > >> Or to all targets up to and including package? >> >> I'm asked for root passwd on make config, >> and then I get an error on build: >> >> mkdir: /usr/ports/devel/robodoc/work: Permission denied >> >> which makes sense. > >Setting WRKDIRPREFIX to a directory you can write to can fix that, and >PACKAGES specifies where the package should end up. PORT_DBDIR can be >diverted to a directory so you can run even "make config" without root >privileges. > >With that, and the distfiles already downloaded ("make checksum"), you >should be able to build most ports without privileges. A few set >NEED_ROOT, those won't do without... Ok, thanks, so I'm building with: make WRKDIRPREFIX=/tmp PACKAGES=/tmp all check-stage package and get to: ===> Staging for slatec-4.1_2 ===> slatec-4.1_2 depends on executable: gfortran47 - found ===> Generating temporary packing list install -C -o root -g wheel -m 444 libslatec.a /tmp/usr/ports/math/slatec/work/stage/usr/local/lib install: /tmp/usr/ports/math/slatec/work/stage/usr/local/lib/libslatec.a: chown/chgrp: Operation not permitted *** Error code 71 I guess I need to refer to this point of the staging wiki: Replace commands like ${CHMOD} ... and ${INSTALL_PROGRAM} -m mode -o user -g group with corresponding pkg-plist entries: @mode mode, @owner user, @group group. /!\ These operators work until being overridden, so do not forget to reset them with @mode, @owner root, @group wheel keywords afterwards. To set specific mode/user/group for a directory, use these operators before @dirrm(try) directory. For pkg_tools compatibility add: @exec install -d -o user -g group -m mode %D/directory. However, I don't have pkg-plist for this port, it only installs 5 or 6 files. CAn I set this in the Makefile? I have: PLIST_FILES= lib/libslatec.a lib/libslatec.so lib/libslatec.so.${SHLIB_MAJOR} PORTDOCS= guide toc Thanks Anton