Skip to content
Draft
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
44 changes: 44 additions & 0 deletions .github/workflows/debpkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: build-deb
on: [pull_request, workflow_dispatch, push]

jobs:
build-deb-ubuntu-latest:
name: Build Debian Package on GitHub's ubuntu-latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
path: builddir
- name: Install build dependencies
run: |
set -euo pipefail
cd builddir
sudo apt-get update --quiet
sudo apt-get build-dep --yes --quiet .
- name: Run build
run: |
set -euo pipefail
cd builddir
PACKAGE="$(grep --only-matching --perl-regex "Source: \K.*" debian/control)"
VERSION="$(dpkg-parsechangelog -S Version)"
COMMIT_ID=$(git rev-parse --short HEAD)
RELEASE="${VERSION}+${COMMIT_ID}"
MSG="$(git log -1 --format='%h %s')"
FULLNAME=$(git show -s --format="%cn")
EMAIL=$(git show -s --format="%ce")
DATE=$(date -R)
cat > debian/changelog <<EOF
${PACKAGE} (${RELEASE}) UNRELEASED; urgency=medium

* Latest commit:
${MSG}

-- ${FULLNAME} <${EMAIL}> ${DATE}
EOF
dpkg-buildpackage --build=binary
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: kvproto-deb-ubuntu-latest
path: golang-github-pingcap-kvproto*
8 changes: 8 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.debhelper
*.log
*.substvars
/.debhelper/
/.build/
/debhelper-build-stamp
/files
/golang-github-pingcap-kvproto-dev/
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
golang-github-pingcap-kvproto (0.0.0) UNRELEASED; urgency=medium

* Dummy changelog entry and version, which should be replaced by build
automation at build-time.

-- Nobody <nobody@example.com> Fri, 27 Feb 2026 13:13:13 +0000
35 changes: 35 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Source: golang-github-pingcap-kvproto
Section: golang
Maintainer: Otto Kekäläinen <otto@debian.org>
Build-Depends:
debhelper-compat (= 13),
dh-sequence-golang,
golang-any,
golang-github-golang-protobuf-1-5-dev,
golang-github-grpc-ecosystem-grpc-gateway-dev,
golang-gogoprotobuf-dev,
golang-google-genproto-dev,
golang-google-grpc-dev,
protobuf-compiler,
Testsuite: autopkgtest-pkg-go
Standards-Version: 4.7.3
Vcs-Browser: https://github.com/pingcap/kvproto
Vcs-Git: https://github.com/pingcap/kvproto.git
Homepage: https://github.com/pingcap/kvproto
XS-Go-Import-Path: github.com/pingcap/kvproto

Package: golang-github-pingcap-kvproto-dev
Architecture: all
Multi-Arch: foreign
Depends:
golang-github-golang-protobuf-1-5-dev,
golang-github-grpc-ecosystem-grpc-gateway-dev,
golang-gogoprotobuf-dev,
golang-google-genproto-dev,
golang-google-grpc-dev,
${misc:Depends},
Description: Protocol buffer definitions for the TiKV project
TiKV is a distributed, transactional key-value database. This package
contains the Go source code generated from the protocol buffer
definitions that are used for communication between TiKV servers and
clients.
90 changes: 90 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/pingcap/kvproto
Upstream-Name: kvproto
Upstream-Contact: PingCAP, Inc. <info@pingcap.com>

Files:
*
Copyright:
2016-2026 PingCAP, Inc.
License: Apache-2.0

Files:
debian/*
Copyright:
2025-2026 Otto Kekäläinen <otto@debian.org>
License: Apache-2.0
Comment: Debian packaging is licensed under the same terms as upstream

Files:
include/gogoproto/gogo.proto
Copyright:
2013, The GoGo Authors
License: BSD-2-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Files:
include/google/protobuf/*.proto
Copyright:
2008 Google Inc.
License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Files:
pkg/**/*.pb.go
Copyright:
2016-2026 PingCAP, Inc.
License: Apache-2.0
Comment:
These files are programmatically generated by protoc-gen-gogo from
the .proto files. The copyright of the original .proto files is
held by PingCAP, Inc.

License: Apache-2.0
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
3 changes: 3 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[DEFAULT]
# This is native package and there are no debian/* or upstream/* branches
ignore-branch = True
16 changes: 16 additions & 0 deletions debian/gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This is a template from
# https://salsa.debian.org/salsa-ci-team/pipeline/-/raw/master/recipes/salsa-ci.yml
#
# If this pipeline is not running at after committing and pushing this file,
# ensure that https://salsa.debian.org/%{project_path}/-/settings/ci_cd has in
# field "CI/CD configuration file" filename "debian/salsa-ci.yml", the filename
# is the same as of this file, and duplicate files with similar contents but
# different filenames have been cleaned away.
#
# Feel free disable and enable tests to find a good balance between extensive
# coverage and having a consistently green pipeline where failures are rare
# enough that they are always investigated and addressed. For documentation
# please read https://salsa.debian.org/salsa-ci-team/pipeline
---
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
30 changes: 30 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/make -f

export GOPATH ?= $(CURDIR)/debian/go
export PATH := $(GOPATH)/bin:$(PATH)

override_dh_auto_build:
# The grpc-gateway definitions have been removed from the proto files
# to fix the build with grpc-gateway v2.
# Remove the stale generated gateway file.
rm -f pkg/configpb/configpb.pb.gw.go
# Regenerate the main pb.go file from the patched proto file.
# The paths=source_relative option with protoc is tricky. We generate
# the file in a temporary location and move it.
# Remove rust-specific lines that break gogo
sed -i '/rustproto/d' proto/configpb.proto
# But we still need to generate rustproto itself, because other protos may depend on it.
# Use a temp dir and move to avoid creating nested directories on re-runs.
mkdir -p debian/.build/proto-gen
protoc -I. -Iinclude --gogo_out=paths=source_relative,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:debian/.build/proto-gen include/rustproto.proto
rm -f pkg/rustproto/rustproto.pb.go
mkdir -p pkg/rustproto
mv debian/.build/proto-gen/include/rustproto.pb.go pkg/rustproto/
mkdir -p debian/.build/proto-gen
protoc -I. -Iinclude --gogo_out=plugins=grpc,paths=source_relative:debian/.build/proto-gen proto/configpb.proto
mkdir -p pkg/configpb
mv debian/.build/proto-gen/proto/configpb.pb.go pkg/configpb/
dh_auto_build

%:
dh $@ --builddirectory=debian/.build/upstream --buildsystem=golang
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
6 changes: 6 additions & 0 deletions include/rustproto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package rustproto;

import "google/protobuf/descriptor.proto";

option go_package = "github.com/pingcap/kvproto/pkg/rustproto";

extend google.protobuf.FileOptions {
// When true, oneof field is generated public
optional bool expose_oneof_all = 17001;
Expand Down Expand Up @@ -45,3 +47,7 @@ extend google.protobuf.FieldOptions {
// Use `bytes::Bytes` for `string` fields
optional bool carllerche_bytes_for_string_field = 17012;
}

// Dummy message to force file generation.
message RustProtoDummy {
}
Loading