blob: b337df6ea48b29b6e0b54e89823b063cb85108bc [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001require pcp.inc
2#inherit perlnative
3
4# NOTE: the following prog dependencies are unknown, ignoring: gtar gzip pkgmk xmlto lzma qshape md5sum pod2man publican git makedepend qmake-qt4 xconfirm true gmake xz dblatex hdiutil rpm bzip2 which mkinstallp dtrace seinfo qmake-qt5 gawk dlltool rpmbuild dpkg makepkg qmake echo
5# NOTE: unable to map the following pkg-config dependencies: libmicrohttpd libsystemd-journal
6# (this is based on recipes that have previously been built and packaged)
7# NOTE: the following library dependencies are unknown, ignoring: nspr gen ibumad regex sasl2 pfm nss papi ibmad
8# (this is based on recipes that have previously been built and packaged)
9DEPENDS += "perl-native bison-native flex-native python3-native python3-setuptools python3 \
10 pcp-native cairo zlib ncurses readline libx11 avahi openssl"
11
12
13SRC_URI += "file://0001-Remove-unsuitble-part-for-cross-compile.patch \
14 file://pass-options-to-AR.patch \
15 file://fix_parallel_make.patch \
16 "
17
18export PCP_DIR="${RECIPE_SYSROOT_NATIVE}"
19#export PCP_RUN_DIR="${RECIPE_SYSROOT_NATIVE}"
20EXTRA_OEMAKE = "CC="${CC}" LD="${LD}""
Andrew Geissler8f840682023-07-21 09:09:43 -050021inherit useradd systemd features_check python3targetconfig
Andrew Geissler9aee5002022-03-30 16:27:02 +000022
23# Needs libx11
24REQUIRED_DISTRO_FEATURES = "x11"
25
26SYSTEMD_AUTO_ENABLE:${PN} = "enable"
Andrew Geissler8f840682023-07-21 09:09:43 -050027SYSTEMD_SERVICE:${PN} = "\
28 pmie_farm_check.service \
29 pmie_farm.service \
30 pmfind.service \
31 pmlogger_farm_check.service \
32 pmcd.service \
33 pmie.service \
34 pmlogger_daily.service \
35 pmlogger.service \
36 pmlogger_farm.service \
37 pmie_check.service \
38 pmproxy.service \
39 pmlogger_check.service \
40 pmie_daily.service"
Andrew Geissler9aee5002022-03-30 16:27:02 +000041
42USERADD_PACKAGES = "${PN}"
43USERADD_PARAM:${PN} = "--system --home ${localstatedir}/lib/pcp --no-create-home \
44 --user-group pcp"
45
Patrick Williams92b42cb2022-09-03 06:53:57 -050046USERADD_PACKAGES += "${PN}-testsuite"
Andrew Geissler9aee5002022-03-30 16:27:02 +000047USERADD_PARAM:${PN}-testsuite = "--system --home ${localstatedir}/lib/pcp/testsuite --no-create-home \
48 --user-group pcpqa"
49
50RDEPENDS:${PN} += "perl"
51RDEPENDS:${PN}-testsuite += "${PN} bash perl"
52RDEPENDS:python3-${PN} += "${PN} python3"
53
54do_configure:prepend () {
55 cp ${WORKDIR}/config.linux ${B}
56 rm -rf ${S}/include/pcp/configsz.h
57 rm -rf ${S}/include/pcp/platformsz.h
58 export SED=${TMPDIR}/hosttools/sed
59 export PYTHON=python3
60}
61
62do_compile:prepend() {
63 sed -i -e "s,#undef HAVE_64BIT_LONG,,g" \
64 -e "s,#undef HAVE_64BIT_PTR,,g" \
65 -e "s,#undef PM_SIZEOF_SUSECONDS_T,,g" \
66 -e "s,#undef PM_SIZEOF_TIME_T,,g" \
67 ${S}/src/include/pcp/config.h.in
68 sed -i -e "s,HAVE_PYTHON_ORDEREDDICT = false,HAVE_PYTHON_ORDEREDDICT = true,g" \
69 ${S}/src/include/builddefs
70 sed -i -e "s,TOPDIR)/python3-pcp.list,TOPDIR)/python3-pcp.list --install-lib=${PYTHON_SITEPACKAGES_DIR},g" ${S}/src/python/GNUmakefile
71 export PYTHON=python3
72 #export PYTHON3=${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}
73}
74
75do_compile() {
76 oe_runmake default_pcp
77}
78
79do_install () {
80 export NO_CHOWN=true
81 oe_runmake install DIST_ROOT=${D}\
82 install_pcp
83
84 rm -rf ${D}${localstatedir}/log
85 rm -rf ${D}${localstatedir}/lib/pcp/pmcd
86 rm -rf ${D}${localstatedir}/lib/pcp/tmp
87 rm -rf ${D}${localstatedir}/run
88 mv ${D}${docdir}/C* ${D}${docdir}/pcp-doc/
89 mv ${D}${docdir}/I* ${D}${docdir}/pcp-doc/
90 mv ${D}${docdir}/R* ${D}${docdir}/pcp-doc/
91 mv ${D}${docdir}/V* ${D}${docdir}/pcp-doc/
92 sed -i "s#PCP_AWK_PROG=.*#PCP_AWK_PROG=awk#" ${D}/${sysconfdir}/pcp.conf
93 sed -i "s#PCP_SORT_PROG=.*#PCP_SORT_PROG=sort#" ${D}/${sysconfdir}/pcp.conf
94 sed -i "s#PCP_ECHO_PROG=.*#PCP_ECHO_PROG=echo#" ${D}/${sysconfdir}/pcp.conf
95 sed -i "s#PCP_WHICH_PROG=.*#PCP_WHICH_PROG=which#" ${D}/${sysconfdir}/pcp.conf
96}
97
98PACKAGES += " ${PN}-export-zabbix-agent ${PN}-testsuite \
99 libpcp-gui2 libpcp-gui2-dev \
Andrew Geissler8f840682023-07-21 09:09:43 -0500100 libpcp-import1 libpcp-archive1 \
Andrew Geissler9aee5002022-03-30 16:27:02 +0000101 libpcp-mmv1 libpcp-mmv1-dev \
102 libpcp-pmda3 libpcp-pmda3-dev \
103 libpcp-trace2 libpcp-trace2-dev \
104 libpcp-web1 libpcp-web1-dev \
105 libpcp3 libpcp3-dev python3-${PN}\
106"
107FILES:libpcp-gui2 = "${libdir}/libpcp_gui.so.2 \
108"
Andrew Geissler8f840682023-07-21 09:09:43 -0500109FILES:libpcp-archive1 = "${libdir}/libpcp_archive.so.1 \
110"
Andrew Geissler9aee5002022-03-30 16:27:02 +0000111FILES:libpcp-gui2-dev = " \
112 ${libdir}/libpcp_gui.so \
113 ${libdir}/libpcp_gui.a \
114 ${includedir}/pmafm.h \
115 ${includedir}/pmtime.h \
116"
117FILES:libpcp-mmv1 = " \
118 ${libdir}/libpcp_mmv.so.1 \
119"
120FILES:libpcp-mmv1-dev = " \
121 ${libdir}/libpcp_mmv.a \
122 ${libdir}/libpcp_mmv.so \
123 ${libdir}/libpcp_mmv.so \
124 ${includedir}/mmv_stats.h \
125 ${includedir}/mmv_dev.h \
126 ${datadir}/man/man3/mmv_* \
127 ${datadir}/man/man5/mmv.5.gz \
128"
129FILES:libpcp-import1 = " \
130 ${libdir}/libpcp_import.so.1 \
131"
132FILES:libpcp-pmda3 = " \
133 ${libdir}/libpcp_pmda.so.3 \
134"
135FILES:libpcp-pmda3-dev = " \
136 ${includedir}/pmda.h \
137 ${includedir}/pmdaroot.h \
138 ${libdir}/libpcp_pmda.a \
139 ${libdir}/libpcp_pmda.so \
140 ${libdir}/pkgconfig/libpcp_pmda.pc \
141 ${datadir}/man/man3/PMDA.3.gz \
142 ${datadir}/man/man3/pmda* \
143"
144FILES:libpcp-trace2 = " \
145 ${libdir}/libpcp_trace.so.2 \
146"
147FILES:libpcp-trace2-dev = " \
148 ${includedir}/trace.h \
149 ${includedir}/trace_dev.h \
150 ${libdir}/libpcp_trace.a \
151 ${libdir}/libpcp_trace.so \
152 ${datadir}/man/man3/pmtrace* \
153"
154FILES:libpcp-web1 = " \
155 ${libdir}/libpcp_web.so.1 \
156"
157FILES:libpcp-web1-dev = " \
158 ${includedir}/pmhttp.h \
159 ${includedir}/pmjson.h \
160 ${libdir}/libpcp_web.a \
161 ${libdir}/libpcp_web.so \
162 ${datadir}/man/man3/pmhttp* \
163 ${datadir}/man/man3/pmjson* \
164"
165FILES:libpcp3 = " \
166 ${libdir}/libpcp.so.3 \
167"
168
169FILES:${PN} = " \
170 ${sysconfdir}/pcp \
171 ${sysconfdir}/cron.d \
172 ${sysconfdir}/init.d \
173 ${libexecdir} \
174 ${bindir} \
175 ${datadir}/bash-completion \
176 ${datadir}/pcp-gui \
177 ${datadir}/zsh \
178 ${systemd_system_unitdir}/ \
179 ${libdir}/pcp/ \
Andrew Geissler8f840682023-07-21 09:09:43 -0500180 ${libdir}/sysusers.d/pcp.conf \
Andrew Geissler9aee5002022-03-30 16:27:02 +0000181 ${datadir}/pcp \
182 ${libdir}/*.sh \
183 ${datadir}/man \
184 ${libdir}/rc-proc.sh.minimal \
185 ${sysconfdir}/p* \
186 ${sysconfdir}/s* \
187 ${localstatedir}/lib/pcp/config \
188 ${localstatedir}/lib/pcp/pmdas/ \
189 ${localstatedir}/lib/pcp/pmns \
190 ${libdir}/libpcp_fault.so.3 \
191"
192
193FILES:${PN}-export-zabbix-agent += " \
194 ${libdir}/zabbix \
195 ${sysconfdir}/zabbix \
196 ${mandir}/man3/zbxpcp.3.gz \
197 ${libdir}/zabbix \
198"
Andrew Geissler8f840682023-07-21 09:09:43 -0500199FILES:${PN}-testsuite = "${localstatedir}/lib/pcp/testsuite/ ${libdir}/sysusers.d/pcp-testsuite.conf"
Andrew Geissler9aee5002022-03-30 16:27:02 +0000200FILES:python3-${PN} = "${PYTHON_SITEPACKAGES_DIR}"
201FILES:${PN}-dev += " \
202 ${includedir}/pcp \
203 ${libdir}/libpcp.a \
204 ${libdir}/libpcp.so \
205 ${localstatedir}/lib/pcp/pmdas/*/*.so \
206 ${libexecdir}/pcp/bin/install-sh \
207 ${libdir}/pkgconfig/libpcp.pc \
208 ${libdir}/zabbix/modules/*.so \
209 ${datadir}/man/man3/LOGIMPORT.3.gz \
210 ${datadir}/man/man3/P* \
211 ${datadir}/man/man3/Q* \
212 ${datadir}/man/man3/__pm* \
213 ${datadir}/man/man3/pmA* \
214 ${datadir}/man/man3/pmC* \
215 ${datadir}/man/man3/pmD* \
216 ${datadir}/man/man3/pmE* \
217 ${datadir}/man/man3/pmF* \
218 ${datadir}/man/man3/pmG* \
219 ${datadir}/man/man3/pmH* \
220 ${datadir}/man/man3/pmI* \
221 ${datadir}/man/man3/pmL* \
222 ${datadir}/man/man3/pmM* \
223 ${datadir}/man/man3/pmN* \
224 ${datadir}/man/man3/pmO* \
225 ${datadir}/man/man3/pmP* \
226 ${datadir}/man/man3/pmR* \
227 ${datadir}/man/man3/pmS* \
228 ${datadir}/man/man3/pmT* \
229 ${datadir}/man/man3/pmU* \
230 ${datadir}/man/man3/pmW* \
231 ${datadir}/man/man3/pmf* \
232 ${datadir}/man/man3/pmg* \
233 ${datadir}/man/man3/pmi* \
234 ${datadir}/man/man3/pms* \
235 ${datadir}/man/man3/pmt* \
236"