blob: 6e0b2fdacb1a7cd0c4356e07ef0425cbd28839bf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "A network authentication protocol"
2DESCRIPTION = "Kerberos is a system for authenticating users and services on a network. \
3 Kerberos is a trusted third-party service. That means that there is a \
4 third party (the Kerberos server) that is trusted by all the entities on \
5 the network (users and services, usually called "principals"). \
6 . \
7 This is the MIT reference implementation of Kerberos V5. \
8 . \
9 This package contains the Kerberos key server (KDC). The KDC manages all \
10 authentication credentials for a Kerberos realm, holds the master keys \
11 for the realm, and responds to authentication requests. This package \
12 should be installed on both master and slave KDCs."
13
14HOMEPAGE = "http://web.mit.edu/Kerberos/"
15SECTION = "console/network"
16LICENSE = "MIT"
Andrew Geissler4b7c1152020-11-30 19:55:29 -060017LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=dd4d0ad4c5e98abb58aa0d312f276791"
Brad Bishop19323692019-04-05 15:28:33 -040018DEPENDS = "bison-native ncurses util-linux e2fsprogs e2fsprogs-native openssl"
19
20inherit autotools-brokensep binconfig perlnative systemd update-rc.d
21
22SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
23SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \
24 file://0001-aclocal-Add-parameter-to-disable-keyutils-detection.patch \
25 file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \
26 file://crosscompile_nm.patch \
27 file://etc/init.d/krb5-kdc \
28 file://etc/init.d/krb5-admin-server \
29 file://etc/default/krb5-kdc \
30 file://etc/default/krb5-admin-server \
31 file://krb5-kdc.service \
32 file://krb5-admin-server.service \
William A. Kennington III49e95662021-09-15 16:19:36 -070033 file://CVE-2021-36222.patch;striplevel=2 \
34 file://CVE-2021-37750.patch;striplevel=2 \
Brad Bishop19323692019-04-05 15:28:33 -040035"
Andrew Geissler4b7c1152020-11-30 19:55:29 -060036SRC_URI[md5sum] = "aa4337fffa3b61f22dbd0167f708818f"
37SRC_URI[sha256sum] = "1a4bba94df92f6d39a197a10687653e8bfbc9a2076e129f6eb92766974f86134"
Brad Bishop19323692019-04-05 15:28:33 -040038
39CVE_PRODUCT = "kerberos"
40CVE_VERSION = "5-${PV}"
41
42S = "${WORKDIR}/${BP}/src"
43
44PACKAGECONFIG ??= "pkinit"
45PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
46PACKAGECONFIG[openssl] = "--with-crypto-impl=openssl,,openssl"
47PACKAGECONFIG[keyutils] = "--enable-keyutils,--disable-keyutils,keyutils"
48PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
49PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
50PACKAGECONFIG[pkinit] = "--enable-pkinit, --disable-pkinit"
51
52EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
53CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
54 ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
55 ac_cv_file__etc_TIMEZONE=no"
56
Patrick Williams213cb262021-08-07 19:21:33 -050057CFLAGS:append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
58CFLAGS:append:riscv64 = " -D_REENTRANT -pthread"
59LDFLAGS:append = " -pthread"
Brad Bishop19323692019-04-05 15:28:33 -040060
61do_configure() {
62 gnu-configize --force
63 autoreconf
64 oe_runconf
65}
66
Patrick Williams213cb262021-08-07 19:21:33 -050067do_install:append() {
Brad Bishop19323692019-04-05 15:28:33 -040068 rm -rf ${D}/${localstatedir}/run
69 rm -f ${D}${bindir}/sclient
70 rm -f ${D}${bindir}/sim_client
71 rm -f ${D}${bindir}/uuclient
72 rm -f ${D}${sbindir}/krb5-send-pr
73 rm -f ${D}${sbindir}/sim_server
74 rm -f ${D}${sbindir}/sserver
75 rm -f ${D}${sbindir}/uuserver
76
77 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
78 mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
79 install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
80 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
81
82 mkdir -p ${D}/${sysconfdir}/default/volatiles
83 echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
84 > ${D}${sysconfdir}/default/volatiles/87_krb5
85
86 echo "RUN_KADMIND=true" >> ${D}/${sysconfdir}/default/krb5-admin-server
87 fi
88 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
89 install -d ${D}${sysconfdir}/tmpfiles.d
90 echo "d /run/krb5kdc - - - -" \
91 > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
92
93 mkdir -p ${D}/${sysconfdir}/default
94 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
95
96 install -d ${D}${systemd_system_unitdir}
97 install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
98 install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
99 fi
Andrew Geisslerd159c7f2021-09-02 21:05:58 -0500100
101 sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \
102 -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
103 -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
104 -i ${D}${bindir}/krb5-config
Brad Bishop19323692019-04-05 15:28:33 -0400105}
106
107PACKAGES =+ "${PN}-admin-server \
108 ${PN}-gss-samples \
109 ${PN}-k5tls \
110 ${PN}-kdc \
111 ${PN}-kdc-ldap \
112 ${PN}-kpropd \
113 ${PN}-otp \
114 ${PN}-pkinit \
115 ${PN}-spake \
116 ${PN}-user \
117 libgssapi-krb5 \
118 libgssrpc \
119 libk5crypto \
120 libkadm5clnt-mit \
121 libkadm5srv-mit \
122 libkdb5 \
123 libkrad \
124 libkrb5 \
125 libkrb5support \
126 libverto"
127
Patrick Williams213cb262021-08-07 19:21:33 -0500128FILES:${PN} = "${libdir}/krb5/plugins/preauth/test.so"
129FILES:${PN}-doc += "${datadir}/examples"
130FILES:${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
Brad Bishop19323692019-04-05 15:28:33 -0400131
Patrick Williams213cb262021-08-07 19:21:33 -0500132FILES:${PN}-admin-server = "${sbindir}/kadmin.local \
Brad Bishop19323692019-04-05 15:28:33 -0400133 ${sbindir}/kadmind \
134 ${sbindir}/kprop \
135 ${sysconfdir}/default/krb5-admin-server \
136 ${sysconfdir}/init.d/krb5-admin-server \
137 ${systemd_system_unitdir}/krb5-admin-server.service"
138
Patrick Williams213cb262021-08-07 19:21:33 -0500139FILES:${PN}-gss-samples = "${bindir}/gss-client \
Brad Bishop19323692019-04-05 15:28:33 -0400140 ${sbindir}/gss-server"
141
Patrick Williams213cb262021-08-07 19:21:33 -0500142FILES:${PN}-k5tls = "${libdir}/krb5/plugins/tls/k5tls.so"
Brad Bishop19323692019-04-05 15:28:33 -0400143
Patrick Williams213cb262021-08-07 19:21:33 -0500144FILES:${PN}-kdc = "${libdir}/krb5/plugins/kdb/db2.so \
Brad Bishop19323692019-04-05 15:28:33 -0400145 ${localstatedir}/krb5kdc \
146 ${sbindir}/kdb5_util \
147 ${sbindir}/kproplog \
148 ${sbindir}/krb5kdc \
149 ${sysconfdir}/default/krb5-kdc \
150 ${sysconfdir}/default/volatiles/87_krb5 \
151 ${sysconfdir}/init.d/krb5-kdc \
152 ${sysconfdir}/tmpfiles.d/krb5.conf \
153 ${systemd_system_unitdir}/krb5-kdc.service"
154
Patrick Williams213cb262021-08-07 19:21:33 -0500155FILES:${PN}-kdc-ldap = "${libdir}/krb5/libkdb_ldap${SOLIBS} \
Brad Bishop19323692019-04-05 15:28:33 -0400156 ${libdir}/krb5/plugins/kdb/kldap.so \
157 ${sbindir}/kdb5_ldap_util"
158
Patrick Williams213cb262021-08-07 19:21:33 -0500159FILES:${PN}-kpropd = "${sbindir}/kpropd"
160FILES:${PN}-otp = "${libdir}/krb5/plugins/preauth/otp.so"
161FILES:${PN}-pkinit = "${libdir}/krb5/plugins/preauth/pkinit.so"
162FILES:${PN}-spake = "${libdir}/krb5/plugins/preauth/spake.so"
163FILES:${PN}-user = "${bindir}/k*"
Brad Bishop19323692019-04-05 15:28:33 -0400164
Patrick Williams213cb262021-08-07 19:21:33 -0500165FILES:libgssapi-krb5 = "${libdir}/libgssapi_krb5${SOLIBS}"
166FILES:libgssrpc = "${libdir}/libgssrpc${SOLIBS}"
167FILES:libk5crypto = "${libdir}/libk5crypto${SOLIBS}"
168FILES:libkadm5clnt-mit = "${libdir}/libkadm5clnt_mit${SOLIBS}"
169FILES:libkadm5srv-mit = "${libdir}/libkadm5srv_mit${SOLIBS}"
170FILES:libkdb5 = "${libdir}/libkdb5${SOLIBS}"
171FILES:libkrad = "${libdir}/libkrad${SOLIBS}"
172FILES:libkrb5 = "${libdir}/libkrb5${SOLIBS} \
Brad Bishop19323692019-04-05 15:28:33 -0400173 ${libdir}/krb5/plugins/authdata \
174 ${libdir}/krb5/plugins/libkrb5"
Patrick Williams213cb262021-08-07 19:21:33 -0500175FILES:libkrb5support = "${libdir}/libkrb5support${SOLIBS}"
176FILES:libverto = "${libdir}/libverto${SOLIBS}"
Brad Bishop19323692019-04-05 15:28:33 -0400177
Patrick Williams213cb262021-08-07 19:21:33 -0500178RDEPENDS:${PN}-kadmin-server = "${PN}-kdc"
179RDEPENDS:${PN}-kpropd = "${PN}-kdc"
Brad Bishop19323692019-04-05 15:28:33 -0400180
181INITSCRIPT_PACKAGES = "${PN}-admin-server ${PN}-kdc"
Patrick Williams213cb262021-08-07 19:21:33 -0500182INITSCRIPT_NAME:${PN}-admin-server = "krb5-admin-server"
183INITSCRIPT_NAME:${PN}-kdc = "krb5-kdc"
Brad Bishop19323692019-04-05 15:28:33 -0400184
185SYSTEMD_PACKAGES = "${PN}-admin-server ${PN}-kdc"
Patrick Williams213cb262021-08-07 19:21:33 -0500186SYSTEMD_SERVICE:${PN}-admin-server = "krb5-admin-server.service"
187SYSTEMD_SERVICE:${PN}-kdc = "krb5-kdc.service"
Brad Bishop19323692019-04-05 15:28:33 -0400188
Patrick Williams213cb262021-08-07 19:21:33 -0500189pkg_postinst:${PN}-kdc () {
Brad Bishop19323692019-04-05 15:28:33 -0400190 if [ -z "$D" ]; then
191 if command -v systemd-tmpfiles >/dev/null; then
192 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
193 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
194 ${sysconfdir}/init.d/populate-volatile.sh update
195 fi
196 fi
197}
198
199BBCLASSEXTEND = "native nativesdk"