summaryrefslogtreecommitdiffstats
path: root/meta-app-framework/recipes-core/af-binder/af-binder_git.bb
blob: 4728e47ea0adf42ca68c403623226f327be75b92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
require af-binder_${PV}.inc

DEPENDS = "file json-c libmicrohttpd systemd util-linux openssl cynara"

inherit cmake pkgconfig

EXTRA_OECMAKE:append:class-target = "\
	-DUNITDIR_SYSTEM=${systemd_system_unitdir} \
"

EXTRA_OECMAKE:append:agl-devel = " \
	-DAGL_DEVEL=ON \
	-DINCLUDE_MONITORING=ON \
	-DINCLUDE_SUPERVISOR=ON -DAFS_SUPERVISION_SOCKET=/run/platform/supervisor \
"

pkg_postinst:${PN}() {
	mkdir -p "$D${libdir}/afb"
}

do_install:append:agl-devel:class-target() {
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d -m 0755 ${D}${systemd_system_unitdir}/multi-user.target.wants
        ln -s ../afm-api-supervisor.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-api-supervisor.service
    fi
}

#############################################
# main package
#############################################

FILES:${PN}:append:agl-devel = " ${libdir}/afb/monitoring ${systemd_system_unitdir}"

RDEPENDS:${PN}-dev += "libafbwsc-dev"

#############################################
# intrinsic binding packages
#############################################
PACKAGES =+ "${PN}-intrinsic-bindings"
ALLOW_EMPTY:${PN}-intrinsic-bindings = "1"

PACKAGES_DYNAMIC = "${PN}-binding-*"

python populate_packages:prepend () {
    afb_libdir = d.expand('${libdir}/afb')
    postinst = d.getVar('binding_postinst', True)
    pkgs = []

    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}'))
    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}'))

    d.setVar('RDEPENDS:' + d.getVar('PN', True) + '-intrinsic-bindings', ' '.join(pkgs))
}

#############################################
# tool package
#############################################
PACKAGES =+ "${PN}-tools"

FILES:${PN}-tools = "\
	${bindir}/afb-client-demo \
"

#############################################
# setup libafbwsc package
#############################################
PACKAGES =+ "libafbwsc libafbwsc-dev"

FILES:libafbwsc = "\
	${libdir}/libafbwsc.so.* \
"
FILES:libafbwsc-dev = "\
	${includedir}/afb/afb-wsj1.h \
	${includedir}/afb/afb-ws-client.h \
	${libdir}/libafbwsc.so \
	${libdir}/pkgconfig/libafbwsc.pc \
"

#############################################
# devtool package
#############################################
PACKAGES =+ "${PN}-devtools"

FILES:${PN}-devtools = "\
	${bindir}/afb-exprefs \
	${bindir}/afb-json2c \
	${bindir}/afb-genskel \
"

#############################################
# supervisor package
#############################################
PACKAGES:append:agl-devel = " ${PN}-supervisor "

FILES:${PN}-supervisor:agl-devel = "\
	${bindir}/afs-supervisor \
        ${systemd_system_unitdir} \
"

#############################################
# setup sample packages
#############################################
PACKAGES =+ "${PN}-samples"

FILES:${PN}-samples = "\
	${datadir}/af-binder \
"

#############################################
# meta package
#############################################
PACKAGES =+ "${PN}-meta"
ALLOW_EMPTY:${PN}-meta = "1"

RDEPENDS:${PN}-meta += "${PN} ${PN}-tools libafbwsc ${PN}-intrinsic-bindings"
RDEPENDS:${PN}-meta:append:agl-devel = " ${PN}-supervisor "