!1 Init package

From: @xinghe_1 
Reviewed-by: @xujing99, @jimmy_hero 
Signed-off-by: @jimmy_hero
This commit is contained in:
openeuler-ci-bot 2025-04-08 12:16:03 +00:00 committed by Gitee
commit 928873a488
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 125 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,74 @@
From eb14c2767bc7db6ea3de28669680a4bca54fe383 Mon Sep 17 00:00:00 2001
From: Michał Rostecki <mrostecki@suse.de>
Date: Tue, 8 Apr 2025 09:30:14 +0800
Subject: [PATCH] define a local repository for OpenSSL
Reference: https://build.opensuse.org/projects/openSUSE:Factory/packages/opencensus-cpp/files/opencensus-cpp.spec?expand=1
---
WORKSPACE | 22 +++++++++++++++++++++
opencensus/exporters/stats/prometheus/BUILD | 6 +++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/WORKSPACE b/WORKSPACE
index 1a4948f..89b5ac7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -47,3 +47,25 @@ grpc_extra_deps()
load("@com_github_jupp0r_prometheus_cpp//bazel:repositories.bzl", "prometheus_cpp_repositories")
prometheus_cpp_repositories()
+OPENSSL_BUILD_CONTENT = """
+cc_library(
+ name = "openssl-lib",
+ hdrs = glob([
+ "thirdparty_build/include/openssl",
+ "thirdparty_build/include/ssl",
+ ]),
+ copts = [
+ "-I/usr/include/openssl",
+ "-I/usr/include/ssl",
+ ],
+ linkopts = ["-lssl", "-lcrypto"],
+ visibility = ["//visibility:public"],
+ linkstatic = False,
+)
+"""
+
+new_local_repository(
+ name = "openssl",
+ path = "%{_libdir}",
+ build_file_content = OPENSSL_BUILD_CONTENT,
+)
diff --git a/opencensus/exporters/stats/prometheus/BUILD b/opencensus/exporters/stats/prometheus/BUILD
index 302724d..748c7e3 100644
--- a/opencensus/exporters/stats/prometheus/BUILD
+++ b/opencensus/exporters/stats/prometheus/BUILD
@@ -27,7 +27,7 @@ cc_library(
deps = [
":prometheus_utils",
"//opencensus/stats",
- "@com_github_jupp0r_prometheus_cpp//core",
+ "@com_github_jupp0r_prometheus_cpp//:core",
],
)
@@ -41,7 +41,7 @@ cc_library(
copts = DEFAULT_COPTS,
deps = [
"//opencensus/stats",
- "@com_github_jupp0r_prometheus_cpp//core",
+ "@com_github_jupp0r_prometheus_cpp//:core",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
@@ -69,7 +69,7 @@ cc_binary(
deps = [
":prometheus_exporter",
"//opencensus/stats",
- "@com_github_jupp0r_prometheus_cpp//pull",
+ "@com_github_jupp0r_prometheus_cpp//:pull",
"@com_google_absl//absl/time",
],
)
--
2.33.0

47
opencensus-cpp.spec Normal file
View File

@ -0,0 +1,47 @@
%global debug_package %{nil}
%define src_install_dir /usr/src/%{name}
%define version_unconverted 5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b
Name: opencensus-cpp
Version: %{version_unconverted}
Release: 1
Summary: A stats collection and distributed tracing framework
License: Apache-2.0
URL: https://github.com/census-instrumentation/opencensus-cpp
Source: https://github.com/census-instrumentation/opencensus-cpp/archive/%{version_unconverted}.tar.gz
BuildRequires: fdupes
Patch0: backport-define-a-local-repository-for-OpenSSL.patch
%description
OpenCensus is a toolkit for collecting application performance and behavior
data. It currently includes an API for tracing and stats.
%package source
Summary: Source code of opencensus-cpp
BuildArch: noarch
%description source
OpenCensus is a toolkit for collecting application performance and behavior
data. It currently includes an API for tracing and stats.
This package provides source code of opencensus-cpp.
%prep
%autosetup -p1 -n %{name}-%{version_unconverted}
%build
%install
mkdir -p %{buildroot}%{src_install_dir}
cp -r * %{buildroot}%{src_install_dir}
%fdupes %{buildroot}%{src_install_dir}
%files source
%license LICENSE
%doc README.md
%{src_install_dir}
%changelog
* Mon Apr 07 2025 xinghe <xinghe2@h-partners.com> - 5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b-1
- Init Package

4
opencensus-cpp.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: census-instrumentation/opencensus-cpp
tag_prefix: ^v
separator: .