Merge branch 'org.openembedded.dev' of git@git.openembedded.org:openembedded into...
[openembedded.git] / recipes / krb / krb5_1.6.3.bb
1 DESCRIPTION = "A network authentication protocol"
2 HOMEPAGE = "http://web.mit.edu/Kerberos/"
3 SECTION = "console/network"
4 PR = "r6"
5 LICENSE = "MIT"
6 DEPENDS = "perl-native ncurses e2fsprogs-libs e2fsprogs-native"
7
8 inherit autotools binconfig
9
10 SRC_URI = "http://web.mit.edu/kerberos/dist/krb5/1.6/krb5-1.6.3-signed.tar \
11            file://fix-uclibc-ruserpass-collision.patch \
12            file://copyperms.patch"
13 S = "${WORKDIR}/${PN}-${PV}/src/"
14
15 # Will clean this up...
16 EXTRA_OECONF += " krb5_cv_attr_constructor_destructor=yes ac_cv_func_regcomp=yes \
17                   ac_cv_printf_positional=yes ac_cv_file__etc_environment=yes \
18                   ac_cv_file__etc_TIMEZONE=no --with-system-et"
19 CFLAGS_append += "-DDESTRUCTOR_ATTR_WORKS=1 -I${STAGING_INCDIR}/et"
20 LDFLAGS_append += "-lpthread"
21
22 FILES_${PN}-doc += /usr/share/examples
23
24 krb5_do_unpack() {
25         tar xzf ${WORKDIR}/krb5-1.6.3.tar.gz -C ${WORKDIR}/
26         patch -d ${S} -p1 < ${WORKDIR}/fix-uclibc-ruserpass-collision.patch
27         patch -d ${S} -p1 < ${WORKDIR}/copyperms.patch
28 }
29
30 python do_unpack() {
31         bb.build.exec_func('base_do_unpack', d)
32         bb.build.exec_func('krb5_do_unpack', d)
33 }
34
35 do_configure() {
36         oe_runconf
37 }
38
39 do_install_append () {
40         mv ${D}${bindir}/ftp ${D}${bindir}/ftp.${PN}
41         mv ${D}${sbindir}/ftpd ${D}${sbindir}/ftpd.${PN}
42         mv ${D}${bindir}/telnet ${D}${bindir}/telnet.${PN}
43         mv ${D}${sbindir}/telnetd ${D}${sbindir}/telnetd.${PN}
44 }
45
46 pkg_postinst_${PN} () {
47 #!/bin/sh
48         update-alternatives --install ${bindir}/ftp ftp ftp.${PN} 100
49         update-alternatives --install ${sbindir}/ftpd ftpd ftpd.${PN} 100
50         update-alternatives --install ${bindir}/telnet telnet telnet.${PN} 100
51         update-alternatives --install ${sbindir}/telnetd telnetd telnetd.${PN} 100
52 }
53
54 pkg_prerm_${PN} () {
55 #!/bin/sh
56         update-alternatives --remove ftp ftp.${PN} 100
57         update-alternatives --remove ftpd ftpd.${PN} 100
58         update-alternatives --remove telnet telnet.${PN} 100
59         update-alternatives --remove telnetd telnetd.${PN} 100
60 }
61
62 do_stage() {
63         oe_libinstall -so -C util/support libkrb5support ${STAGING_LIBDIR}
64         oe_libinstall -so -C util/et libcom_err ${STAGING_LIBDIR}
65         oe_libinstall -so -C lib/crypto libk5crypto ${STAGING_LIBDIR}
66         oe_libinstall -so -C lib/krb5 libkrb5 ${STAGING_LIBDIR}
67         oe_libinstall -so -C lib/des425 libdes425 ${STAGING_LIBDIR}
68         oe_libinstall -so -C lib/krb4 libkrb4 ${STAGING_LIBDIR}
69         oe_libinstall -so -C lib/gssapi libgssapi_krb5 ${STAGING_LIBDIR}
70         oe_libinstall -so -C lib/rpc libgssrpc ${STAGING_LIBDIR}
71         oe_libinstall -so -C lib/kdb libkdb5 ${STAGING_LIBDIR}
72         oe_libinstall -so -C lib/kadm5/clnt libkadm5clnt ${STAGING_LIBDIR}
73         oe_libinstall -so -C lib/kadm5/srv libkadm5srv ${STAGING_LIBDIR}
74
75         install -d ${STAGING_INCDIR}/krb5
76         for X in krb5.h locate_plugin.h
77         do
78                 install -m 0644 ${S}/include/krb5/$X ${STAGING_INCDIR}/krb5/$X
79         done
80
81         install -d ${STAGING_INCDIR}/gssapi
82         for X in gssapi_generic.h gssapi.h gssapi_krb5.h
83         do
84                 install -m 0644 ${S}/include/gssapi/$X ${STAGING_INCDIR}/gssapi/$X
85         done
86         install -m 0644 ${S}/lib/gssapi/mechglue/mechglue.h ${STAGING_INCDIR}/gssapi/mechglue.h
87
88         install -d ${STAGING_INCDIR}/kerberosIV
89         for X in krb.h des.h mit-copyright.h krb_err.h kadm_err.h
90         do
91                 install -m 0644 ${S}/include/kerberosIV/$X ${STAGING_INCDIR}/kerberosIV/$X
92         done
93
94         install -d ${STAGING_INCDIR}/gssrpc
95         for X in auth.h auth_gss.h auth_gssapi.h auth_unix.h clnt.h netdb.h pmap_clnt.h pmap_prot.h pmap_rmt.h rename.h rpc.h rpc_msg.h svc.h svc_auth.h xdr.h types.h
96         do
97                 install -m 0644 ${S}/include/gssrpc/$X ${STAGING_INCDIR}/gssrpc/$X
98         done
99
100         # com_err.h needs to be added here if you choose to use this builtin
101         for X in krb5.h profile.h gssapi.h
102         do
103                 install -m 0644 ${S}/include/$X ${STAGING_INCDIR}/$X
104         done
105 }