diff --git a/krb5/Makefile.inc b/krb5/Makefile.inc --- a/krb5/Makefile.inc +++ b/krb5/Makefile.inc @@ -9,6 +9,7 @@ .include +PACKAGE?= kerberos KRB5_VERSION= 1.22-final # MIT KRB5 uses KRB5_DIR. Heimdal uses KRB5DIR. diff --git a/krb5/include/Makefile b/krb5/include/Makefile --- a/krb5/include/Makefile +++ b/krb5/include/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" diff --git a/krb5/include/Makefile.inc b/krb5/include/Makefile.inc --- a/krb5/include/Makefile.inc +++ b/krb5/include/Makefile.inc @@ -7,6 +7,4 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include "../Makefile.inc" diff --git a/krb5/lib/Makefile.inc b/krb5/lib/Makefile.inc --- a/krb5/lib/Makefile.inc +++ b/krb5/lib/Makefile.inc @@ -9,7 +9,7 @@ .include "../Makefile.inc" -PACKAGE?= kerberos-lib +LIB_PACKAGE= KRB5_KRB5LIBDIR= ${KRB5_SRCLIBDIR}/krb5 KRB5_K5CRYPTODIR= ${KRB5_SRCLIBDIR}/crypto diff --git a/krb5/libexec/Makefile.inc b/krb5/libexec/Makefile.inc --- a/krb5/libexec/Makefile.inc +++ b/krb5/libexec/Makefile.inc @@ -9,5 +9,5 @@ .include "../Makefile.inc" -PACKAGE?= kerberos-kdc +PACKAGE= kerberos-kdc BINDIR?= /usr/libexec diff --git a/krb5/usr.bin/Makefile.inc b/krb5/usr.bin/Makefile.inc --- a/krb5/usr.bin/Makefile.inc +++ b/krb5/usr.bin/Makefile.inc @@ -9,5 +9,4 @@ .include "../Makefile.inc" -PACKAGE?= kerberos BINDIR?= /usr/bin diff --git a/krb5/usr.sbin/gss-server/Makefile b/krb5/usr.sbin/gss-server/Makefile --- a/krb5/usr.sbin/gss-server/Makefile +++ b/krb5/usr.sbin/gss-server/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos - PROG= gss-server LIBADD= gssapi_krb5 krb5 k5crypto com_err krb5profile krb5support sys diff --git a/krb5/usr.sbin/sim_server/Makefile b/krb5/usr.sbin/sim_server/Makefile --- a/krb5/usr.sbin/sim_server/Makefile +++ b/krb5/usr.sbin/sim_server/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos - PROG= sim_server LIBADD= krb5 k5crypto com_err krb5profile krb5support sys diff --git a/krb5/usr.sbin/sserver/Makefile b/krb5/usr.sbin/sserver/Makefile --- a/krb5/usr.sbin/sserver/Makefile +++ b/krb5/usr.sbin/sserver/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos - PROG= sserver LIBADD= krb5 k5crypto com_err krb5profile krb5support sys diff --git a/krb5/util/Makefile.inc b/krb5/util/Makefile.inc --- a/krb5/util/Makefile.inc +++ b/krb5/util/Makefile.inc @@ -9,5 +9,7 @@ .include "../Makefile.inc" +LIB_PACKAGE= + SHLIBDIR?= /usr/lib SHLIB_MAJOR?= 122 diff --git a/krb5/util/build-tools/Makefile b/krb5/util/build-tools/Makefile --- a/krb5/util/build-tools/Makefile +++ b/krb5/util/build-tools/Makefile @@ -7,12 +7,11 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include "../Makefile.inc" SCRIPTS= krb5-config.sh BINDIR?= /usr/bin +TAGS= dev MAN= krb5-config.1 diff --git a/krb5/util/compile_et/Makefile b/krb5/util/compile_et/Makefile --- a/krb5/util/compile_et/Makefile +++ b/krb5/util/compile_et/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos - .include "../Makefile.inc" SRC_ETDIR= ${KRB5_DIR}/util/et @@ -18,6 +16,7 @@ BINDIR?= /usr/bin MAN= compile_et.1 CLEANFILES= compile_et +TAGS+= dev compile_et: compile_et.sh sh ${SRC_ETDIR}/config_script ${SRC_ETDIR}/compile_et.sh \ diff --git a/krb5/util/et/Makefile b/krb5/util/et/Makefile --- a/krb5/util/et/Makefile +++ b/krb5/util/et/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" @@ -44,6 +42,7 @@ ETSCRIPTSDIR= ${KRB5_ETDIR} ETSCRIPTSMODE= 0444 +ETSCRIPTSTAGS= dev .include diff --git a/krb5/util/profile/Makefile b/krb5/util/profile/Makefile --- a/krb5/util/profile/Makefile +++ b/krb5/util/profile/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" diff --git a/krb5/util/ss/Makefile b/krb5/util/ss/Makefile --- a/krb5/util/ss/Makefile +++ b/krb5/util/ss/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" diff --git a/krb5/util/support/Makefile b/krb5/util/support/Makefile --- a/krb5/util/support/Makefile +++ b/krb5/util/support/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" diff --git a/krb5/util/verto/Makefile b/krb5/util/verto/Makefile --- a/krb5/util/verto/Makefile +++ b/krb5/util/verto/Makefile @@ -7,8 +7,6 @@ # under sponsorship from the FreeBSD Foundation. # -PACKAGE= kerberos-lib - .include .include "../Makefile.inc" diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -45,7 +45,7 @@ all: ${STATIC_LDSCRIPT} libcrypt.ald install-libcrypt.a: libcrypt.ald - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} libcrypt.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a realinstall: install-libcrypt.a diff --git a/release/packages/generate-ucl.lua b/release/packages/generate-ucl.lua --- a/release/packages/generate-ucl.lua +++ b/release/packages/generate-ucl.lua @@ -38,6 +38,10 @@ "This package contains 32-bit libraries for running 32-bit ".. "applications on a 64-bit host.", }, + { + "%-lib$", "(libraries)", + "This package contains runtime shared libraries.", + }, { "%-dev$", "(development files)", "This package contains development files for ".. @@ -98,6 +102,9 @@ if no_gen_deps[pkgname] ~= nil then return false end + if pkgname:match("%-lib$") ~= nil then + return false + end if pkggenname == "kernel" then return false end diff --git a/release/packages/generate-ucl.sh b/release/packages/generate-ucl.sh --- a/release/packages/generate-ucl.sh +++ b/release/packages/generate-ucl.sh @@ -49,6 +49,9 @@ *-lib32) outname="${outname%%-lib32}" ;; + *-lib) + outname="${outname%%-lib}" + ;; *-man) outname="${outname%%-man}" ;; diff --git a/release/packages/ucl/kerberos-lib-all.ucl b/release/packages/ucl/kerberos-lib-all.ucl deleted file mode 100644 --- a/release/packages/ucl/kerberos-lib-all.ucl +++ /dev/null @@ -1,4 +0,0 @@ -comment = "Kerberos libraries" -desc = < .include -PACKAGE= openssl-lib LIB= crypto SHLIB_MAJOR= 35 VERSION_MAP= ${.CURDIR}/Version.map diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc --- a/secure/lib/libcrypto/Makefile.inc +++ b/secure/lib/libcrypto/Makefile.inc @@ -1,5 +1,8 @@ .include +PACKAGE= openssl +LIB_PACKAGE= + # OpenSSL version used for manual page generation OPENSSL_VER= 3.5.0 OPENSSL_DATE= 2025-07-01 diff --git a/secure/lib/libcrypto/engines/Makefile.inc b/secure/lib/libcrypto/engines/Makefile.inc --- a/secure/lib/libcrypto/engines/Makefile.inc +++ b/secure/lib/libcrypto/engines/Makefile.inc @@ -1,4 +1,5 @@ -PACKAGE?= openssl-lib +PACKAGE?= openssl +LIB_PACKAGE= SHLIBDIR= ${LIBDIR}/engines-3 diff --git a/secure/lib/libcrypto/modules/Makefile.inc b/secure/lib/libcrypto/modules/Makefile.inc --- a/secure/lib/libcrypto/modules/Makefile.inc +++ b/secure/lib/libcrypto/modules/Makefile.inc @@ -1,4 +1,5 @@ -PACKAGE?= openssl-lib +PACKAGE?= openssl +LIB_PACKAGE= SHLIBDIR= ${LIBDIR}/ossl-modules LCRYPTO_SRC= ${SRCTOP}/crypto/openssl diff --git a/secure/lib/libssl/Makefile b/secure/lib/libssl/Makefile --- a/secure/lib/libssl/Makefile +++ b/secure/lib/libssl/Makefile @@ -3,7 +3,6 @@ LIB= ssl SHLIB_MAJOR= 35 VERSION_MAP= ${.CURDIR}/Version.map -PACKAGE= openssl-lib NO_LINT= diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -70,11 +70,31 @@ .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} -TAGS+= package=${PACKAGE:Uutilities} +TAGS+= package=${PACKAGE:Uutilities} .endif -TAG_ARGS= -T ${TAGS:ts,:[*]} + +# By default, if PACKAGE=foo, then the native runtime libraries will go into +# the FreeBSD-foo package, and subpackages will be created for -dev, -lib32, +# and so on. If LIB_PACKAGE is set, then we also create a subpackage for +# runtime libraries with a -lib suffix. This is used when a package has +# libraries and some other content (e.g., executables) to allow consumers to +# depend on the libraries. +.if defined(LIB_PACKAGE) && ! ${TAGS:Mlib*} +.if !defined(PACKAGE) +.error LIB_PACKAGE cannot be used without PACKAGE +.endif + +LIB_TAG_ARGS= ${TAG_ARGS},lib +.else +LIB_TAG_ARGS= ${TAG_ARGS} .endif +TAG_ARGS= -T ${TAGS:ts,:[*]} + +DBG_TAG_ARGS= ${TAG_ARGS},dbg +DEV_TAG_ARGS= ${TAG_ARGS},dev +.endif # !defined(NO_ROOT) + # ELF hardening knobs .if ${MK_BIND_NOW} != "no" LDFLAGS+= -Wl,-znow @@ -384,7 +404,7 @@ installpcfiles: installpcfiles-${pcfile} installpcfiles-${pcfile}: ${pcfile} - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} \ ${.ALLSRC} ${DESTDIR}${LIBDATADIR}/pkgconfig/ .endfor @@ -396,45 +416,46 @@ .ORDER: beforeinstall _libinstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) - ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${LIB_TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ + ${INSTALL} ${DBG_TAG_ARGS} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ + ${INSTALL} ${DBG_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ .endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} - ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${SHLIB_LINK} \ - ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} + ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ + ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor .else .if ${_SHLIBDIR} == ${_LIBDIR} .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \ ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ + ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .else .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME}) @@ -446,7 +467,7 @@ .endif # SHLIB_LINK .endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif .endif # !defined(INTERNALLIB) @@ -466,7 +487,7 @@ LINKMODE?= ${LIBMODE} SYMLINKOWN?= ${LIBOWN} SYMLINKGRP?= ${LIBGRP} -LINKTAGS= dev +LINKTAGS= dev${_COMPAT_TAG} .include .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)