Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 2014 15:01:03 -0700
From:      NGie Cooper <yaneurabeya@gmail.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Mark Johnston <markj@freebsd.org>, "freebsd-rc@freebsd.org" <freebsd-rc@freebsd.org>, Benno Rice <benno@freebsd.org>, "freebsd-arch@FreeBSD.org Arch" <freebsd-arch@freebsd.org>
Subject:   Re: [RFC] fully integrate etc/Makefile into bsd.prog.mk
Message-ID:  <CAGHfRMBbG6mjpxZ1dLT=jQRTzAsgO%2BRomLyGAsTOaOw6cHBUSw@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 23, 2014 at 8:07 AM, Warner Losh <imp@bsdimp.com> wrote:
>
> On Sep 23, 2014, at 2:41 AM, Garrett Cooper <yaneurabeya@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMBbG6mjpxZ1dLT=jQRTzAsgO%2BRomLyGAsTOaOw6cHBUSw>