blob: 6c4b4575ee5c80175a7bfd99a968a1499b60f7cd [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 \
33"
Andrew Geissler4b7c1152020-11-30 19:55:29 -060034SRC_URI[md5sum] = "aa4337fffa3b61f22dbd0167f708818f"
35SRC_URI[sha256sum] = "1a4bba94df92f6d39a197a10687653e8bfbc9a2076e129f6eb92766974f86134"
Brad Bishop19323692019-04-05 15:28:33 -040036
37CVE_PRODUCT = "kerberos"
38CVE_VERSION = "5-${PV}"
39
40S = "${WORKDIR}/${BP}/src"
41
42PACKAGECONFIG ??= "pkinit"
43PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
44PACKAGECONFIG[openssl] = "--with-crypto-impl=openssl,,openssl"
45PACKAGECONFIG[keyutils] = "--enable-keyutils,--disable-keyutils,keyutils"
46PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
47PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
48PACKAGECONFIG[pkinit] = "--enable-pkinit, --disable-pkinit"
49
50EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
51CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
52 ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
53 ac_cv_file__etc_TIMEZONE=no"
54
Patrick Williams213cb262021-08-07 19:21:33 -050055CFLAGS:append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
56CFLAGS:append:riscv64 = " -D_REENTRANT -pthread"
57LDFLAGS:append = " -pthread"
Brad Bishop19323692019-04-05 15:28:33 -040058
59do_configure() {
60 gnu-configize --force
61 autoreconf
62 oe_runconf
63}
64
Patrick Williams213cb262021-08-07 19:21:33 -050065do_install:append() {
Brad Bishop19323692019-04-05 15:28:33 -040066 rm -rf ${D}/${localstatedir}/run
67 rm -f ${D}${bindir}/sclient
68 rm -f ${D}${bindir}/sim_client
69 rm -f ${D}${bindir}/uuclient
70 rm -f ${D}${sbindir}/krb5-send-pr
71 rm -f ${D}${sbindir}/sim_server
72 rm -f ${D}${sbindir}/sserver
73 rm -f ${D}${sbindir}/uuserver
74
75 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
76 mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
77 install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
78 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
79
80 mkdir -p ${D}/${sysconfdir}/default/volatiles
81 echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
82 > ${D}${sysconfdir}/default/volatiles/87_krb5
83
84 echo "RUN_KADMIND=true" >> ${D}/${sysconfdir}/default/krb5-admin-server
85 fi
86 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
87 install -d ${D}${sysconfdir}/tmpfiles.d
88 echo "d /run/krb5kdc - - - -" \
89 > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
90
91 mkdir -p ${D}/${sysconfdir}/default
92 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
93
94 install -d ${D}${systemd_system_unitdir}
95 install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
96 install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
97 fi
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050098
99 sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \
100 -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
101 -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
102 -i ${D}${bindir}/krb5-config
Brad Bishop19323692019-04-05 15:28:33 -0400103}
104
105PACKAGES =+ "${PN}-admin-server \
106 ${PN}-gss-samples \
107 ${PN}-k5tls \
108 ${PN}-kdc \
109 ${PN}-kdc-ldap \
110 ${PN}-kpropd \
111 ${PN}-otp \
112 ${PN}-pkinit \
113 ${PN}-spake \
114 ${PN}-user \
115 libgssapi-krb5 \
116 libgssrpc \
117 libk5crypto \
118 libkadm5clnt-mit \
119 libkadm5srv-mit \
120 libkdb5 \
121 libkrad \
122 libkrb5 \
123 libkrb5support \
124 libverto"
125
Patrick Williams213cb262021-08-07 19:21:33 -0500126FILES:${PN} = "${libdir}/krb5/plugins/preauth/test.so"
127FILES:${PN}-doc += "${datadir}/examples"
128FILES:${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
Brad Bishop19323692019-04-05 15:28:33 -0400129
Patrick Williams213cb262021-08-07 19:21:33 -0500130FILES:${PN}-admin-server = "${sbindir}/kadmin.local \
Brad Bishop19323692019-04-05 15:28:33 -0400131 ${sbindir}/kadmind \
132 ${sbindir}/kprop \
133 ${sysconfdir}/default/krb5-admin-server \
134 ${sysconfdir}/init.d/krb5-admin-server \
135 ${systemd_system_unitdir}/krb5-admin-server.service"
136
Patrick Williams213cb262021-08-07 19:21:33 -0500137FILES:${PN}-gss-samples = "${bindir}/gss-client \
Brad Bishop19323692019-04-05 15:28:33 -0400138 ${sbindir}/gss-server"
139
Patrick Williams213cb262021-08-07 19:21:33 -0500140FILES:${PN}-k5tls = "${libdir}/krb5/plugins/tls/k5tls.so"
Brad Bishop19323692019-04-05 15:28:33 -0400141
Patrick Williams213cb262021-08-07 19:21:33 -0500142FILES:${PN}-kdc = "${libdir}/krb5/plugins/kdb/db2.so \
Brad Bishop19323692019-04-05 15:28:33 -0400143 ${localstatedir}/krb5kdc \
144 ${sbindir}/kdb5_util \
145 ${sbindir}/kproplog \
146 ${sbindir}/krb5kdc \
147 ${sysconfdir}/default/krb5-kdc \
148 ${sysconfdir}/default/volatiles/87_krb5 \
149 ${sysconfdir}/init.d/krb5-kdc \
150 ${sysconfdir}/tmpfiles.d/krb5.conf \
151 ${systemd_system_unitdir}/krb5-kdc.service"
152
Patrick Williams213cb262021-08-07 19:21:33 -0500153FILES:${PN}-kdc-ldap = "${libdir}/krb5/libkdb_ldap${SOLIBS} \
Brad Bishop19323692019-04-05 15:28:33 -0400154 ${libdir}/krb5/plugins/kdb/kldap.so \
155 ${sbindir}/kdb5_ldap_util"
156
Patrick Williams213cb262021-08-07 19:21:33 -0500157FILES:${PN}-kpropd = "${sbindir}/kpropd"
158FILES:${PN}-otp = "${libdir}/krb5/plugins/preauth/otp.so"
159FILES:${PN}-pkinit = "${libdir}/krb5/plugins/preauth/pkinit.so"
160FILES:${PN}-spake = "${libdir}/krb5/plugins/preauth/spake.so"
161FILES:${PN}-user = "${bindir}/k*"
Brad Bishop19323692019-04-05 15:28:33 -0400162
Patrick Williams213cb262021-08-07 19:21:33 -0500163FILES:libgssapi-krb5 = "${libdir}/libgssapi_krb5${SOLIBS}"
164FILES:libgssrpc = "${libdir}/libgssrpc${SOLIBS}"
165FILES:libk5crypto = "${libdir}/libk5crypto${SOLIBS}"
166FILES:libkadm5clnt-mit = "${libdir}/libkadm5clnt_mit${SOLIBS}"
167FILES:libkadm5srv-mit = "${libdir}/libkadm5srv_mit${SOLIBS}"
168FILES:libkdb5 = "${libdir}/libkdb5${SOLIBS}"
169FILES:libkrad = "${libdir}/libkrad${SOLIBS}"
170FILES:libkrb5 = "${libdir}/libkrb5${SOLIBS} \
Brad Bishop19323692019-04-05 15:28:33 -0400171 ${libdir}/krb5/plugins/authdata \
172 ${libdir}/krb5/plugins/libkrb5"
Patrick Williams213cb262021-08-07 19:21:33 -0500173FILES:libkrb5support = "${libdir}/libkrb5support${SOLIBS}"
174FILES:libverto = "${libdir}/libverto${SOLIBS}"
Brad Bishop19323692019-04-05 15:28:33 -0400175
Patrick Williams213cb262021-08-07 19:21:33 -0500176RDEPENDS:${PN}-kadmin-server = "${PN}-kdc"
177RDEPENDS:${PN}-kpropd = "${PN}-kdc"
Brad Bishop19323692019-04-05 15:28:33 -0400178
179INITSCRIPT_PACKAGES = "${PN}-admin-server ${PN}-kdc"
Patrick Williams213cb262021-08-07 19:21:33 -0500180INITSCRIPT_NAME:${PN}-admin-server = "krb5-admin-server"
181INITSCRIPT_NAME:${PN}-kdc = "krb5-kdc"
Brad Bishop19323692019-04-05 15:28:33 -0400182
183SYSTEMD_PACKAGES = "${PN}-admin-server ${PN}-kdc"
Patrick Williams213cb262021-08-07 19:21:33 -0500184SYSTEMD_SERVICE:${PN}-admin-server = "krb5-admin-server.service"
185SYSTEMD_SERVICE:${PN}-kdc = "krb5-kdc.service"
Brad Bishop19323692019-04-05 15:28:33 -0400186
Patrick Williams213cb262021-08-07 19:21:33 -0500187pkg_postinst:${PN}-kdc () {
Brad Bishop19323692019-04-05 15:28:33 -0400188 if [ -z "$D" ]; then
189 if command -v systemd-tmpfiles >/dev/null; then
190 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
191 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
192 ${sysconfdir}/init.d/populate-volatile.sh update
193 fi
194 fi
195}
196
197BBCLASSEXTEND = "native nativesdk"