From nobody@FreeBSD.org  Sun May 15 14:20:40 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B9FD10656B3
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 May 2011 14:20:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 615788FC1A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 May 2011 14:20:40 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4FEKen4002441
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 15 May 2011 14:20:40 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4FEKeSh002440;
	Sun, 15 May 2011 14:20:40 GMT
	(envelope-from nobody)
Message-Id: <201105151420.p4FEKeSh002440@red.freebsd.org>
Date: Sun, 15 May 2011 14:20:40 GMT
From: Chris Rees <utisoft@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [build] Add new owner variable: CONF(OWN|GROUP|MODE)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157062
>Category:       misc
>Synopsis:       [bsd.own.mk] [patch] Add new owner variable: CONF(OWN|GROUP|MODE)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 15 14:30:07 UTC 2011
>Closed-Date:    Tue Jun 28 19:35:09 UTC 2011
>Last-Modified:  Tue Jun 28 19:35:09 UTC 2011
>Originator:     Chris Rees
>Release:        
>Organization:
>Environment:
>Description:
At the moment there are macros for ownership and permissions for files of class BIN, LIB, KMOD, LIBDATA, SHARE, MAN, NLS and INFO, but not for the class CONF.

This leads to some anomalies, such as src/etc/Makefile hardcoding mode 644 for config files in /etc, and (worse) config files are installed as DATA (SHAREMODE?=${NOBINMODE} by ports.

This means that all config files installed by ports are read-only, unlike their base counterparts -- not only is this inconsistent it also means that editing config files in vi forces me to use :wq! rather than ZZ to quit.
>How-To-Repeat:
Install a port with a config file.

# ls -l `make -V PREFIX`/etc/`make -V PORTNAME`.conf*

-r--r--r--  1 root  wheel  13467 Apr 22 12:14 /usr/local/etc/musicpd.conf
-r--r--r--  1 root  wheel  13482 May  7 10:02 /usr/local/etc/musicpd.conf.sample

Why are the config files read-only????
>Fix:
The attached patch lays the necessary groundwork for a new macro or routine in bsd.port.mk .

With suggestions on how to make sure the correct version of bsd.own.mk is sourced in buildworld I'll submit patches for src/etc as well.

Patch attached with submission follows:

Index: share/mk/bsd.own.mk
===================================================================
RCS file: /exports/cvsroot-freebsd/src/share/mk/bsd.own.mk,v
retrieving revision 1.103
diff -u -r1.103 bsd.own.mk
--- share/mk/bsd.own.mk	10 May 2011 11:00:40 -0000	1.103
+++ share/mk/bsd.own.mk	14 May 2011 15:25:48 -0000
@@ -63,6 +63,15 @@
 # SHAREMODE	ASCII text file mode. [${NOBINMODE}]
 #
 #
+# CONFDIR	Base path for configuration files. [/etc]
+#
+# CONFOWN	Configuration file owner. [root]
+#
+# CONFGRP	Configuration file group. [wheel]
+#
+# CONFMODE	Configuration file mode. [644]
+#
+#
 # DOCDIR	Base path for system documentation (e.g. PSD, USD,
 #		handbook, FAQ etc.). [${SHAREDIR}/doc]
 #
@@ -145,6 +154,11 @@
 SHAREGRP?=	wheel
 SHAREMODE?=	${NOBINMODE}
 
+CONFDIR?=	/etc
+CONFOWN?=	root
+CONFGRP?=	wheel
+CONFMODE?=	644
+
 MANDIR?=	${SHAREDIR}/man/man
 MANOWN?=	${SHAREOWN}
 MANGRP?=	${SHAREGRP}


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: se 
State-Changed-When: Tue Jun 28 19:33:10 UTC 2011 
State-Changed-Why:  
Thanks, committed since there were no objections on the mail lists. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157062 
>Unformatted:
