Bug 191797

Summary: mail/dspam-devel: installed binary owned by root regardless of specified DSPAM_OWNER
Product: Ports & Packages Reporter: Raivo Hool <raivo>
Component: Individual Port(s)Assignee: Rene Ladan <rene>
Status: Closed FIXED    
Severity: Affects Only Me CC: rene
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
set owner/group/mode
none
fix installation of bin/dspam none

Description Raivo Hool 2014-07-10 22:22:19 UTC
Some changes in mail/dspam-devel broke the expected behaviour that /usr/local/bin/dspam be owned by the user specified as DSPAM_OWNER in make.conf or elsewhere. The configure script picks it up:

DSPAM_OWNER=vmail (default: root)

From config.log:

./configure --sysconfdir=/usr/local/etc --with-logdir=/var/log/dspam --with-dspam-home=/var/db/dspam --with-dspam-home-owner=vmail --with-dspam-home-group=mail --with-dspam-home-mode=0770 --with-dspam-owner=vmail [cut]

Yet the installed binary invariably belongs to root.
Comment 1 John Marino freebsd_committer 2014-07-11 07:50:46 UTC
I'm passing this to rene@ who staged this unmaintained port
Comment 2 Rene Ladan freebsd_committer 2014-07-14 13:29:41 UTC
Created attachment 144653 [details]
set owner/group/mode
Comment 3 Rene Ladan freebsd_committer 2014-07-14 13:30:23 UTC
Can you try the patch I created which should fix setting the owner/group/mode with pkg(8) ?
Comment 4 commit-hook freebsd_committer 2014-07-14 15:35:01 UTC
A commit references this bug:

Author: rene
Date: Mon Jul 14 15:34:48 UTC 2014
New revision: 361790
URL: http://svnweb.freebsd.org/changeset/ports/361790

Log:
  - Fix pkg installation where the dspam user/group/ are non-default.
  - Bump PORTREVISION
  PR:		191797
  Submitted by:	raivo.hool@gmail.com
  MFH:		2014Q3

Changes:
  head/mail/dspam-devel/Makefile
  head/mail/dspam-devel/pkg-plist
Comment 5 Rene Ladan freebsd_committer 2014-07-14 15:36:05 UTC
Fixed in r361790
Comment 6 commit-hook freebsd_committer 2014-07-14 16:10:05 UTC
A commit references this bug:

Author: rene
Date: Mon Jul 14 16:09:59 UTC 2014
New revision: 361795
URL: http://svnweb.freebsd.org/changeset/ports/361795

Log:
  MFH: r361790

  - Fix pkg installation where the dspam user/group/ are non-default.
  - Bump PORTREVISION
  PR:		191797
  Submitted by:	raivo.hool@gmail.com

  Approved by:	portmgr (erwin)

Changes:
_U  branches/2014Q3/
  branches/2014Q3/mail/dspam-devel/Makefile
  branches/2014Q3/mail/dspam-devel/pkg-plist
Comment 7 Raivo Hool 2014-07-14 18:29:19 UTC
Sorry, it does not work for me. Apparently the permissions are correctly set during the staging:

# ls -la ./work/stage/usr/local/bin/dspam
-r-s--x---  1 vmail  vmail  94640 Jul 14 19:12 ./work/stage/usr/local/bin/dspam

Yet the ownership and group still revert to root/wheel after make deinstall && make install clean:

# ls -la /usr/local/bin/dspam
-r-s--x---  1 root  wheel  94640 Jul 14 19:12 /usr/local/bin/dspam

The relevant snippet from my make.conf is as follows:

DSPAM_OWNER=vmail
DSPAM_HOME_GROUP=vmail
DSPAM_GROUP=vmail

Perhaps a quick and dirty Makefile post-install hack helps?
Comment 8 Rene Ladan freebsd_committer 2014-07-14 19:15:27 UTC
Looking at [1] and [2], I do not think what you want was supported before.

[1] http://svnweb.freebsd.org/ports/head/mail/dspam-devel/Makefile?r1=357486&r2=359827
[2] http://svnweb.freebsd.org/ports/head/mail/dspam-devel/pkg-plist?r1=357486&r2=359827

Which files/directories exactly do you expect to be affected by the DSPAM_* variables (OWNER, MODE, GROUP, HOME_OWNER, HOME_GROUP, HOME_MODE)?
Comment 9 Raivo Hool 2014-07-14 19:27:49 UTC
(In reply to Rene Ladan from comment #8)
> Looking at [1] and [2], I do not think what you want was supported before.

I just rebuilt and reinstalled it with -DNO_STAGE and everything got installed just the way it was supposed to and indeed used to, so it must have something to do with installing the staged build.

> Which files/directories exactly do you expect to be affected by the DSPAM_*
> variables (OWNER, MODE, GROUP, HOME_OWNER, HOME_GROUP, HOME_MODE)?

As for the  files, probably only /usr/local/bin/dspam, but I cannot say for the directories because I have them all set up already and cannot very well poke around to see what happens.
Comment 10 Rene Ladan freebsd_committer 2014-07-14 19:55:37 UTC
Created attachment 144673 [details]
fix installation of bin/dspam
Comment 11 Rene Ladan freebsd_committer 2014-07-14 19:56:59 UTC
I made a patch to fix the installation of bin/dspam (which was done by the in-port Makefiles in the unstaged case), can you test it?
Comment 12 Raivo Hool 2014-07-14 20:01:49 UTC
(In reply to Rene Ladan from comment #11)
> I made a patch to fix the installation of bin/dspam (which was done by the
> in-port Makefiles in the unstaged case), can you test it?

Owner and group are now correctly set, thanks. There's only one (cosmetic?) issue:

===>   Registering installation for dspam-devel-3.10.1_4,1
pkg-static: %%DSPAM_MODE%% wrong mode value
chmod: invalid file mode: %DSPAM_MODE%
Installing dspam-devel-3.10.1_4,1... done

This is probably because DSPAM_MODE has not been explicitly specified in my make.conf.

It's only a warning, installation proceeds as desired.
Comment 13 Rene Ladan freebsd_committer 2014-07-14 20:06:25 UTC
Ah, the warning is because DSPAM_MODE was not exported to pkg-plist by Makefile, I fixed that too now.
Comment 14 commit-hook freebsd_committer 2014-07-14 20:07:17 UTC
A commit references this bug:

Author: rene
Date: Mon Jul 14 20:06:50 UTC 2014
New revision: 361826
URL: http://svnweb.freebsd.org/changeset/ports/361826

Log:
  mail/dspam-devel: also set mode/owner/group for bin/dspam, bump PORTREVISION

  PR:		191797
  Submitted by:	raivo.hool@gmail.com
  MFH:		2014Q3

Changes:
  head/mail/dspam-devel/Makefile
  head/mail/dspam-devel/pkg-plist
Comment 15 commit-hook freebsd_committer 2014-07-14 20:14:18 UTC
A commit references this bug:

Author: rene
Date: Mon Jul 14 20:14:12 UTC 2014
New revision: 361827
URL: http://svnweb.freebsd.org/changeset/ports/361827

Log:
  MFH: r361826

  mail/dspam-devel: also set mode/owner/group for bin/dspam, bump PORTREVISION

  PR:		191797
  Submitted by:	raivo.hool@gmail.com

  Approved by:	portmgr (erwin)

Changes:
_U  branches/2014Q3/
  branches/2014Q3/mail/dspam-devel/Makefile
  branches/2014Q3/mail/dspam-devel/pkg-plist