blob: e27a4ae07882c63fdf1ef5463ca14c6424db737e [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"
17LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=aff541e7261f1926ac6a2a9a7bbab839"
18DEPENDS = "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"
34SRC_URI[md5sum] = "3b729d89eb441150e146780c4138481b"
35SRC_URI[sha256sum] = "5a6e2284a53de5702d3dc2be3b9339c963f9b5397d3fbbc53beb249380a781f5"
36
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
55CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
56CFLAGS_append_riscv64 = " -D_REENTRANT -pthread"
57LDFLAGS_append = " -pthread"
58
59do_configure() {
60 gnu-configize --force
61 autoreconf
62 oe_runconf
63}
64
65do_install_append() {
66 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
98}
99
100PACKAGES =+ "${PN}-admin-server \
101 ${PN}-gss-samples \
102 ${PN}-k5tls \
103 ${PN}-kdc \
104 ${PN}-kdc-ldap \
105 ${PN}-kpropd \
106 ${PN}-otp \
107 ${PN}-pkinit \
108 ${PN}-spake \
109 ${PN}-user \
110 libgssapi-krb5 \
111 libgssrpc \
112 libk5crypto \
113 libkadm5clnt-mit \
114 libkadm5srv-mit \
115 libkdb5 \
116 libkrad \
117 libkrb5 \
118 libkrb5support \
119 libverto"
120
121FILES_${PN} = "${libdir}/krb5/plugins/preauth/test.so"
122FILES_${PN}-doc += "${datadir}/examples"
123FILES_${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
124
125FILES_${PN}-admin-server = "${sbindir}/kadmin.local \
126 ${sbindir}/kadmind \
127 ${sbindir}/kprop \
128 ${sysconfdir}/default/krb5-admin-server \
129 ${sysconfdir}/init.d/krb5-admin-server \
130 ${systemd_system_unitdir}/krb5-admin-server.service"
131
132FILES_${PN}-gss-samples = "${bindir}/gss-client \
133 ${sbindir}/gss-server"
134
135FILES_${PN}-k5tls = "${libdir}/krb5/plugins/tls/k5tls.so"
136
137FILES_${PN}-kdc = "${libdir}/krb5/plugins/kdb/db2.so \
138 ${localstatedir}/krb5kdc \
139 ${sbindir}/kdb5_util \
140 ${sbindir}/kproplog \
141 ${sbindir}/krb5kdc \
142 ${sysconfdir}/default/krb5-kdc \
143 ${sysconfdir}/default/volatiles/87_krb5 \
144 ${sysconfdir}/init.d/krb5-kdc \
145 ${sysconfdir}/tmpfiles.d/krb5.conf \
146 ${systemd_system_unitdir}/krb5-kdc.service"
147
148FILES_${PN}-kdc-ldap = "${libdir}/krb5/libkdb_ldap${SOLIBS} \
149 ${libdir}/krb5/plugins/kdb/kldap.so \
150 ${sbindir}/kdb5_ldap_util"
151
152FILES_${PN}-kpropd = "${sbindir}/kpropd"
153FILES_${PN}-otp = "${libdir}/krb5/plugins/preauth/otp.so"
154FILES_${PN}-pkinit = "${libdir}/krb5/plugins/preauth/pkinit.so"
155FILES_${PN}-spake = "${libdir}/krb5/plugins/preauth/spake.so"
156FILES_${PN}-user = "${bindir}/k*"
157
158FILES_libgssapi-krb5 = "${libdir}/libgssapi_krb5${SOLIBS}"
159FILES_libgssrpc = "${libdir}/libgssrpc${SOLIBS}"
160FILES_libk5crypto = "${libdir}/libk5crypto${SOLIBS}"
161FILES_libkadm5clnt-mit = "${libdir}/libkadm5clnt_mit${SOLIBS}"
162FILES_libkadm5srv-mit = "${libdir}/libkadm5srv_mit${SOLIBS}"
163FILES_libkdb5 = "${libdir}/libkdb5${SOLIBS}"
164FILES_libkrad = "${libdir}/libkrad${SOLIBS}"
165FILES_libkrb5 = "${libdir}/libkrb5${SOLIBS} \
166 ${libdir}/krb5/plugins/authdata \
167 ${libdir}/krb5/plugins/libkrb5"
168FILES_libkrb5support = "${libdir}/libkrb5support${SOLIBS}"
169FILES_libverto = "${libdir}/libverto${SOLIBS}"
170
171RDEPENDS_${PN}-kadmin-server = "${PN}-kdc"
172RDEPENDS_${PN}-kpropd = "${PN}-kdc"
173
174INITSCRIPT_PACKAGES = "${PN}-admin-server ${PN}-kdc"
175INITSCRIPT_NAME_${PN}-admin-server = "krb5-admin-server"
176INITSCRIPT_NAME_${PN}-kdc = "krb5-kdc"
177
178SYSTEMD_PACKAGES = "${PN}-admin-server ${PN}-kdc"
179SYSTEMD_SERVICE_${PN}-admin-server = "krb5-admin-server.service"
180SYSTEMD_SERVICE_${PN}-kdc = "krb5-kdc.service"
181
182pkg_postinst_${PN}-kdc () {
183 if [ -z "$D" ]; then
184 if command -v systemd-tmpfiles >/dev/null; then
185 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
186 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
187 ${sysconfdir}/init.d/populate-volatile.sh update
188 fi
189 fi
190}
191
192BBCLASSEXTEND = "native nativesdk"