package creation failure

Charles Musser cmusser at
Thu Oct 1 19:05:23 PDT 2015

> Nobody at all uses sudo.  The pkg program handles ownership and
> automatically.  The "install" macros set the right permissions.
> You should take a momemt and go through the porters handbook on the
> FreeBSD site.  Everything is pretty well documented.
The various steps are now working without sudo now.

I found references to the DISTDIR and WRKDIR variables, which 
define the directories I needed to be writable by non-root (but aren't,
in the stock locations). I created the appropriate directories, set those
variables via the environment and ran the various make targets 
(makesum, stage, package) without sudo. That succeeded. I'm 
assuming this is how most port maintainers go about their business.

One change I did need to make in my source Makefile was not using 
install(1) in its "install" target. I'd assumed that would be a good idea,
because it allows specifying the user and group (root:wheel). But it
isn't permitted when non-root, so "make stage" failed. As you mention,
pkg (or something it uses) takes care of moving things into the final install
directory with the appropriate permissions/ownership. As such, the source
Makefile's "install" target simply needed to use cp(1).


More information about the Users mailing list