From owner-svn-src-head@freebsd.org Fri Oct 9 21:57:44 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ACE89D3D2D; Fri, 9 Oct 2015 21:57:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F2B127; Fri, 9 Oct 2015 21:57:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t99Lvh28022048; Fri, 9 Oct 2015 21:57:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t99Lvgfu022041; Fri, 9 Oct 2015 21:57:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510092157.t99Lvgfu022041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 9 Oct 2015 21:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289085 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 21:57:44 -0000 Author: bapt Date: Fri Oct 9 21:57:42 2015 New Revision: 289085 URL: https://svnweb.freebsd.org/changeset/base/289085 Log: Add a new bsd.confs.mk similar to bsd.files.mk or bsd.incs.mk It defines a CONFS variable for all files supposed to be installed as a configuration file and handle as such Added: head/share/mk/bsd.confs.mk (contents, props changed) Modified: head/share/mk/bsd.README head/share/mk/bsd.lib.mk head/share/mk/bsd.own.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.progs.mk head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.README Fri Oct 9 21:57:42 2015 (r289085) @@ -18,6 +18,7 @@ bsd.lib.mk. bsd.arch.inc.mk - includes arch-specific Makefile.$arch bsd.compiler.mk - defined based on current compiler +bsd.confs.mk - install of configuration files bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk) bsd.dep.mk - handle Makefile dependencies bsd.doc.mk - building troff system documents Added: head/share/mk/bsd.confs.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.confs.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -0,0 +1,87 @@ +# $FreeBSD$ + +.if !target(____) +.error bsd.conf.mk cannot be included directly. +.endif + +.if ${MK_INCLUDES} != "no" +CONFGROUPS?= CONFS + +.if !target(buildconfig) +.for group in ${CONFSGROUPS} +buildconfig: ${${group}} +.endfor +.endif + +all: buildconfig + +.if !target(installconfig) +.for group in ${CONFGROUPS} +.if defined(${group}) && !empty(${group}) + +${group}OWN?= ${SHAREOWN} +${group}GRP?= ${SHAREGRP} +${group}MODE?= ${SHAREMODE} +${group}DIR?= ${ETCDIR}/ +STAGE_SETS+= ${group} +STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} + +_${group}CONFS= +.for cnf in ${${group}} +.if defined(${group}OWN_${cnf:T}) || defined(${group}GRP_${cnf:T}) || \ + defined(${group}MODE_${cnf:T}) || defined(${group}DIR_${cnf:T}) || \ + defined(${group}NAME_${cnf:T}) || defined(${group}NAME) +${group}OWN_${cnf:T}?= ${${group}OWN} +${group}GRP_${cnf:T}?= ${${group}GRP} +${group}MODE_${cnf:T}?= ${${group}MODE} +${group}DIR_${cnf:T}?= ${${group}DIR} +.if defined(${group}NAME) +${group}NAME_${cnf:T}?= ${${group}NAME} +.else +${group}NAME_${cnf:T}?= ${cnf:T} +.endif +STAGE_AS_SETS+= ${cnf:T} +STAGE_AS_${cnf:T}= ${${group}NAME_${cnf:T}} +# XXX {group}OWN,GRP,MODE +STAGE_DIR.${cnf:T}= ${STAGE_OBJTOP}${${group}DIR_${cnf:T}} +stage_as.${cnf:T}: ${cnf} +stage_config: stage_as.${cnf:T} + +installconfig: _${group}INS_${cnf:T} +_${group}INS_${cnf:T}: ${cnf} + ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \ + -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ + ${.ALLSRC} \ + ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} +.else +_${group}CONFS+= ${cnf} +.endif +.endfor +.if !empty(_${group}CONFS) +stage_files.${group}: ${_${group}CONFS} +stage_config: stage_files.${group} + +installconfig: _${group}INS +_${group}INS: ${_${group}CONFS} +.if defined(${group}NAME) + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} +.else + ${INSTALL} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${.ALLSRC} ${DESTDIR}${${group}DIR} +.endif +.endif + +.endif # defined(${group}) && !empty(${group}) +.endfor + +.endif # !target(installconfig) + +.if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD) +.if !defined(NO_STAGE_CONFIG) +STAGE_TARGETS+= stage_config +.endif +.endif + +.endif # ${MK_TOOLCHAIN} != "no" Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.lib.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -390,6 +390,7 @@ _libinstall: .include .include .include +.include .endif .include Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.own.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -213,6 +213,7 @@ NLSGRP?= ${SHAREGRP} NLSMODE?= ${NOBINMODE} INCLUDEDIR?= /usr/include +ETCDIR?= /etc # # install(1) parameters. Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.prog.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -249,6 +249,7 @@ _SCRIPTSINS_${script:T}: ${script} NLSNAME?= ${PROG} .include +.include .include .include .include Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.progs.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -71,7 +71,7 @@ UPDATE_DEPENDFILE = NO # These are handled by the main make process. .ifdef _RECURSING_PROGS -_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS +_PROGS_GLOBAL_VARS= CLEANFILES CLEANDIRS FILESGROUPS SCRIPTS CONFGROUPS .for v in ${_PROGS_GLOBAL_VARS} $v = .endfor Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Fri Oct 9 21:34:46 2015 (r289084) +++ head/share/mk/bsd.subdir.mk Fri Oct 9 21:57:42 2015 (r289085) @@ -122,7 +122,7 @@ _sub.${__target}: _SUBDIR .endif .endfor -.for __target in files includes +.for __target in files includes config .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target})