Bug 208018 - [MAINTAINER][PATCH] sysutils/dsbmd: Make port build as non-root user
Summary: [MAINTAINER][PATCH] sysutils/dsbmd: Make port build as non-root user
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords: easy, patch
Depends on:
Blocks:
 
Reported: 2016-03-15 09:31 UTC by Marcel Kaiser
Modified: 2016-03-31 20:00 UTC (History)
1 user (show)

See Also:


Attachments
Patch to build port as non-root user. (800 bytes, patch)
2016-03-15 09:31 UTC, Marcel Kaiser
no flags Details | Diff
Poudriere build log (10.2R, i386, non-root) (11.08 KB, text/plain)
2016-03-15 09:38 UTC, Marcel Kaiser
no flags Details
Poudriere build log (10.1R, i386, non-root) (11.09 KB, text/plain)
2016-03-15 09:39 UTC, Marcel Kaiser
no flags Details
Poudriere build log (9.3R, i386, non-root) (11.31 KB, text/plain)
2016-03-15 09:40 UTC, Marcel Kaiser
no flags Details
Patch for new version (0.1.3) of sysutils/dsbmd (714 bytes, patch)
2016-03-31 14:23 UTC, Marcel Kaiser
no flags Details | Diff
Poudriere build log (10.2R, i386, non-root) (11.11 KB, text/plain)
2016-03-31 14:24 UTC, Marcel Kaiser
no flags Details
Poudriere build log (10.1R, i386, non-root) (11.08 KB, text/plain)
2016-03-31 14:26 UTC, Marcel Kaiser
no flags Details
Poudriere build log (9.3R, i386, non-root) (11.33 KB, text/plain)
2016-03-31 14:27 UTC, Marcel Kaiser
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 2016-03-31 20:00:31 UTC
(In reply to Marcel Kaiser from comment #5)

No worries, thanks for the updated patch!