Accepting request 924778 from server:database

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/924778
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/percona-toolkit?expand=0&rev=40
This commit is contained in:
Dominique Leuenberger 2021-10-12 19:49:37 +00:00 committed by Git OBS Bridge
commit f60b17d6b2
5 changed files with 58 additions and 2 deletions

29
go-build.patch Normal file
View File

@ -0,0 +1,29 @@
Index: percona-toolkit-3.3.1/src/go/Makefile
===================================================================
--- percona-toolkit-3.3.1.orig/src/go/Makefile
+++ percona-toolkit-3.3.1/src/go/Makefile
@@ -14,9 +14,9 @@ FILES = $(shell find . -type f -name '*.
PREFIX=$(shell pwd)
TOP_DIR=$(shell git rev-parse --show-toplevel)
-BIN_DIR=$(shell git rev-parse --show-toplevel)/bin
-SRC_DIR=$(shell git rev-parse --show-toplevel)/src/go
-LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.GoVersion=${GOVERSION} -X main.Commit=${COMMIT} -s -w"
+BIN_DIR=$(TOP_DIR)/bin
+SRC_DIR=$(TOP_DIR)/src/go
+LDFLAGS="-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.GoVersion=${GOVERSION} -X main.Commit=${COMMIT} -w"
TEST_PSMDB_VERSION?=4.0
TEST_MONGODB_FLAVOR?=percona/percona-server-mongodb
@@ -111,6 +111,11 @@ env-down: env ## Clean-up MongoDB doc
docker-compose down -v
rm .env
+linux: ## Build Mongo tools for linux-amd64
+ echo "Building linux binaries in ${BIN_DIR}"
+ $(foreach pkg,$(pkgs),rm -f ${BIN_DIR}/$(pkg) 2> /dev/null;)
+ $(foreach pkg,$(pkgs),go build -mod=vendor -buildmode=pie -ldflags ${LDFLAGS} -o ${BIN_DIR}/$(pkg) ./$(pkg);)
+
linux-amd64: ## Build Mongo tools for linux-amd64
@echo "Building linux/amd64 binaries in ${BIN_DIR}"
@cd ${TOP_DIR} && go get ./...

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Oct 5 02:35:34 UTC 2021 - Marcus Rueckert <mrueckert@suse.de>
- enable golang based tools
1. package is no longer noarch
2. added go-build.patch
3. add BR for golang tools
-------------------------------------------------------------------
Fri Apr 30 06:39:28 UTC 2021 - Denys Kondratenko <stdden@opensuse.org>

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define revision 6917c5d
Name: percona-toolkit
Version: 3.3.1
@ -24,7 +25,10 @@ License: GPL-2.0-only
Group: Productivity/Databases/Tools
URL: https://www.percona.com/software/percona-toolkit/
Source: https://www.percona.com/downloads/%{name}/%{version}/source/tarball/%{name}-%{version}.tar.gz
Source1: vendor.tar.xz
Source2: %{name}.conf
Source9: series
Patch1: go-build.patch
Requires: perl(DBD::mysql) >= 1.0
Requires: perl(DBI) >= 1.13
Requires: perl(IO::Socket::SSL)
@ -32,8 +36,10 @@ Requires: perl(Term::ReadKey) >= 2.10
Requires: perl(Time::HiRes)
Provides: maatkit = 7410.%{version}
Obsoletes: maatkit < 7410
BuildArch: noarch
BuildRequires: golang-packaging
BuildRequires: golang(API)
%{perl_requires}
%{go_nostrip}
%description
Percona Toolkit is a collection of advanced command-line tools used by
@ -52,13 +58,21 @@ visit http://www.percona.com/software/.
This collection was formerly known as Maatkit.
%prep
%autosetup
%autosetup -p1 -a 1
%build
perl Makefile.PL INSTALLDIRS=vendor < /dev/null
sed -i 's|%{_bindir}/env perl|%{_bindir}/perl|' bin/*
sed -i 's|%{_bindir}/env bash|%{_bindir}/bash|' bin/*
%make_build
pushd src/go
make linux \
TOP_DIR=../../ \
BIN_DIR=../../bingo/ \
VERSION=%{version} \
BUILD=$(date -u '+%FT%T%z' -d @${SOURCE_DATE_EPOCH}) \
COMMIT=%{revision}
popd
%install
%perl_make_install
@ -70,6 +84,7 @@ rm -rf %{buildroot}%{_localstatedir}/adm/perl-modules/%{name}
# a blank configuration file
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
cp %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/
cp -a bingo/* %{buildroot}%{_bindir}/
%files
%license COPYING

1
series Normal file
View File

@ -0,0 +1 @@
go-build.patch

3
vendor.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f517890e013ad0e9c06b8137181a2775e94fe77e6e2b8dca8b76ff60d721629a
size 1860576