blob: 0543d77a78736b36479a9ea66d7e2af457421f2c [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}""
21inherit useradd systemd features_check
22
23# Needs libx11
24REQUIRED_DISTRO_FEATURES = "x11"
25
26SYSTEMD_AUTO_ENABLE:${PN} = "enable"
27SYSTEMD_SERVICE:${PN} = "pmcd.service pmcd.service pmie_check.service pmie_farm_check.service \
28 pmlogger_daily.service pmlogger_farm_check.service pmfind.service \
29 pmie_daily.service pmlogger.service pmlogger_daily_report.service \
30 pmproxy.service pmie.service pmie_farm.service pmlogger_check.service \
31 pmlogger_farm.service"
32
33USERADD_PACKAGES = "${PN}"
34USERADD_PARAM:${PN} = "--system --home ${localstatedir}/lib/pcp --no-create-home \
35 --user-group pcp"
36
Patrick Williams92b42cb2022-09-03 06:53:57 -050037USERADD_PACKAGES += "${PN}-testsuite"
Andrew Geissler9aee5002022-03-30 16:27:02 +000038USERADD_PARAM:${PN}-testsuite = "--system --home ${localstatedir}/lib/pcp/testsuite --no-create-home \
39 --user-group pcpqa"
40
41RDEPENDS:${PN} += "perl"
42RDEPENDS:${PN}-testsuite += "${PN} bash perl"
43RDEPENDS:python3-${PN} += "${PN} python3"
44
45do_configure:prepend () {
46 cp ${WORKDIR}/config.linux ${B}
47 rm -rf ${S}/include/pcp/configsz.h
48 rm -rf ${S}/include/pcp/platformsz.h
49 export SED=${TMPDIR}/hosttools/sed
50 export PYTHON=python3
51}
52
53do_compile:prepend() {
54 sed -i -e "s,#undef HAVE_64BIT_LONG,,g" \
55 -e "s,#undef HAVE_64BIT_PTR,,g" \
56 -e "s,#undef PM_SIZEOF_SUSECONDS_T,,g" \
57 -e "s,#undef PM_SIZEOF_TIME_T,,g" \
58 ${S}/src/include/pcp/config.h.in
59 sed -i -e "s,HAVE_PYTHON_ORDEREDDICT = false,HAVE_PYTHON_ORDEREDDICT = true,g" \
60 ${S}/src/include/builddefs
61 sed -i -e "s,TOPDIR)/python3-pcp.list,TOPDIR)/python3-pcp.list --install-lib=${PYTHON_SITEPACKAGES_DIR},g" ${S}/src/python/GNUmakefile
62 export PYTHON=python3
63 #export PYTHON3=${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}
64}
65
66do_compile() {
67 oe_runmake default_pcp
68}
69
70do_install () {
71 export NO_CHOWN=true
72 oe_runmake install DIST_ROOT=${D}\
73 install_pcp
74
75 rm -rf ${D}${localstatedir}/log
76 rm -rf ${D}${localstatedir}/lib/pcp/pmcd
77 rm -rf ${D}${localstatedir}/lib/pcp/tmp
78 rm -rf ${D}${localstatedir}/run
79 mv ${D}${docdir}/C* ${D}${docdir}/pcp-doc/
80 mv ${D}${docdir}/I* ${D}${docdir}/pcp-doc/
81 mv ${D}${docdir}/R* ${D}${docdir}/pcp-doc/
82 mv ${D}${docdir}/V* ${D}${docdir}/pcp-doc/
83 sed -i "s#PCP_AWK_PROG=.*#PCP_AWK_PROG=awk#" ${D}/${sysconfdir}/pcp.conf
84 sed -i "s#PCP_SORT_PROG=.*#PCP_SORT_PROG=sort#" ${D}/${sysconfdir}/pcp.conf
85 sed -i "s#PCP_ECHO_PROG=.*#PCP_ECHO_PROG=echo#" ${D}/${sysconfdir}/pcp.conf
86 sed -i "s#PCP_WHICH_PROG=.*#PCP_WHICH_PROG=which#" ${D}/${sysconfdir}/pcp.conf
87}
88
89PACKAGES += " ${PN}-export-zabbix-agent ${PN}-testsuite \
90 libpcp-gui2 libpcp-gui2-dev \
91 libpcp-import1 \
92 libpcp-mmv1 libpcp-mmv1-dev \
93 libpcp-pmda3 libpcp-pmda3-dev \
94 libpcp-trace2 libpcp-trace2-dev \
95 libpcp-web1 libpcp-web1-dev \
96 libpcp3 libpcp3-dev python3-${PN}\
97"
98FILES:libpcp-gui2 = "${libdir}/libpcp_gui.so.2 \
99"
100FILES:libpcp-gui2-dev = " \
101 ${libdir}/libpcp_gui.so \
102 ${libdir}/libpcp_gui.a \
103 ${includedir}/pmafm.h \
104 ${includedir}/pmtime.h \
105"
106FILES:libpcp-mmv1 = " \
107 ${libdir}/libpcp_mmv.so.1 \
108"
109FILES:libpcp-mmv1-dev = " \
110 ${libdir}/libpcp_mmv.a \
111 ${libdir}/libpcp_mmv.so \
112 ${libdir}/libpcp_mmv.so \
113 ${includedir}/mmv_stats.h \
114 ${includedir}/mmv_dev.h \
115 ${datadir}/man/man3/mmv_* \
116 ${datadir}/man/man5/mmv.5.gz \
117"
118FILES:libpcp-import1 = " \
119 ${libdir}/libpcp_import.so.1 \
120"
121FILES:libpcp-pmda3 = " \
122 ${libdir}/libpcp_pmda.so.3 \
123"
124FILES:libpcp-pmda3-dev = " \
125 ${includedir}/pmda.h \
126 ${includedir}/pmdaroot.h \
127 ${libdir}/libpcp_pmda.a \
128 ${libdir}/libpcp_pmda.so \
129 ${libdir}/pkgconfig/libpcp_pmda.pc \
130 ${datadir}/man/man3/PMDA.3.gz \
131 ${datadir}/man/man3/pmda* \
132"
133FILES:libpcp-trace2 = " \
134 ${libdir}/libpcp_trace.so.2 \
135"
136FILES:libpcp-trace2-dev = " \
137 ${includedir}/trace.h \
138 ${includedir}/trace_dev.h \
139 ${libdir}/libpcp_trace.a \
140 ${libdir}/libpcp_trace.so \
141 ${datadir}/man/man3/pmtrace* \
142"
143FILES:libpcp-web1 = " \
144 ${libdir}/libpcp_web.so.1 \
145"
146FILES:libpcp-web1-dev = " \
147 ${includedir}/pmhttp.h \
148 ${includedir}/pmjson.h \
149 ${libdir}/libpcp_web.a \
150 ${libdir}/libpcp_web.so \
151 ${datadir}/man/man3/pmhttp* \
152 ${datadir}/man/man3/pmjson* \
153"
154FILES:libpcp3 = " \
155 ${libdir}/libpcp.so.3 \
156"
157
158FILES:${PN} = " \
159 ${sysconfdir}/pcp \
160 ${sysconfdir}/cron.d \
161 ${sysconfdir}/init.d \
162 ${libexecdir} \
163 ${bindir} \
164 ${datadir}/bash-completion \
165 ${datadir}/pcp-gui \
166 ${datadir}/zsh \
167 ${systemd_system_unitdir}/ \
168 ${libdir}/pcp/ \
169 ${datadir}/pcp \
170 ${libdir}/*.sh \
171 ${datadir}/man \
172 ${libdir}/rc-proc.sh.minimal \
173 ${sysconfdir}/p* \
174 ${sysconfdir}/s* \
175 ${localstatedir}/lib/pcp/config \
176 ${localstatedir}/lib/pcp/pmdas/ \
177 ${localstatedir}/lib/pcp/pmns \
178 ${libdir}/libpcp_fault.so.3 \
179"
180
181FILES:${PN}-export-zabbix-agent += " \
182 ${libdir}/zabbix \
183 ${sysconfdir}/zabbix \
184 ${mandir}/man3/zbxpcp.3.gz \
185 ${libdir}/zabbix \
186"
187FILES:${PN}-testsuite = "${localstatedir}/lib/pcp/testsuite/"
188FILES:python3-${PN} = "${PYTHON_SITEPACKAGES_DIR}"
189FILES:${PN}-dev += " \
190 ${includedir}/pcp \
191 ${libdir}/libpcp.a \
192 ${libdir}/libpcp.so \
193 ${localstatedir}/lib/pcp/pmdas/*/*.so \
194 ${libexecdir}/pcp/bin/install-sh \
195 ${libdir}/pkgconfig/libpcp.pc \
196 ${libdir}/zabbix/modules/*.so \
197 ${datadir}/man/man3/LOGIMPORT.3.gz \
198 ${datadir}/man/man3/P* \
199 ${datadir}/man/man3/Q* \
200 ${datadir}/man/man3/__pm* \
201 ${datadir}/man/man3/pmA* \
202 ${datadir}/man/man3/pmC* \
203 ${datadir}/man/man3/pmD* \
204 ${datadir}/man/man3/pmE* \
205 ${datadir}/man/man3/pmF* \
206 ${datadir}/man/man3/pmG* \
207 ${datadir}/man/man3/pmH* \
208 ${datadir}/man/man3/pmI* \
209 ${datadir}/man/man3/pmL* \
210 ${datadir}/man/man3/pmM* \
211 ${datadir}/man/man3/pmN* \
212 ${datadir}/man/man3/pmO* \
213 ${datadir}/man/man3/pmP* \
214 ${datadir}/man/man3/pmR* \
215 ${datadir}/man/man3/pmS* \
216 ${datadir}/man/man3/pmT* \
217 ${datadir}/man/man3/pmU* \
218 ${datadir}/man/man3/pmW* \
219 ${datadir}/man/man3/pmf* \
220 ${datadir}/man/man3/pmg* \
221 ${datadir}/man/man3/pmi* \
222 ${datadir}/man/man3/pms* \
223 ${datadir}/man/man3/pmt* \
224"
225#| chkacc1.c:8:10: fatal error: localconfig.h: No such file or directory
226#| 8 | #include "localconfig.h"
227#| | ^~~~~~~~~~~~~~~
228PARALLEL_MAKE = ""