Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 May 2014 12:48:28 +0100 (BST)
From:      Anton Shterenlikht <mexas@bris.ac.uk>
To:        freebsd-ports@freebsd.org, matthias.andree@gmx.de
Subject:   Re: staging without root privileges
Message-ID:  <201405141148.s4EBmSJx020629@mech-cluster241.men.bris.ac.uk>
In-Reply-To: <53727AA1.8050201@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405141148.s4EBmSJx020629>