freebsd-src/lib/libcrypt/Makefile
Lexi Winter 929f5966a9 packages: Improve handling of -lib packages
For some packages (OpenSSL, Kerberos) we want to ship runtime libraries
in a separate package, e.g. openssl and openssl-lib.  Currently this is
done using PACKAGE=openssl-lib, but that creates packages with strange
names like openssl-lib-lib32.

Instead, add a new LIB_PACKAGE option to bsd.lib.mk that causes runtime
libraries to be placed in a new -lib subpackage.  This significantly
improves the set of packages we create; for example, OpenSSL goes from:

	FreeBSD-openssl
	FreeBSD-openssl-dbg
	FreeBSD-openssl-lib
	FreeBSD-openssl-lib-dbg
	FreeBSD-openssl-lib-dbg-lib32
	FreeBSD-openssl-lib-dev
	FreeBSD-openssl-lib-dev-lib32
	FreeBSD-openssl-lib-lib32
	FreeBSD-openssl-lib-man
	FreeBSD-openssl-man

to:

	FreeBSD-openssl
	FreeBSD-openssl-dbg
	FreeBSD-openssl-dbg-lib32
	FreeBSD-openssl-dev
	FreeBSD-openssl-dev-lib32
	FreeBSD-openssl-lib
	FreeBSD-openssl-lib32
	FreeBSD-openssl-man

While here, move /usr/bin/krb5-config and /usr/bin/compile_et into
the kerberos-dev package.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D51925
2025-08-23 01:57:23 +01:00

53 lines
1.2 KiB
Makefile

SHLIBDIR?= /lib
.include <src.opts.mk>
PACKAGE= runtime
SHLIB_MAJOR= 5
LIB= crypt
SRCS= crypt.c misc.c \
crypt-md5.c \
crypt-nthash.c \
crypt-sha256.c \
crypt-sha512.c
MAN= crypt.3
MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \
crypt.3 crypt_set_format.3
CFLAGS+= -I${SRCTOP}/lib/libmd \
-I${SRCTOP}/sys/crypto/sha2
# Pull in the strong crypto, if it is present.
.if exists(${SRCTOP}/secure/lib/libcrypt) && ${MK_CRYPT} != "no"
.PATH: ${SRCTOP}/secure/lib/libcrypt
SRCS+= crypt-des.c crypt-blowfish.c blowfish.c
CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
.endif
WARNS?= 2
PRECIOUSLIB=
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
LIBADD+= md
SHLIB_LDSCRIPT= libcrypt.ldscript
STATIC_LDSCRIPT= libcrypt.aldscript
CLEANFILES+= libcrypt.ald
libcrypt.ald: ${.CURDIR}/${STATIC_LDSCRIPT}
sed -e 's,@@LIB@@,${LIB},g' \
-e 's,@@STATICLIB_SUFFIX@@,${_STATICLIB_SUFFIX},g' \
${.ALLSRC} > ${.TARGET}
all: ${STATIC_LDSCRIPT} libcrypt.ald
install-libcrypt.a: libcrypt.ald
${INSTALL} ${DEV_TAG_ARGS} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} libcrypt.ald ${DESTDIR}${_LIBDIR}/lib${LIB}.a
realinstall: install-libcrypt.a
.include <bsd.lib.mk>