First time porter seeks guidance on 'make package' (as user)

Mathieu Arnold mat at FreeBSD.org
Tue Jan 9 08:26:08 UTC 2018


Le 09/01/2018 à 04:22, Yuri a écrit :
> On 01/08/18 12:46, James E Keenan wrote:
>> Can someone offer guidance as to how to proceed? 
>
>
> As a root:
>
> 1. Check out the ports tree: svn checkout
> https://svn.FreeBSD.org/ports/head /usr/ports (if you don't have it
> checked out yet)
>
> 2. Change the ports tree to your user: chown -R {username}:users
> /usr/ports
>
> 3. Install sudo: pkg install sudo
>
> 4. Add yourself to sudoers: /usr/local/etc/sudoers (alternatively, add
> yourself to the 'wheel' group and enable '%wheel ALL=(ALL) ALL' in the
> sudoers file)
>
> 5. Add these 2 lines to sudoers:
>
> Defaults        env_reset,timestamp_timeout=240
> Defaults        !tty_tickets
>
> 6. In /etc/make.conf: add the line 'SU_CMD= /usr/local/bin/sudo -E sh -c'
>
> As your own user:
>
> 7. Go into any port directory: cd /usr/ports/{category}/{portdir}
>
> 8. commands like 'make makesum', 'make install', 'make package', 'make
> clean' will only require your password once in 4 hours
>
> You can download tarballs, build, install, uninstall, build packages,
> all without typing in your password more often than once in 240 minutes.
>
> Using this method, you never need to do anything as a root again
> within the ports tree.

What an insanely long and complicated method. As your own user:

1. checkout the ports tree in your home: svn checkout
https://svn.FreeBSD.org/ports/head $HOME/ports
(or where-ever you want it)

2. Then, either add PORTSDIR=$HOME/ports to your environment, or as
root, edit /etc/make.conf and add:

.if ${USER:U} == youruser
PORTSDIR=$HOME/ports
.endif

There, no need to do anything else, except setup poudriere to use this
ports tree, as root too:
poudriere ports -c -p default -m null -M /home/youruser/ports

-- 
Mathieu Arnold


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20180109/8c0d4545/attachment.sig>


More information about the freebsd-ports mailing list