blob: 06f7f90bdc0242fd7403329d0403fabef46e3ee3 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "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"
Patrick Williamsddad1a12017-02-23 20:36:32 -060017LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=c6f37efad53b098e420f45e7ab6807dc"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native"
19
Patrick Williamsddad1a12017-02-23 20:36:32 -060020inherit autotools-brokensep binconfig perlnative systemd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050021
22SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
Patrick Williamsddad1a12017-02-23 20:36:32 -060023SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}.tar.gz \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050024 file://0001-aclocal-Add-parameter-to-disable-keyutils-detection.patch \
25 file://debian-suppress-usr-lib-in-krb5-config.patch;striplevel=2 \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050026 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 \
Patrick Williamsddad1a12017-02-23 20:36:32 -060031 file://krb5-kdc.service \
32 file://krb5-admin-server.service \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050033"
Patrick Williamsddad1a12017-02-23 20:36:32 -060034SRC_URI[md5sum] = "6164ca9c075b4ecc68eadd6d13040417"
35SRC_URI[sha256sum] = "9c0a46b8918237a53916370d2e02298c2b294f55f0351f9404e18930bc26badc"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050036
37S = "${WORKDIR}/${BP}/src"
38
Patrick Williamsddad1a12017-02-23 20:36:32 -060039SYSTEMD_SERVICE_${PN} = "krb5-admin-server.service krb5-kdc.service"
40SYSTEMD_AUTO_ENABLE = "disable"
41
Patrick Williamsb48b7b42016-08-17 15:04:38 -050042PACKAGECONFIG ??= "openssl"
43PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
44PACKAGECONFIG[openssl] = "--with-pkinit-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"
48
49EXTRA_OECONF += " --without-tcl --with-system-et --disable-rpath"
50CACHED_CONFIGUREVARS += "krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
51 ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
52 ac_cv_file__etc_TIMEZONE=no"
53
Patrick Williamsddad1a12017-02-23 20:36:32 -060054CFLAGS_append = " -fPIC -DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
55LDFLAGS_append = " -pthread"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050056
57FILES_${PN} += "${datadir}/gnats"
58FILES_${PN}-doc += "${datadir}/examples"
59FILES_${PN}-dbg += "${libdir}/krb5/plugins/*/.debug"
60
61# As this recipe doesn't inherit update-rc.d, we need to add this dependency here
62RDEPENDS_${PN}_class-target += "initscripts-functions"
63
Patrick Williamsb48b7b42016-08-17 15:04:38 -050064do_configure() {
65 gnu-configize --force
66 autoreconf
67 oe_runconf
68}
69
70do_install_append() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050071 rm -rf ${D}/${localstatedir}/run
Patrick Williamsddad1a12017-02-23 20:36:32 -060072
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 fi
Patrick Williamsb48b7b42016-08-17 15:04:38 -050082 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
83 install -d ${D}${sysconfdir}/tmpfiles.d
84 echo "d /run/krb5kdc - - - -" \
85 > ${D}${sysconfdir}/tmpfiles.d/krb5.conf
Patrick Williamsb48b7b42016-08-17 15:04:38 -050086
Patrick Williamsddad1a12017-02-23 20:36:32 -060087 install -d ${D}${systemd_system_unitdir}
88 install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
89 install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
90 fi
Patrick Williamsb48b7b42016-08-17 15:04:38 -050091}
92
93pkg_postinst_${PN} () {
94 if [ -z "$D" ]; then
95 if command -v systemd-tmpfiles >/dev/null; then
96 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/krb5.conf
97 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
98 ${sysconfdir}/init.d/populate-volatile.sh update
99 fi
100 fi
101}
102
103BBCLASSEXTEND = "native nativesdk"