GoogleGit

blob: 7018e2a237e1c021867d98f82e4d4a9e3da0e217 [file] [log] [blame]
  1. # Copyright 2014 The Chromium OS Authors. All rights reserved.
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. CROS_WORKON_INCREMENTAL_BUILD=1
  5. CROS_WORKON_USE_VCSID=1
  6. CROS_WORKON_LOCALNAME="platform2"
  7. CROS_WORKON_PROJECT="chromiumos/platform2"
  8. CROS_WORKON_DESTDIR="${S}/platform2"
  9. PLATFORM_SUBDIR="metrics"
  10. inherit cros-constants cros-workon platform
  11. DESCRIPTION="Metrics aggregation service for Chromium OS"
  12. HOMEPAGE="http://www.chromium.org/"
  13. LICENSE="BSD-Google"
  14. SLOT="0"
  15. KEYWORDS="~*"
  16. IUSE="metrics_uploader +passive_metrics"
  17. RDEPEND="
  18. chromeos-base/libchromeos
  19. chromeos-base/system_api
  20. dev-libs/dbus-glib
  21. dev-libs/protobuf
  22. sys-apps/rootdev
  23. "
  24. DEPEND="
  25. ${RDEPEND}
  26. chromeos-base/vboot_reference
  27. test? ( dev-cpp/gmock )
  28. dev-cpp/gtest
  29. "
  30. src_install() {
  31. dobin "${OUT}"/metrics_client
  32. if use passive_metrics; then
  33. dobin "${OUT}"/metrics_daemon
  34. insinto /etc/init
  35. doins init/metrics_library.conf init/metrics_daemon.conf
  36. if use metrics_uploader; then
  37. sed -i '/DAEMON_FLAGS=/s:=.*:="-uploader":' \
  38. "${D}"/etc/init/metrics_daemon.conf || die
  39. fi
  40. fi
  41. insinto /usr/$(get_libdir)/pkgconfig
  42. for v in "${LIBCHROME_VERS[@]}"; do
  43. ./platform2_preinstall.sh "${OUT}" "${v}"
  44. dolib.so "${OUT}/lib/libmetrics-${v}.so"
  45. doins "${OUT}/lib/libmetrics-${v}.pc"
  46. done
  47. insinto /usr/include/metrics
  48. doins c_metrics_library.h \
  49. metrics_library{,_mock}.h \
  50. timer{,_mock}.h
  51. # Install the protobuf so that autotests can have access to it.
  52. insinto /usr/include/metrics/proto
  53. doins uploader/proto/*.proto
  54. }
  55. platform_pkg_test() {
  56. local tests=(
  57. metrics_library_test
  58. $(usex passive_metrics 'metrics_daemon_test' '')
  59. persistent_integer_test
  60. timer_test
  61. upload_service_test
  62. )
  63. local test_bin
  64. for test_bin in "${tests[@]}"; do
  65. platform_test "run" "${OUT}/${test_bin}"
  66. done
  67. }