Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packaging/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
percona-binlog-server (0.1.0-1) unstable; urgency=low

* Packaging for 0.1.0-1

-- Vadim Yalovets <vadim.yalovets@percona.com> Mon, 19 Jan 2026 10:40:32 +0300
1 change: 1 addition & 0 deletions packaging/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
12 changes: 12 additions & 0 deletions packaging/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Source: percona-binlog-server
Maintainer: Percona Development Team <info@percona.com>
Section: misc
Priority: optional
Standards-Version: 4.6.2


Package: percona-binlog-server
Architecture: any
Depends: percona-server-client
Description: Percona Binary Log Server
Command line utility that can be considered as an enhanced version of mysqlbinlog.
118 changes: 118 additions & 0 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/usr/bin/make -f

export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_CMAKE_GENERATOR=Ninja

export DISTRO := $(shell dpkg-vendor --query Vendor)
export CODENAME := $(shell . /etc/os-release && echo $$VERSION_CODENAME)

# Versions
export DEB_VERSION=0.1.0
export BOOST_VERSION=1.88.0
export AWS_VERSION=1.11.570

# CMake presets
export BUILD_PRESET_DEBUG=debug_gcc14
export BUILD_PRESET_RELEASE=release_gcc14

# Source dir
SRC_DIR := $(CURDIR)

%:
dh $@ --buildsystem=cmake --parallel

override_dh_auto_configure:
# handled manually in build

override_dh_auto_build:
set -e; \
\
echo "Ubuntu VERSION: $(DISTRO)"; \
echo "Ubuntu CODENAME: $(CODENAME)"; \
if [ "$(CODENAME)" = "bullseye" ]; then \
sed -i 's:gcc-14:gcc-10:' $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json; \
sed -i 's:g++-14:g++-10:' $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json; \
sed -i 's:gcc-14:gcc-10:' $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json; \
sed -i 's:g++-14:g++-10:' $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json; \
sed -i 's:gcc-14:gcc-10:' $(SRC_DIR)/CMakePresets.json; \
sed -i 's:g++-14:g++-10:' $(SRC_DIR)/CMakePresets.json; \
elif [ "$(CODENAME)" = "jammy" ] || [ "$(CODENAME)" = "bookworm" ] || [ "$(CODENAME)" = "forky" ]; then \
sed -i 's:gcc-14:gcc-13:' $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json; \
sed -i 's:g++-14:g++-13:' $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json; \
sed -i 's:gcc-14:gcc-13:' $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json; \
sed -i 's:g++-14:g++-13:' $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json; \
sed -i 's:gcc-14:gcc-13:' $(SRC_DIR)/CMakePresets.json; \
sed -i 's:g++-14:g++-13:' $(SRC_DIR)/CMakePresets.json; \
elif [ "$(CODENAME)" = "trixie" ] || [ "$(CODENAME)" = "bookworm" || [ "$(CODENAME)" = "forky" ]; then \
sed -i '/"BUILD_TESTING"[[:space:]]*:[[:space:]]*"ON"/i\ "MYSQL_LIBRARY": "/usr/lib/x86_64-linux-gnu/libperconaserverclient.so",' $(SRC_DIR)/CMakePresets.json; \
fi \
########################
# DEBUG BUILD
########################
mkdir -p debug; \
sed -i 's:/boost-install-:/percona-binlog-server-$(DEB_VERSION)/debug/boost-install-:' CMakePresets.json; \
sed -i 's:/aws-sdk-cpp-install-:/percona-binlog-server-$(DEB_VERSION)/debug/aws-sdk-cpp-install-:' CMakePresets.json; \
sed -i 's:$${sourceParentDir}/$${sourceDirName}-:$${sourceParentDir}/$${sourceDirName}/$${sourceDirName}-:g' CMakePresets.json
\
cd debug; \
git clone --recurse-submodules -b boost-$(BOOST_VERSION) https://github.com/boostorg/boost.git boost; \
cd boost && git switch -c required_release && cd ..; \
cp $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json boost; \
cmake ./boost --preset $(BUILD_PRESET_DEBUG); \
cmake --build ./boost-build-$(BUILD_PRESET_DEBUG); \
cmake --install ./boost-build-$(BUILD_PRESET_DEBUG); \
\
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git aws-sdk-cpp; \
cd aws-sdk-cpp && git checkout --recurse-submodules -b required_release $(AWS_VERSION) && cd ..; \
cp $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json aws-sdk-cpp; \
cmake ./aws-sdk-cpp --preset $(BUILD_PRESET_DEBUG); \
cmake --build ./aws-sdk-cpp-build-$(BUILD_PRESET_DEBUG); \
cmake --install ./aws-sdk-cpp-build-$(BUILD_PRESET_DEBUG); \
\
cd ..; \
cmake . --preset $(BUILD_PRESET_DEBUG); \
cmake --build ./percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_DEBUG); \
./percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_DEBUG)/binlog_server version; \
\
########################
# RELEASE BUILD
########################
mkdir -p release; \
sed -i 's:debug/boost-install-:release/boost-install-:' CMakePresets.json; \
sed -i 's:debug/aws-sdk-cpp-install-:release/aws-sdk-cpp-install-:' CMakePresets.json; \
\
cd release; \
git clone --recurse-submodules -b boost-$(BOOST_VERSION) https://github.com/boostorg/boost.git boost; \
cd boost && git switch -c required_release && cd ..; \
cp $(SRC_DIR)/extra/cmake_presets/boost/CMakePresets.json boost; \
cmake ./boost --preset $(BUILD_PRESET_RELEASE); \
cmake --build ./boost-build-$(BUILD_PRESET_RELEASE); \
cmake --install ./boost-build-$(BUILD_PRESET_RELEASE); \
\
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git aws-sdk-cpp; \
cd aws-sdk-cpp && git checkout --recurse-submodules -b required_release $(AWS_VERSION) && cd ..; \
cp $(SRC_DIR)/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json aws-sdk-cpp; \
cmake ./aws-sdk-cpp --preset $(BUILD_PRESET_RELEASE); \
cmake --build ./aws-sdk-cpp-build-$(BUILD_PRESET_RELEASE); \
cmake --install ./aws-sdk-cpp-build-$(BUILD_PRESET_RELEASE); \
\
cd ..; \
cmake . --preset $(BUILD_PRESET_RELEASE); \
cmake --build ./percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_RELEASE)
./percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_DEBUG)/binlog_server version; \

override_dh_auto_install:
install -d debian/percona-binlog-server/usr/bin
install -m 0755 \
percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_DEBUG)/binlog_server \
debian/percona-binlog-server/usr/bin/binlog_server-debug
install -m 0755 \
percona-binlog-server-$(DEB_VERSION)-build-$(BUILD_PRESET_RELEASE)/binlog_server \
debian/percona-binlog-server/usr/bin/binlog_server
install -d debian/percona-binlog-server/etc/percona-binlog-server
install -m 0640 main_config.json \
debian/percona-binlog-server/etc/percona-binlog-server/main_config.json

override_dh_auto_test:
# no tests
1 change: 1 addition & 0 deletions packaging/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
141 changes: 141 additions & 0 deletions packaging/rpm/binlog-server.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
%global percona_binlog_server_version @@PBS_RELEASE@@
%global rpm_release @@RPM_RELEASE@@
%global BUILD_PRESET_DEBUG debug_gcc14
%global BUILD_PRESET_RELEASE release_gcc14
%global BOOST_VERSION 1.88.0
%global AWS_VERSION 1.11.570
%global release %{rpm_release}%{?dist}
%global optflags %(echo %{optflags} | sed 's/-specs=[^ ]*annobin[^ ]*//g')

Name: percona-binlog-server
Version: %{percona_binlog_server_version}
Release: %{release}
Summary: Percona Binary Log Server

License: GPLv2
URL: https://github.com/Percona-Lab/percona-binlog-server
Source0: %{name}-%{version}.tar.gz

%description
Percona Binary Log Server is a command-line utility that acts as an enhanced version of mysqlbinlog in --read-from-remote-server mode. It serves as a replication client and can stream binary log events from a remote Oracle MySQL Server / Percona Server for MySQL both to a local filesystem and to a cloud storage (currently AWS S3). The tool is capable of automatically reconnecting to the remote server and resuming operations from the point where it was previously stopped.

%prep
%setup -q

%build
# Build Debug version
mkdir -p debug
(
%if 0%{?amzn}
echo "Running Amazon Linux–specific command"
sed -i 's:gcc-14:gcc14-gcc:' ../percona-binlog-server-%{version}/extra/cmake_presets/boost/CMakePresets.json
sed -i 's:g++-14:gcc14-g++:' ../percona-binlog-server-%{version}/extra/cmake_presets/boost/CMakePresets.json
export CFLAGS="${CFLAGS//-Werror*/}"
export CXXFLAGS="${CXXFLAGS//-Werror*/}"
export LDFLAGS="${LDFLAGS//-Werror*/}"
export CFLAGS="${CFLAGS//-specs*annobin*/}"
export CXXFLAGS="${CXXFLAGS//-specs*annobin*/}"
export LDFLAGS="${LDFLAGS//-specs*annobin*/}"
export CFLAGS="${CFLAGS//-specs*redhat-hardened-cc1*/}"
export CXXFLAGS="${CXXFLAGS//-specs*redhat-hardened-cc1*/}"
export LDFLAGS="${LDFLAGS//-specs*redhat-hardened-ld*/}"
%endif
sed -i 's:/boost-install-:/percona-binlog-server-%{version}/debug/boost-install-:' ../percona-binlog-server-%{version}/CMakePresets.json
sed -i 's:/aws-sdk-cpp-install-:/percona-binlog-server-%{version}/debug/aws-sdk-cpp-install-:' ../percona-binlog-server-%{version}/CMakePresets.json
cd debug
# Build Boost Libraries
git clone --recurse-submodules -b boost-%{BOOST_VERSION} --jobs=8 https://github.com/boostorg/boost.git boost
cd boost
git switch -c required_release
cd ..
cp -v ../../percona-binlog-server-%{version}/extra/cmake_presets/boost/CMakePresets.json boost

cmake ./boost \
--preset %{BUILD_PRESET_DEBUG}
cmake --build ./boost-build-%{BUILD_PRESET_DEBUG} --parallel
cmake --install ./boost-build-%{BUILD_PRESET_DEBUG}

# Build AWS SDK for C++ Libraries
git clone --recurse-submodules --jobs=8 https://github.com/aws/aws-sdk-cpp.git aws-sdk-cpp
cd aws-sdk-cpp
git checkout --recurse-submodules -b required_release %{AWS_VERSION}
cd ..
cp -v ../../percona-binlog-server-%{version}/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json aws-sdk-cpp
cmake ./aws-sdk-cpp --preset %{BUILD_PRESET_DEBUG}
cmake --build ./aws-sdk-cpp-build-%{BUILD_PRESET_DEBUG} --parallel
cmake --install ./aws-sdk-cpp-build-%{BUILD_PRESET_DEBUG}

# Build Percona Binlog Server
cd ../..
cmake ./percona-binlog-server-%{version} --preset %{BUILD_PRESET_DEBUG}
cmake --build ./percona-binlog-server-%{version}-build-%{BUILD_PRESET_DEBUG} --parallel
)

# Build Release version
mkdir -p release
(
%if 0%{?amzn}
echo "Running Amazon Linux–specific command"
export CFLAGS="${CFLAGS//-Werror*/}"
export CXXFLAGS="${CXXFLAGS//-Werror*/}"
export LDFLAGS="${LDFLAGS//-Werror*/}"
export CFLAGS="${CFLAGS//-specs*annobin*/}"
export CXXFLAGS="${CXXFLAGS//-specs*annobin*/}"
export LDFLAGS="${LDFLAGS//-specs*annobin*/}"
export CFLAGS="${CFLAGS//-specs*redhat-hardened-cc1*/}"
export CXXFLAGS="${CXXFLAGS//-specs*redhat-hardened-cc1*/}"
export LDFLAGS="${LDFLAGS//-specs*redhat-hardened-ld*/}"
%endif
sed -i 's:debug/boost-install-:release/boost-install-:' ../percona-binlog-server-%{version}/CMakePresets.json
sed -i 's:debug/aws-sdk-cpp-install-:release/aws-sdk-cpp-install-:' ../percona-binlog-server-%{version}/CMakePresets.json
cd release
# Build Boost Libraries
git clone --recurse-submodules -b boost-%{BOOST_VERSION} --jobs=8 https://github.com/boostorg/boost.git boost
cd boost
git switch -c required_release
cd ..
cp -v ../../percona-binlog-server-%{version}/extra/cmake_presets/boost/CMakePresets.json boost

cmake ./boost \
--preset %{BUILD_PRESET_RELEASE}
cmake --build ./boost-build-%{BUILD_PRESET_RELEASE} --parallel
cmake --install ./boost-build-%{BUILD_PRESET_RELEASE}

# Build AWS SDK for C++ Libraries
git clone --recurse-submodules --jobs=8 https://github.com/aws/aws-sdk-cpp.git aws-sdk-cpp
cd aws-sdk-cpp
git checkout --recurse-submodules -b required_release %{AWS_VERSION}
cd ..
cp -v ../../percona-binlog-server-%{version}/extra/cmake_presets/aws-sdk-cpp/CMakePresets.json aws-sdk-cpp
cmake ./aws-sdk-cpp --preset %{BUILD_PRESET_RELEASE}
cmake --build ./aws-sdk-cpp-build-%{BUILD_PRESET_RELEASE} --parallel
cmake --install ./aws-sdk-cpp-build-%{BUILD_PRESET_RELEASE}

# Build Percona Binlog Server
cd ../..
cmake ./percona-binlog-server-%{version} --preset %{BUILD_PRESET_RELEASE}
cmake --build ./percona-binlog-server-%{version}-build-%{BUILD_PRESET_RELEASE} --parallel
)

%install
install -d %{buildroot}/usr/bin
install -m 755 ../percona-binlog-server-%{version}-build-%{BUILD_PRESET_DEBUG}/binlog_server %{buildroot}/usr/bin/binlog_server-debug
install -m 755 ../percona-binlog-server-%{version}-build-%{BUILD_PRESET_RELEASE}/binlog_server %{buildroot}/usr/bin/binlog_server
install -m 0755 -d %{buildroot}/%{_sysconfdir}
install -D -m 0644 main_config.json %{buildroot}/%{_sysconfdir}/percona-binlog-server/main_config.json


%files
%license LICENSE
%doc README.md
%config(noreplace) %attr(0640,root,root) /%{_sysconfdir}/percona-binlog-server/main_config.json
/usr/bin/binlog_server-debug
/usr/bin/binlog_server


%changelog
* Fri Jan 16 2026 Vadim Yalovets <vadim.yalovets@percona.com> - 1.0.0-1
- PKG-1208 Prepare packages for Percona Binlog Server

* Mon Aug 26 2024 Surabhi Bhat <surabhi.bhat@percona.com> - 0.1.0-1
- Initial package with separate builds for Debug and RelWithDebInfo versions.
Loading