af-binder: Upgrade
[AGL/meta-agl.git] / meta-app-framework / recipes-core / af-binder / af-binder_1.0.bb
1 require af-binder_${PV}.inc
2
3 DEPENDS = "file json-c libmicrohttpd systemd util-linux openssl cynara"
4
5 inherit cmake pkgconfig
6
7 EXTRA_OECMAKE_append_class-target = "\
8         -DUNITDIR_SYSTEM=${systemd_system_unitdir} \
9 "
10
11 EXTRA_OECMAKE_append_agl-devel = " \
12         -DAGL_DEVEL=ON \
13         -DINCLUDE_MONITORING=ON \
14         -DINCLUDE_SUPERVISOR=ON -DAFS_SURPERVISION_SOCKET=/run/platform/supervisor \
15 "
16
17 pkg_postinst_${PN}() {
18         mkdir -p "$D${libdir}/afb"
19 }
20
21 do_install_append_agl-devel_class-target() {
22     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
23         install -d -m 0755 ${D}${systemd_system_unitdir}/multi-user.target.wants
24         ln -s ../afs-supervisor.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afs-supervisor.service
25     fi
26 }
27
28 #############################################
29 # setup package
30 #############################################
31 PACKAGES =+ "${PN}-tools ${PN}-devtools ${PN}-meta"
32
33 FILES_${PN} += "${datadir}"
34
35 FILES_${PN}_append_agl-devel = " ${libdir}/afb/monitoring ${systemd_system_unitdir}"
36
37 ALLOW_EMPTY_${PN}-meta = "1"
38
39 FILES_${PN}-tools = "\
40         ${bindir}/afb-client-demo \
41 "
42
43 FILES_${PN}-devtools = "\
44         ${bindir}/afb-exprefs \
45         ${bindir}/afb-json2c \
46         ${bindir}/afb-genskel \
47 "
48
49 RDEPENDS_${PN}-dev += "libafbwsc-dev"
50
51 #############################################
52 # setup sample binding packages
53 #############################################
54 PACKAGES_DYNAMIC = "${PN}-binding-*"
55
56 python populate_packages_prepend () {
57     afb_libdir = d.expand('${libdir}/afb')
58     postinst = d.getVar('binding_postinst', True)
59     pkgs = []
60     pkgs_dbg = []
61
62     pkgs += do_split_packages(d, afb_libdir, '(.*)-api\.so$', d.expand('${PN}-binding-%s'), 'AFB binding for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
63     pkgs += do_split_packages(d, afb_libdir, '(.*(?!-api))\.so$', d.expand('${PN}-binding-%s'), 'AFB binding for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
64
65     pkgs_dbg += do_split_packages(d, oe.path.join(afb_libdir, ".debug"), '(.*)-api\.so$', d.expand('${PN}-binding-%s-dbg'), 'AFB binding for %s, debug info', postinst=postinst, extra_depends=d.expand('${PN}'))
66     pkgs_dbg += do_split_packages(d, oe.path.join(afb_libdir, ".debug"), '(.*(?!-api))\.so$', d.expand('${PN}-binding-%s-dbg'), 'AFB binding for %s, debug info', postinst=postinst, extra_depends=d.expand('${PN}'))
67
68     metapkg = d.getVar('PN', True) + '-meta'
69     d.setVar('RDEPENDS_' + metapkg, ' '.join(pkgs))
70 }
71
72 #############################################
73 # setup libafbwsc package
74 #############################################
75 PACKAGES =+ "libafbwsc libafbwsc-dev libafbwsc-dbg"
76
77 FILES_libafbwsc = "\
78         ${libdir}/libafbwsc.so.* \
79 "
80 FILES_libafbwsc-dev = "\
81         ${includedir}/afb/afb-wsj1.h \
82         ${includedir}/afb/afb-ws-client.h \
83         ${libdir}/libafbwsc.so \
84         ${libdir}/pkgconfig/libafbwsc.pc \
85 "
86 FILES_libafbwsc-dbg = "\
87         ${libdir}/.debug/libafbwsc.so.* \
88         ${bindir}/.debug/afb-client-demo \
89 "
90 RDEPENDS_libafbwsc-dbg += "${PN}-dbg libafbwsc-dev"
91
92