diff --git a/5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b.tar.gz b/5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b.tar.gz new file mode 100644 index 0000000..563f158 Binary files /dev/null and b/5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b.tar.gz differ diff --git a/backport-define-a-local-repository-for-OpenSSL.patch b/backport-define-a-local-repository-for-OpenSSL.patch new file mode 100644 index 0000000..2f6903f --- /dev/null +++ b/backport-define-a-local-repository-for-OpenSSL.patch @@ -0,0 +1,74 @@ +From eb14c2767bc7db6ea3de28669680a4bca54fe383 Mon Sep 17 00:00:00 2001 +From: MichaƂ Rostecki +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 \ No newline at end of file diff --git a/opencensus-cpp.spec b/opencensus-cpp.spec new file mode 100644 index 0000000..389f91d --- /dev/null +++ b/opencensus-cpp.spec @@ -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 - 5e5f2632c84e2230fb7ccb8e336f603d2ec6aa1b-1 +- Init Package diff --git a/opencensus-cpp.yaml b/opencensus-cpp.yaml new file mode 100644 index 0000000..0521400 --- /dev/null +++ b/opencensus-cpp.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: census-instrumentation/opencensus-cpp +tag_prefix: ^v +separator: .