On Sat, Mar 21, 2020 at 02:26:26PM +0530, [email protected] wrote:
> I'm have never tried the ports system before. 
> I have read through the faq and the man pages, 
> but I get stuck at building dependencies. 
> I follow through the fetch,checksum steps and then
> for 'make prepare' as local user, 
> I'm greeted with following message. 
> This is for the 'rsnapshot' package
> 
> ===>  Building package for rsync-3.1.3
> Create /usr/ports/packages/amd64/all/rsync-3.1.3.tgz
> Creating package rsync-3.1.3
> Link to /usr/ports/packages/amd64/ftp/rsync-3.1.3.tgz
> ===>  Cleaning for rsync-3.1.3
> ===>  Verifying specs: c
> ===>  found c.95.1
> ===>  Installing rsync-3.1.3 from /usr/ports/packages/amd64/all/
> pkg_add: pkg_add must be run as root
> *** Error 1 in /usr/ports/net/rsync 
> (/usr/ports/infrastructure/mk/bsd.port.mk:2028 
> '/var/db/pkg/rsync-3.1.3/+CONTENTS': @/usr/bin/env -i PKG...)
> *** Error 1 in /usr/ports/net/rsync 
> (/usr/ports/infrastructure/mk/bsd.port.mk:2451 'install')
> *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2135 
> '/usr/ports/pobj/rsnapshot-1.4.2/.dep-net-rsync')
> *** Error 1 in /usr/ports/net/rsnapshot 
> (/usr/ports/infrastructure/mk/bsd.port.mk:2451 'prepare')
> 
> I have successfully installed programs 
> with no dependencies using command
> 'doas make install' as the final step, 
> after fetch,patch,gen,configure,etc.
> Is this the right way?
> 
> Why doesn't a make install command as a local user
> while in 'net/rsnapshot' call doas on it's own?
> 

you should instruct ports infrastructure how to gain root's privileges. Else it
will just try "as it" (and fail if run as normal user).

as you are using doas(1), you should add
        SUDO = doas

in your /etc/mk.conf file.

And after that, running "make install" (as user), will automatically invoke
pkg_add(8) with doas(1). So you don't have to run "doas make install", but only
"make install".

you could see mk.conf(5) and bsd.port.mk(5) man pages for more details.

Thanks.
-- 
Sebastien Marie

Reply via email to