!13 [sync] PR-12: Update package to version 0.15.0
From: @openeuler-sync-bot Reviewed-by: @jxy_git Signed-off-by: @jxy_git
This commit is contained in:
commit
d6ea560f1a
@ -1,8 +1,19 @@
|
|||||||
--- c/.promu.yml 2023-03-07 11:30:19.037256381 +0800
|
From b754346641b7875dc920c26dcf96a7541e5365ba Mon Sep 17 00:00:00 2001
|
||||||
+++ a/.promu.yml 2023-03-07 11:32:48.661260604 +0800
|
From: jxy_git <jiangxinyu@kylinos.cn>
|
||||||
@@ -7,12 +7,11 @@ repository:
|
Date: Thu, 7 Sep 2023 16:02:54 +0800
|
||||||
build:
|
Subject: [PATCH] add parameters to solve the strip
|
||||||
flags: -mod=vendor -a -tags 'netgo static_build'
|
|
||||||
|
---
|
||||||
|
.promu.yml | 11 +++++------
|
||||||
|
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/.promu.yml b/.promu.yml
|
||||||
|
index 45081b8..d586c86 100644
|
||||||
|
--- a/.promu.yml
|
||||||
|
+++ b/.promu.yml
|
||||||
|
@@ -10,12 +10,11 @@ build:
|
||||||
|
windows: [static_build]
|
||||||
|
flags: -a
|
||||||
ldflags: |
|
ldflags: |
|
||||||
- -s
|
- -s
|
||||||
- -X github.com/prometheus/common/version.Version={{.Version}}
|
- -X github.com/prometheus/common/version.Version={{.Version}}
|
||||||
@ -18,3 +29,6 @@
|
|||||||
tarball:
|
tarball:
|
||||||
files:
|
files:
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
||||||
|
|||||||
BIN
promu-0.15.0.tar.gz
Normal file
BIN
promu-0.15.0.tar.gz
Normal file
Binary file not shown.
BIN
promu-vendor.tar.gz
Normal file
BIN
promu-vendor.tar.gz
Normal file
Binary file not shown.
41
promu.spec
41
promu.spec
@ -1,46 +1,47 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Name: promu
|
Name: promu
|
||||||
Version: 0.7.0
|
Version: 0.15.0
|
||||||
Release: 4
|
Release: 1
|
||||||
Summary: Prometheus Utility Tool
|
Summary: Prometheus Utility Tool
|
||||||
License: ASL 2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/prometheus/promu
|
URL: https://github.com/prometheus/promu
|
||||||
|
Source0: https://github.com/prometheus/promu/archive/refs/tags/v%{version}.tar.gz#/promu-0.15.0.tar.gz
|
||||||
|
# tar -xvf Source0
|
||||||
|
# run 'go mod vendor' in it
|
||||||
|
# tar -czvf promu-vendor.tar.gz vendor
|
||||||
|
Source1: promu-vendor.tar.gz
|
||||||
|
Patch0: add-parameters-to-solve-the-strip.patch
|
||||||
|
|
||||||
Source0: https://github.com/prometheus/promu/archive/v%{version}.tar.gz
|
BuildRequires: golang >= 1.14
|
||||||
Patch0: add-parameters-to-solve-the-strip.patch
|
BuildRequires: gcc
|
||||||
|
|
||||||
#RISC-V support
|
Conflicts: promu
|
||||||
Patch100: riscv64-support.patch
|
Provides: %{name} = %{version}-%{release}
|
||||||
|
|
||||||
BuildRequires: golang >= 1.13
|
|
||||||
BuildRequires: gcc
|
|
||||||
|
|
||||||
Conflicts: promu
|
|
||||||
Provides: %{name} = %{version}
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
promu is the utility tool for building and releasing Prometheus projects
|
promu is the utility tool for building and releasing Prometheus projects
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -T -n %{name}-%{version} -b 0
|
%setup -q -T -n %{name}-%{version} -b 0
|
||||||
|
tar -xzvf %{SOURCE1}
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%ifarch riscv64
|
|
||||||
%patch100 -p1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export GOFLAGS="-mod=vendor -buildmode=pie"
|
export GOFLAGS="-mod=vendor -buildmode=pie"
|
||||||
make build
|
make build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -D -m 755 %{name}-%{version} %{buildroot}%{_bindir}/promu
|
install -D -m 0755 %{name}-%{version} %{buildroot}%{_bindir}/promu
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{_bindir}/promu
|
%{_bindir}/promu
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 07 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.15.0-1
|
||||||
|
- Update package to version 0.15.0
|
||||||
|
|
||||||
* Wed Jun 14 2023 EastDong <xudong23@iscas.ac.cn> - 0.7.0-4
|
* Wed Jun 14 2023 EastDong <xudong23@iscas.ac.cn> - 0.7.0-4
|
||||||
- backport to support riscv
|
- backport to support riscv
|
||||||
|
|
||||||
|
|||||||
@ -1,84 +0,0 @@
|
|||||||
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
|
|
||||||
index 31d42f7..02693d1 100644
|
|
||||||
--- a/vendor/github.com/prometheus/procfs/cpuinfo.go
|
|
||||||
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
|
|
||||||
@@ -19,6 +19,7 @@ import (
|
|
||||||
"bufio"
|
|
||||||
"bytes"
|
|
||||||
"errors"
|
|
||||||
+ "fmt"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
@@ -407,6 +408,46 @@ func parseCPUInfoPPC(info []byte) ([]CPUInfo, error) {
|
|
||||||
return cpuinfo, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
+func parseCPUInfoRISCV(info []byte) ([]CPUInfo, error) {
|
|
||||||
+ scanner := bufio.NewScanner(bytes.NewReader(info))
|
|
||||||
+
|
|
||||||
+ firstLine := firstNonEmptyLine(scanner)
|
|
||||||
+ if !strings.HasPrefix(firstLine, "processor") || !strings.Contains(firstLine, ":") {
|
|
||||||
+ return nil, fmt.Errorf("invalid cpuinfo file: %q", firstLine)
|
|
||||||
+ }
|
|
||||||
+ field := strings.SplitN(firstLine, ": ", 2)
|
|
||||||
+ v, err := strconv.ParseUint(field[1], 0, 32)
|
|
||||||
+ if err != nil {
|
|
||||||
+ return nil, err
|
|
||||||
+ }
|
|
||||||
+ firstcpu := CPUInfo{Processor: uint(v)}
|
|
||||||
+ cpuinfo := []CPUInfo{firstcpu}
|
|
||||||
+ i := 0
|
|
||||||
+
|
|
||||||
+ for scanner.Scan() {
|
|
||||||
+ line := scanner.Text()
|
|
||||||
+ if !strings.Contains(line, ":") {
|
|
||||||
+ continue
|
|
||||||
+ }
|
|
||||||
+ field := strings.SplitN(line, ": ", 2)
|
|
||||||
+ switch strings.TrimSpace(field[0]) {
|
|
||||||
+ case "processor":
|
|
||||||
+ v, err := strconv.ParseUint(field[1], 0, 32)
|
|
||||||
+ if err != nil {
|
|
||||||
+ return nil, err
|
|
||||||
+ }
|
|
||||||
+ i = int(v)
|
|
||||||
+ cpuinfo = append(cpuinfo, CPUInfo{}) // start of the next processor
|
|
||||||
+ cpuinfo[i].Processor = uint(v)
|
|
||||||
+ case "hart":
|
|
||||||
+ cpuinfo[i].CoreID = field[1]
|
|
||||||
+ case "isa":
|
|
||||||
+ cpuinfo[i].ModelName = field[1]
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return cpuinfo, nil
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
// firstNonEmptyLine advances the scanner to the first non-empty line
|
|
||||||
// and returns the contents of that line
|
|
||||||
func firstNonEmptyLine(scanner *bufio.Scanner) string {
|
|
||||||
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..e83c2e2
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/vendor/github.com/prometheus/procfs/cpuinfo_riscvx.go
|
|
||||||
@@ -0,0 +1,19 @@
|
|
||||||
+// Copyright 2020 The Prometheus Authors
|
|
||||||
+// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
+// you may not use this file except in compliance with the License.
|
|
||||||
+// You may obtain a copy of the License at
|
|
||||||
+//
|
|
||||||
+// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+//
|
|
||||||
+// Unless required by applicable law or agreed to in writing, software
|
|
||||||
+// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+// See the License for the specific language governing permissions and
|
|
||||||
+// limitations under the License.
|
|
||||||
+
|
|
||||||
+// +build linux
|
|
||||||
+// +build riscv riscv64
|
|
||||||
+
|
|
||||||
+package procfs
|
|
||||||
+
|
|
||||||
+var parseCPUInfo = parseCPUInfoRISCV
|
|
||||||
BIN
v0.7.0.tar.gz
BIN
v0.7.0.tar.gz
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user