The branch main has been updated by markj:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5105e1ebecc784dcf8101ec6f3c79b27c43b004b

commit 5105e1ebecc784dcf8101ec6f3c79b27c43b004b
Author:     Mark Johnston <ma...@freebsd.org>
AuthorDate: 2025-08-19 13:02:00 +0000
Commit:     Mark Johnston <ma...@freebsd.org>
CommitDate: 2025-08-19 13:20:16 +0000

    krb5: Fix the installed compile_et
    
    We now build compile_et from krb5/util/compile_et.  The compile_et make
    target runs compile_et.sh through a preprocessor that does some
    substitution on the script, in particular it defines the directory where
    compile_et can find et_h.awk and et_c.awk.
    
    We build compile_et as a bootstrap tool since it's used to build krb5.
    It also gets installed by installworld, presumably because we did that
    with Heimdal Kerberos too and there's some chance that third-party
    projects are using it.
    
    There are two problems, both fixed by this patch:
    
    First, we don't actually install those awk scripts anywhere, so
    /usr/sbin/compile_et isn't usable on an installed system.  Let's simply
    install them to /usr/share/et, which is where upstream puts them.
    
    Second, compile_et is a bootstrap tool and gets installed into WORLDTMP
    during the bootstrap phase of the build.  At that point we preprocess it
    to set the directory where it can find those awk scripts.  That
    directory is currently set with `KRB5_ETDIR?= ${DESTDIR}/usr/share/et`,
    but DESTDIR points into the object directory, so this value is bogus.
    
    Since all build-time invocations of compile_et explicitly specify the
    script directory with the -d option, let's just update the path to point
    to the installed script directory.  In particular, avoid fixing DESTDIR
    in the script, since we don't do that generally.
    
    PR:             288929
    Reviewed by:    ivy, cy
    Sponsored by:   The FreeBSD Foundation
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D52004
---
 etc/mtree/BSD.usr.dist | 2 ++
 krb5/Makefile.inc      | 2 +-
 krb5/util/et/Makefile  | 9 ++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 68977a6b8282..ffdd82ae9911 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -267,6 +267,8 @@
         ..
         dtrace
         ..
+        et
+        ..
         examples
             BSD_daemon
             ..
diff --git a/krb5/Makefile.inc b/krb5/Makefile.inc
index cd54f7a0eff6..6db4e8d964aa 100644
--- a/krb5/Makefile.inc
+++ b/krb5/Makefile.inc
@@ -14,7 +14,7 @@ KRB5_VERSION= 1.22-final
 # MIT KRB5 uses KRB5_DIR. Heimdal uses KRB5DIR.
 KRB5_SRCTOP=   ${SRCTOP}/krb5
 KRB5_DIR=      ${SRCTOP}/crypto/krb5/src
-KRB5_ETDIR?=   ${DESTDIR}/usr/share/et
+KRB5_ETDIR?=   /usr/share/et
 KRB5_SRCLIBDIR=        ${KRB5_DIR}/lib
 
 KRB5_OBJTOP=   ${OBJTOP}/krb5
diff --git a/krb5/util/et/Makefile b/krb5/util/et/Makefile
index 6eceb253c3b0..0d474efa1e8e 100644
--- a/krb5/util/et/Makefile
+++ b/krb5/util/et/Makefile
@@ -20,7 +20,6 @@ INCSDIR=${INCLUDEDIR}
 LIBADD=        krb5support
 VERSION_MAP=   ${.CURDIR}/version.map
 
-
 SRCS=  com_err.c \
        error_message.c \
        et_name.c \
@@ -38,6 +37,14 @@ CFLAGS+=-I${KRB5_DIR}/util/et \
        -I${.CURDIR:H:H}/include \
        -I${.OBJDIR}
 
+FILESGROUPS=   ETSCRIPTS
+
+ETSCRIPTS=     et_c.awk \
+               et_h.awk
+
+ETSCRIPTSDIR=  ${KRB5_ETDIR}
+ETSCRIPTSMODE= 0444
+
 .include <bsd.lib.mk>
 
 .SUFFIXES: .h .c .et .ct .man .3

Reply via email to