Convert to new override syntax
[AGL/meta-agl.git] / meta-app-framework / recipes-core / af-binder / af-binder_git.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_SUPERVISION_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 ../afm-api-supervisor.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-api-supervisor.service
25     fi
26 }
27
28 #############################################
29 # main package
30 #############################################
31
32 FILES:${PN}:append:agl-devel = " ${libdir}/afb/monitoring ${systemd_system_unitdir}"
33
34 RDEPENDS:${PN}-dev += "libafbwsc-dev"
35
36 #############################################
37 # intrinsic binding packages
38 #############################################
39 PACKAGES =+ "${PN}-intrinsic-bindings"
40 ALLOW_EMPTY:${PN}-intrinsic-bindings = "1"
41
42 PACKAGES_DYNAMIC = "${PN}-binding-*"
43
44 python populate_packages:prepend () {
45     afb_libdir = d.expand('${libdir}/afb')
46     postinst = d.getVar('binding_postinst', True)
47     pkgs = []
48
49     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}'))
50     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}'))
51
52     d.setVar('RDEPENDS:' + d.getVar('PN', True) + '-intrinsic-bindings', ' '.join(pkgs))
53 }
54
55 #############################################
56 # tool package
57 #############################################
58 PACKAGES =+ "${PN}-tools"
59
60 FILES:${PN}-tools = "\
61         ${bindir}/afb-client-demo \
62 "
63
64 #############################################
65 # setup libafbwsc package
66 #############################################
67 PACKAGES =+ "libafbwsc libafbwsc-dev"
68
69 FILES:libafbwsc = "\
70         ${libdir}/libafbwsc.so.* \
71 "
72 FILES:libafbwsc-dev = "\
73         ${includedir}/afb/afb-wsj1.h \
74         ${includedir}/afb/afb-ws-client.h \
75         ${libdir}/libafbwsc.so \
76         ${libdir}/pkgconfig/libafbwsc.pc \
77 "
78
79 #############################################
80 # devtool package
81 #############################################
82 PACKAGES =+ "${PN}-devtools"
83
84 FILES:${PN}-devtools = "\
85         ${bindir}/afb-exprefs \
86         ${bindir}/afb-json2c \
87         ${bindir}/afb-genskel \
88 "
89
90 #############################################
91 # supervisor package
92 #############################################
93 PACKAGES:append:agl-devel = " ${PN}-supervisor "
94
95 FILES:${PN}-supervisor:agl-devel = "\
96         ${bindir}/afs-supervisor \
97         ${systemd_system_unitdir} \
98 "
99
100 #############################################
101 # setup sample packages
102 #############################################
103 PACKAGES =+ "${PN}-samples"
104
105 FILES:${PN}-samples = "\
106         ${datadir}/af-binder \
107 "
108
109 #############################################
110 # meta package
111 #############################################
112 PACKAGES =+ "${PN}-meta"
113 ALLOW_EMPTY:${PN}-meta = "1"
114
115 RDEPENDS:${PN}-meta += "${PN} ${PN}-tools libafbwsc ${PN}-intrinsic-bindings"
116 RDEPENDS:${PN}-meta:append:agl-devel = " ${PN}-supervisor "
117