From 5c4c182dc2a78e6fe14f25f4a18641365133cabc Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 23 Jun 2024 11:39:08 -0500 Subject: [PATCH] Initial commit --- .gitignore | 3 ++ sources.sh | 15 +++++++ wal-g.spec | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 .gitignore create mode 100644 sources.sh create mode 100644 wal-g.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc0af39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +wal-g-*.tar.gz +*.rpm +results_wal-g/ diff --git a/sources.sh b/sources.sh new file mode 100644 index 0000000..dcccf9c --- /dev/null +++ b/sources.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +version=$1 + +git clone \ + -b "v${version}" \ + --depth=1 \ + https://github.com/wal-g/wal-g \ + wal-g-${version} + +cd wal-g-${version} +go mod tidy +go mod vendor +cd .. +tar -cf wal-g-${version}.tar.gz wal-g-${version} diff --git a/wal-g.spec b/wal-g.spec new file mode 100644 index 0000000..5e5cd5c --- /dev/null +++ b/wal-g.spec @@ -0,0 +1,128 @@ +%global gittag v%{version} + +%global debug_package %{nil} +%global _missing_build_ids_terminate_build 0 + +%bcond postgresql 1 +%bcond mysql 0 +%bcond sqlserver 0 + +Name: wal-g +Version: 3.0.1 +Release: 1 +Summary: Archival and Restoration for databases in the Cloud + +License: Apache-2.0 +URL: https://github.com/wal-g/wal-g +Source: %{name}-%{version}.tar.gz + +BuildRequires: golang +BuildRequires: git-core + +%description +WAL-G is an archival restoration tool for PostgreSQL, MySQL/MariaDB, and MS SQL +Server (beta for MongoDB and Redis). + +WAL-G is the successor of WAL-E with a number of key differences. WAL-G uses +LZ4, LZMA, ZSTD, or Brotli compression, multiple processors, and non-exclusive +base backups for Postgres. More information on the original design and +implementation of WAL-G can be found on the Citus Data blog post "Introducing +WAL-G by Citus: Faster Disaster Recovery for Postgres". + +%package daemon-client +Summary: walg-daemon-client utility +Requires: %{name} = %{version} + +%description daemon-client +walg-daemon-client is lightweight client for WAL-G daemon. + + +%if %{with postgresql} +%package postgresql +Summary: wal-g for PostgreSQL +Requires: %{name} = %{version} + +%description postgresql +%{summary} +%endif + + +%if %{with mysql} +%package mysql +Summary: wal-g for MySQL/MariaDB +Requires: %{name} = %{version} + +%description mysql +%{summary} +%endif + +%if %{with sqlserver} +%package sqlserver +Summary: wal-g for SQLServer +Requires: %{name} = %{version} + +%description sqlserver +%{summary} +%endif + + +%prep +%autosetup -n wal-g-%{version} + + +%build +%if %{with postgresql} +make pg_build +%endif +%if %{with mysql} +make mysql_build +%endif +%if %{with sqlserver} +make sqlserver_build +%endif + +make build_client + + +%install +%{__install} -d %{buildroot}%{_bindir} + +%if %{with postgresql} +%{__install} main/pg/wal-g %{buildroot}%{_bindir}/wal-g-pg +%endif +%if %{with mysql} +%{__install} main/mysql/wal-g %{buildroot}%{_bindir}/wal-g-mysql +%endif +%if %{with sqlserver} +%{__install} main/sqlserver/wal-g %{buildroot}%{_bindir}/wal-g-sqlserver +%endif + +%{__install} bin/walg-daemon-client %{buildroot}%{_bindir}/ + +%check + + +%files +%license LICENSE.md + +%files daemon-client +%{_bindir}/walg-daemon-client + +%if %{with postgresql} +%files postgresql +%{_bindir}/wal-g-pg +%endif + +%if %{with mysql} +%files mysql +%{_bindir}/wal-g-mysql +%endif + +%if %{with sqlserver} +%files sqlserver +%{_bindir}/wal-g-sqlserver +%endif + + +%changelog +%autochangelog