From owner-freebsd-rc@FreeBSD.ORG Tue Sep 23 22:01:04 2014 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88E17FA4; Tue, 23 Sep 2014 22:01:04 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 365F5F76; Tue, 23 Sep 2014 22:01:04 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id hn15so5450947igb.16 for ; Tue, 23 Sep 2014 15:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lcgRhTcQ+QYFMaJQoN14jE4xo/+Rpllm4CRzneWYDlo=; b=HAFWsWiZbrFy5Zzrf3Jai+Nfk/40mOaqEIbgafHguCQ8COFhIdK6mXrseii17uz9t3 NGxYxi601VT0gFzyUY1PEz1axYvBBi32/0389GewJSgls94GXBJQ0RakdBHZ02yCsI4U Z7xcj4OcqnMpQr6s4f+CszAz6Br/T3gBruZ/kLTF455X6CkkKm7f+jVtdhVJOEgUCahU u+q7yRwbcx3e6QV9xI1fKv/kB2HBByI5JUaRGXoh6hSPp/I/dHfDzaYIY0/0zUntbLZt 7xijI2AbJN25H1gyzhkAAxn8q3RXNXXOu+cIE8j6cHKEn9qQoDUW9rjQ19ep0HdX4ogz FueQ== MIME-Version: 1.0 X-Received: by 10.42.63.129 with SMTP id c1mr3805530ici.82.1411509663565; Tue, 23 Sep 2014 15:01:03 -0700 (PDT) Received: by 10.50.72.69 with HTTP; Tue, 23 Sep 2014 15:01:03 -0700 (PDT) In-Reply-To: <0A216B9F-3437-461E-A52A-032F6B86B5F2@bsdimp.com> References: <11E49217-8154-47AC-8D39-68256017D3A8@gmail.com> <0A216B9F-3437-461E-A52A-032F6B86B5F2@bsdimp.com> Date: Tue, 23 Sep 2014 15:01:03 -0700 Message-ID: Subject: Re: [RFC] fully integrate etc/Makefile into bsd.prog.mk From: NGie Cooper To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: Mark Johnston , "freebsd-rc@freebsd.org" , Benno Rice , "freebsd-arch@FreeBSD.org Arch" X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:01:04 -0000 On Tue, Sep 23, 2014 at 8:07 AM, Warner Losh wrote: > > On Sep 23, 2014, at 2:41 AM, Garrett Cooper wrote: > >> Hi all, >> I was wondering if anyone would have any serious objections to me converting etc/Makefile . The rationale for doing this work would be to ease maintenance/customization. > > Converting it from what to what? Looking at etc/Makefile , there are a lot of "custom" targets/ad hoc install rules for installing things like kerberos, openssh, sendmail, etc, in the distribution target: 259 .if ${MK_SENDMAIL} != "no" 260 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution 261 .endif 262 .if ${MK_OPENSSH} != "no" 263 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 264 ${SSH} ${DESTDIR}/etc/ssh 265 .endif 266 .if ${MK_OPENSSL} != "no" 267 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 268 ${SSL} ${DESTDIR}/etc/ssl 269 .endif 270 .if ${MK_KERBEROS} != "no" 271 cd ${.CURDIR}/root; \ 272 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 273 dot.k5login ${DESTDIR}/root/.k5login; 274 .endif 275 cd ${.CURDIR}/root; \ 276 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 277 dot.profile ${DESTDIR}/root/.profile; \ 278 rm -f ${DESTDIR}/.profile; \ 279 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile 280 .if ${MK_TCSH} != "no" 281 cd ${.CURDIR}/root; \ 282 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 283 dot.cshrc ${DESTDIR}/root/.cshrc; \ 284 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 285 dot.login ${DESTDIR}/root/.login; \ 286 rm -f ${DESTDIR}/.cshrc; \ 287 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc 288 .endif 289 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 290 ${MTREE} ${DESTDIR}/etc/mtree 291 .if ${MK_PPP} != "no" 292 cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ 293 ${PPPCNF} ${DESTDIR}/etc/ppp 294 .endif 1. Some of these items can be easily pushed into SUBDIRs with an appropriate knob to say "I am running make distribution", as they leverage the system Makefiles. Having a cleaner layout would improve maintenance and make the code clearer to follow and it encourages others to not make a mess because it would follow patterns throughout other portions of the tree. 2. Some of these pieces should be placed under knobs because they aren't needed in all configurations. 3. Using variables to specify the install files will allow people/organizations customizing FreeBSD to better leverage make logic and variables (say via custom make.conf/src.conf hooks) to avoid installing the entire "make distribution" kitchensink with ${BIN1:N*firewall*}, etc. The Isilon etc/Makefile for instance is convoluted, in part because of 2. and in part because we have dropped things into /etc/ in non-standard ways in the past. The three observations above are separate items and somewhat orthogonal/parallel to the work being discussed above (maybe I should have titled the thread "cleaning up the etc/Makefile kitchensink", but I was trying to be less bikesheddy). Thanks, -Garrett