blob: f95240f545e15e16f853a4ee006142b2aece8c2e [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -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=59b8da652f07186b44782a8454574f30"
18DEPENDS = "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] = "23c5e9f07642db4a67f7a5b6168b1319"
35SRC_URI[sha256sum] = "faeb125f83b0fb4cdb2f99f088140631bb47d975982de0956d18c85842969e08"
36
37CVE_PRODUCT = "kerberos"
38
39S = "${WORKDIR}/${BP}/src"
40
41PACKAGECONFIG ??= ""
42PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
43PACKAGECONFIG[openssl] = "--with-crypto-impl=openssl,,openssl"
44PACKAGECONFIG[keyutils] = "--enable-keyutils,--disable-keyutils,keyutils"
45PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
46PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
47
48EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
49CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
50 ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
51 ac_cv_file__etc_TIMEZONE=no"
52
53CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
54CFLAGS_append_riscv64 = " -D_REENTRANT -pthread"
55LDFLAGS_append = " -pthread"
56
57do_configure() {
58 gnu-configize --force
59 autoreconf
60 oe_runconf
61}
62
63do_install_append() {
64 rm -rf ${D}/${localstatedir}/run
65 rm -f ${D}${bindir}/sclient
66 rm -f ${D}${bindir}/sim_client
67 rm -f ${D}${bindir}/uuclient
68 rm -f ${D}${sbindir}/krb5-send-pr
69 rm -f ${D}${sbindir}/sim_server
70 rm -f ${D}${sbindir}/sserver
71 rm -f ${D}${sbindir}/uuserver
72
73 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
74 mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
75 install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
76 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
77
78 mkdir -p ${D}/${sysconfdir}/default/volatiles
79 echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
80 > ${D}${sysconfdir}/default/volatiles/87_krb5
81
82 echo "RUN_KADMIND=true" >> ${D}/${sysconfdir}/default/krb5-admin-server
83 fi
84 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
85 install -d ${D}${sysconfdir}/tmpfiles.d
86 echo "d /run/krb5kdc - - - -" \
87 > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
88
89 mkdir -p ${D}/${sysconfdir}/default
90 install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
91
92 install -d ${D}${systemd_system_unitdir}
93 install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
94 install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
95 fi
96}
97
98PACKAGES =+ "${PN}-admin-server \
99 ${PN}-gss-samples \
100 ${PN}-k5tls \
101 ${PN}-kdc \
102 ${PN}-kdc-ldap \
103 ${PN}-kpropd \
104 ${PN}-otp \
105 ${PN}-pkinit \
106 ${PN}-user \
107 libgssapi-krb5 \
108 libgssrpc \
109 libk5crypto \
110 libkadm5clnt-mit \
111 libkadm5srv-mit \
112 libkdb5 \
113 libkrad \
114 libkrb5 \
115 libkrb5support \
116 libverto"
117
118FILES_${PN} = "${libdir}/krb5/plugins/preauth/test.so"
119FILES_${PN}-doc += "${datadir}/examples"
120FILES_${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
121
122FILES_${PN}-admin-server = "${sbindir}/kadmin.local \
123 ${sbindir}/kadmind \
124 ${sbindir}/kprop \
125 ${sysconfdir}/default/krb5-admin-server \
126 ${sysconfdir}/init.d/krb5-admin-server \
127 ${systemd_system_unitdir}/krb5-admin-server.service"
128
129FILES_${PN}-gss-samples = "${bindir}/gss-client \
130 ${sbindir}/gss-server"
131
132FILES_${PN}-k5tls = "${libdir}/krb5/plugins/tls/k5tls.so"
133
134FILES_${PN}-kdc = "${libdir}/krb5/plugins/kdb/db2.so \
135 ${localstatedir}/krb5kdc \
136 ${sbindir}/kdb5_util \
137 ${sbindir}/kproplog \
138 ${sbindir}/krb5kdc \
139 ${sysconfdir}/default/krb5-kdc \
140 ${sysconfdir}/default/volatiles/87_krb5 \
141 ${sysconfdir}/init.d/krb5-kdc \
142 ${sysconfdir}/tmpfiles.d/krb5.conf \
143 ${systemd_system_unitdir}/krb5-kdc.service"
144
145FILES_${PN}-kdc-ldap = "${libdir}/krb5/libkdb_ldap${SOLIBS} \
146 ${libdir}/krb5/plugins/kdb/kldap.so \
147 ${sbindir}/kdb5_ldap_util"
148
149FILES_${PN}-kpropd = "${sbindir}/kpropd"
150FILES_${PN}-otp = "${libdir}/krb5/plugins/preauth/otp.so"
151FILES_${PN}-pkinit = "${libdir}/krb5/plugins/preauth/pkinit.so"
152FILES_${PN}-user = "${bindir}/k*"
153
154FILES_libgssapi-krb5 = "${libdir}/libgssapi_krb5${SOLIBS}"
155FILES_libgssrpc = "${libdir}/libgssrpc${SOLIBS}"
156FILES_libk5crypto = "${libdir}/libk5crypto${SOLIBS}"
157FILES_libkadm5clnt-mit = "${libdir}/libkadm5clnt_mit${SOLIBS}"
158FILES_libkadm5srv-mit = "${libdir}/libkadm5srv_mit${SOLIBS}"
159FILES_libkdb5 = "${libdir}/libkdb5${SOLIBS}"
160FILES_libkrad = "${libdir}/libkrad${SOLIBS}"
161FILES_libkrb5 = "${libdir}/libkrb5${SOLIBS} \
162 ${libdir}/krb5/plugins/authdata \
163 ${libdir}/krb5/plugins/libkrb5"
164FILES_libkrb5support = "${libdir}/libkrb5support${SOLIBS}"
165FILES_libverto = "${libdir}/libverto${SOLIBS}"
166
167RDEPENDS_${PN}-kadmin-server = "${PN}-kdc"
168RDEPENDS_${PN}-kpropd = "${PN}-kdc"
169
170INITSCRIPT_PACKAGES = "${PN}-admin-server ${PN}-kdc"
171INITSCRIPT_NAME_${PN}-admin-server = "krb5-admin-server"
172INITSCRIPT_NAME_${PN}-kdc = "krb5-kdc"
173
174SYSTEMD_PACKAGES = "${PN}-admin-server ${PN}-kdc"
175SYSTEMD_SERVICE_${PN}-admin-server = "krb5-admin-server.service"
176SYSTEMD_SERVICE_${PN}-kdc = "krb5-kdc.service"
177
178pkg_postinst_${PN}-kdc () {
179 if [ -z "$D" ]; then
180 if command -v systemd-tmpfiles >/dev/null; then
181 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
182 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
183 ${sysconfdir}/init.d/populate-volatile.sh update
184 fi
185 fi
186}
187
188BBCLASSEXTEND = "native nativesdk"