GoogleGit

blob: 6dd1a1e3b3b0bcd879a340c3d529f6a3e6ea96fc [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 git-2 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="+passive_metrics"
  17. RDEPEND="
  18. chromeos-base/libchromeos
  19. !<chromeos-base/platform2-0.0.4
  20. chromeos-base/system_api
  21. >=dev-cpp/gflags-2.0
  22. dev-libs/dbus-glib
  23. sys-apps/rootdev
  24. "
  25. DEPEND="
  26. ${RDEPEND}
  27. chromeos-base/vboot_reference
  28. test? ( dev-cpp/gmock )
  29. dev-cpp/gtest
  30. "
  31. src_unpack() {
  32. platform_src_unpack
  33. EGIT_REPO_URI="${CROS_GIT_HOST_URL}/chromium/src/components/metrics.git" \
  34. EGIT_SOURCEDIR="${S}/components/metrics" \
  35. EGIT_PROJECT="metrics" \
  36. EGIT_COMMIT="98a769a9a70b2ff0dbcf4962c5d79b29a60c8860" \
  37. git-2_src_unpack
  38. }
  39. src_install() {
  40. dobin "${OUT}"/metrics_client syslog_parser.sh
  41. if use passive_metrics; then
  42. dobin "${OUT}"/metrics_daemon
  43. insinto /etc/init
  44. doins init/metrics_library.conf
  45. doins init/metrics_daemon.conf
  46. fi
  47. insinto /usr/$(get_libdir)/pkgconfig
  48. for v in "${LIBCHROME_VERS[@]}"; do
  49. ./platform2_preinstall.sh "${OUT}" "${v}"
  50. dolib.so "${OUT}/lib/libmetrics-${v}.so"
  51. doins "${OUT}/lib/libmetrics-${v}.pc"
  52. done
  53. insinto /usr/include/metrics
  54. doins c_metrics_library.h \
  55. metrics_library{,_mock}.h \
  56. timer{,_mock}.h
  57. }
  58. platform_pkg_test() {
  59. local tests=(
  60. metrics_library_test
  61. $(usex passive_metrics 'metrics_daemon_test' '')
  62. persistent_integer_test
  63. timer_test
  64. upload_service_test
  65. )
  66. local test_bin
  67. for test_bin in "${tests[@]}"; do
  68. platform_test "run" "${OUT}/${test_bin}"
  69. done
  70. }