Bug 208018

Summary: [MAINTAINER][PATCH] sysutils/dsbmd: Make port build as non-root user
Product: Ports & Packages Reporter: Marcel Kaiser <mk>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Only Me CC: riggs
Priority: --- Keywords: easy, patch
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to build port as non-root user.
none
Poudriere build log (10.2R, i386, non-root)
none
Poudriere build log (10.1R, i386, non-root)
none
Poudriere build log (9.3R, i386, non-root)
none
Patch for new version (0.1.3) of sysutils/dsbmd
none
Poudriere build log (10.2R, i386, non-root)
none
Poudriere build log (10.1R, i386, non-root)
none
Poudriere build log (9.3R, i386, non-root) none

Description Marcel Kaiser 2016-03-15 09:31:55 UTC
Created attachment 168229 [details]
Patch to build port as non-root user.

This patch makes the port build as non-root user. Because of the install options
'-o root -g wheel' in the distfiles Makefile, building as non-root user will
fail.
Comment 1 Marcel Kaiser 2016-03-15 09:38:16 UTC
Created attachment 168230 [details]
Poudriere build log (10.2R, i386, non-root)
Comment 2 Marcel Kaiser 2016-03-15 09:39:09 UTC
Created attachment 168231 [details]
Poudriere build log (10.1R, i386, non-root)
Comment 3 Marcel Kaiser 2016-03-15 09:40:30 UTC
Created attachment 168232 [details]
Poudriere build log (9.3R, i386, non-root)
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2016-03-28 14:18:10 UTC
Why do you redefine macros that are defined in the ports build framework already instead of simply using them? And why using different modes? What is the advantage of installing scripts and programs with mode 0755 instead of 0555 as the ports framework does?

Have a look at the output of:
> make -C /usr/ports/sysutils/dsbmd -V MAKE_ENV

The macros BSD_INSTALL_* are already defined and ready to use in your Makefile. So you could do something like
[...]
INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM}
[...]
hence ensuring that you pass the appropriate macros to your Makefile.
Comment 5 Marcel Kaiser 2016-03-31 14:17:30 UTC
Hi Thomas,

thank you for the support.

I was about to release a new version, and so I took the opportunity to
change the Makefile regarding your advice.


(In reply to Thomas Zander from comment #4)

> Why do you redefine macros that are defined in the ports build framework
> already instead of simply using them? And why using different modes?

Well, I'm a fool. I wasn't aware of MAKE_ENV. I should have looked at
bsd.ports.mk more closely.

> What is the advantage of installing scripts and programs with mode 0755
> instead of 0555 as the ports framework does?

There are no advantages of using the mode 0755, it's just a standard mode I
defined in a Makefile, and used it since then. I'm absolutely happy with 555.
Comment 6 Marcel Kaiser 2016-03-31 14:23:13 UTC
Created attachment 168822 [details]
Patch for new version (0.1.3) of sysutils/dsbmd

Updates sysutils/dsbmd to version 0.1.3, fixes non-root staging
Comment 7 Marcel Kaiser 2016-03-31 14:24:47 UTC
Created attachment 168823 [details]
Poudriere build log (10.2R, i386, non-root)
Comment 8 Marcel Kaiser 2016-03-31 14:26:12 UTC
Created attachment 168824 [details]
Poudriere build log (10.1R, i386, non-root)
Comment 9 Marcel Kaiser 2016-03-31 14:27:46 UTC
Created attachment 168825 [details]
Poudriere build log (9.3R, i386, non-root)
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-03-31 19:58:23 UTC
A commit references this bug:

Author: riggs
Date: Thu Mar 31 19:57:49 UTC 2016
New revision: 412295
URL: https://svnweb.freebsd.org/changeset/ports/412295

Log:
  Update to upstream version 0.1.3; fix staging as non-root user

  PR:		208018
  Submitted by:	mk@nic-nac-project.org (maintainer)

Changes:
  head/sysutils/dsbmd/Makefile
  head/sysutils/dsbmd/distinfo
Comment 11 Thomas Zander freebsd_committer freebsd_triage 2016-03-31 20:00:31 UTC
(In reply to Marcel Kaiser from comment #5)

No worries, thanks for the updated patch!