Skip to content

Commit

Permalink
alvistack/v3.21.5
Browse files Browse the repository at this point in the history
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Sep 4, 2022
1 parent ab84034 commit fc82d79
Show file tree
Hide file tree
Showing 30 changed files with 252 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,12 @@ BenchmarkDotNet.Artifacts/
# Clangd uses these common ephemeral files
.cache
compile_commands.json

src/*.a
src/*.so*
src/CMakeCache.txt
src/CMakeFiles/
src/cmake_install.cmake
src/install_manifest.txt
src/lib/
src/protoc-*
1 change: 0 additions & 1 deletion cmake/libprotobuf-lite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
1 change: 0 additions & 1 deletion cmake/libprotobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)
1 change: 0 additions & 1 deletion cmake/libprotoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)
13 changes: 13 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.substvars
*debhelper*
.debhelper
autoreconf.*
files
libprotobuf-dev
libprotobuf-lite32
libprotobuf32
libprotoc-dev
libprotoc32
protobuf-compiler
python3-protobuf
tmp
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
protobuf (100:3.21.5-1) UNRELEASED; urgency=medium

* https://github.com/protocolbuffers/protobuf/releases/tag/v3.21.5

-- Wong Hoi Sing Edison <hswong3i@gmail.com> Sat, 03 Sep 2022 18:01:15 +0800
108 changes: 108 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Source: protobuf
Section: devel
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <hswong3i@gmail.com>
Homepage: https://github.com/protocolbuffers/protobuf/tags
Vcs-Browser: https://github.com/alvistack/protocolbuffers-protobuf
Vcs-Git: https://github.com/alvistack/protocolbuffers-protobuf.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
dh-python,
fdupes,
cmake,
ninja-build,
python3-dev,
python3-setuptools,
zlib1g-dev,

Package: libprotobuf32
Architecture: any
Section: libs
Description: protocol buffers C++ library
This package contains the runtime library needed for C++ applications.
Depends:
${misc:Depends},
${shlibs:Depends},
Breaks:
cura-engine (<< 1:3.3.0-2.1+b1),
libarcus3 (<< 3.3.0-2),

Package: libprotobuf-lite32
Architecture: any
Section: libs
Description: protocol buffers C++ library (lite version)
This package contains the runtime library needed for C++ applications whose
message definitions have the "lite runtime" optimization setting.
Depends:
${misc:Depends},
${shlibs:Depends},

Package: libprotobuf-dev
Architecture: any
Section: libdevel
Description: protocol buffers C++ library (development files) and proto files
This package contains the development headers and static libraries needed for
writing C++ applications. Includes well known proto type files.
Depends:
${misc:Depends},
zlib1g-dev,
libprotobuf32 (= ${source:Version}),
libprotobuf-lite32 (= ${source:Version}),
Breaks:
protobuf-compiler (<< ${source:Version}),
protobuf-compiler (>> ${source:Version}),
Provides:
protobuf-api-32-0,

Package: libprotoc32
Architecture: any
Multi-Arch: same
Section: libs
Description: protocol buffers compiler library
This package contains the runtime library needed for the protocol buffer
compiler.
Depends:
${shlibs:Depends},
${misc:Depends},

Package: libprotoc-dev
Architecture: any
Section: libdevel
Description: protocol buffers compiler library (development files)
This package contains the development headers and static library needed for
writing protobuf compilers.
Depends:
${misc:Depends},
libprotobuf-dev (= ${source:Version}),
libprotoc32 (= ${source:Version}),
Replaces:
libprotobuf-dev (<< 2.1.0),
Breaks:
libprotobuf-dev (<< 2.1.0),

Package: protobuf-compiler
Architecture: any
Description: compiler for protocol buffer definition files
This package contains the protocol buffer compiler that is used for
translating from .proto files (containing the definitions) to the language
binding for the supported languages.
Depends:
${shlibs:Depends},
${misc:Depends},
libprotoc32 (= ${binary:Version}),

Package: python3-protobuf
Architecture: any
Section: python
Description: Python 3 bindings for protocol buffers
This package contains the Python 3 bindings for the protocol buffers. You will
need the protoc tool (in the protobuf-compiler package) to compile your
definition to Python classes, and then the modules in this package will allow
you to use those classes in your programs.
Depends:
${misc:Depends},
${python3:Depends},
${shlibs:Depends},
python3,
Empty file added debian/copyright
Empty file.
4 changes: 4 additions & 0 deletions debian/libprotobuf-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
usr/include
usr/lib/*/libprotobuf-lite.so
usr/lib/*/libprotobuf.so
usr/lib/*/pkgconfig/*
3 changes: 3 additions & 0 deletions debian/libprotobuf-dev.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libprotobuf-dev: copyright-without-copyright-notice
libprotobuf-dev: initial-upload-closes-no-bugs
libprotobuf-dev: zero-byte-file-in-doc-directory
1 change: 1 addition & 0 deletions debian/libprotobuf-lite32.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libprotobuf-lite.so.*
4 changes: 4 additions & 0 deletions debian/libprotobuf-lite32.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libprotobuf-lite32: copyright-without-copyright-notice
libprotobuf-lite32: initial-upload-closes-no-bugs
libprotobuf-lite32: package-name-doesnt-match-sonames
libprotobuf-lite32: zero-byte-file-in-doc-directory
1 change: 1 addition & 0 deletions debian/libprotobuf32.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libprotobuf.so.*
4 changes: 4 additions & 0 deletions debian/libprotobuf32.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libprotobuf32: copyright-without-copyright-notice
libprotobuf32: initial-upload-closes-no-bugs
libprotobuf32: package-name-doesnt-match-sonames
libprotobuf32: zero-byte-file-in-doc-directory
2 changes: 2 additions & 0 deletions debian/libprotoc-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/include/google/protobuf/compiler
usr/lib/*/libprotoc.so
3 changes: 3 additions & 0 deletions debian/libprotoc-dev.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libprotoc-dev: copyright-without-copyright-notice
libprotoc-dev: initial-upload-closes-no-bugs
libprotoc-dev: zero-byte-file-in-doc-directory
1 change: 1 addition & 0 deletions debian/libprotoc32.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/*/libprotoc*.so.*
4 changes: 4 additions & 0 deletions debian/libprotoc32.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libprotoc32: copyright-without-copyright-notice
libprotoc32: initial-upload-closes-no-bugs
libprotoc32: package-name-doesnt-match-sonames
libprotoc32: zero-byte-file-in-doc-directory
1 change: 1 addition & 0 deletions debian/protobuf-compiler.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin/*
4 changes: 4 additions & 0 deletions debian/protobuf-compiler.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
protobuf-compiler: copyright-without-copyright-notice
protobuf-compiler: initial-upload-closes-no-bugs
protobuf-compiler: no-manual-page
protobuf-compiler: zero-byte-file-in-doc-directory
1 change: 1 addition & 0 deletions debian/python3-protobuf.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python*/*-packages/*
4 changes: 4 additions & 0 deletions debian/python3-protobuf.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python3-protobuf: copyright-without-copyright-notice
python3-protobuf: initial-upload-closes-no-bugs
python3-protobuf: shared-library-lacks-prerequisites
python3-protobuf: zero-byte-file-in-doc-directory
63 changes: 63 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/make -f

SHELL := /bin/bash

PYTHON3_PROTOBUF_VERSION = 100:4.21.5-1

override_dh_autoreconf:

override_dh_auto_configure:
pushd src && \
cmake \
../cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-Dprotobuf_BUILD_LIBPROTOC=ON \
-Dprotobuf_BUILD_PROTOC_BINARIES=ON \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS=OFF && \
popd

override_dh_auto_build:
pushd src && \
export LD_LIBRARY_PATH=../src && \
cmake \
--build . \
--parallel 10 \
--config Release && \
popd
pushd python && \
python3 setup.py build \
--cpp_implementation && \
popd

override_dh_auto_install:
pushd src && \
export DESTDIR=../debian/tmp && \
cmake \
--install . && \
popd
pushd python && \
python3 setup.py install \
--cpp_implementation \
--no-compile \
--install-layout=deb \
--root=../debian/tmp && \
popd
find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \;
fdupes -qnrps debian/tmp/usr/lib/python*/*-packages

override_dh_install:
dh_install
rm -rf debian/libprotobuf-dev/usr/include/google/protobuf/compiler

override_dh_gencontrol:
dh_gencontrol
dh_gencontrol -ppython3-protobuf -- -v$(PYTHON3_PROTOBUF_VERSION)

override_dh_auto_test:

override_dh_auto_clean:

%:
dh $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
6 changes: 6 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
protobuf source: configure-generated-file-in-source
protobuf source: dependency-is-not-multi-archified
protobuf source: no-debian-changes
protobuf source: not-binnmuable-any-depends-any
protobuf source: python3-depends-but-no-python3-helper
protobuf source: weak-library-dev-dependency
Empty file added protobuf.spec
Empty file.
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
PTHREAD_DEF =
endif

PROTOBUF_VERSION = 32:5:0
PROTOBUF_VERSION = 3.21.5

if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison
Expand Down Expand Up @@ -188,7 +188,7 @@ nobase_include_HEADERS = \
lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la

libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
libprotobuf_lite_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
Expand Down Expand Up @@ -235,7 +235,7 @@ libprotobuf_lite_la_SOURCES = \
google/protobuf/wire_format_lite.cc

libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
libprotobuf_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
Expand Down Expand Up @@ -320,7 +320,7 @@ libprotobuf_la_SOURCES = \
nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)

libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
libprotoc_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
Expand Down
2 changes: 2 additions & 0 deletions src/libprotobuf-lite.map
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
scc_info_*;
descriptor_table_*;

local:
*;
Expand Down
2 changes: 2 additions & 0 deletions src/libprotobuf.map
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
scc_info_*;
descriptor_table_*;

local:
*;
Expand Down
2 changes: 2 additions & 0 deletions src/libprotoc.map
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
extern "C++" {
*google*;
};
scc_info_*;
descriptor_table_*;

local:
*;
Expand Down

0 comments on commit fc82d79

Please sign in to comment.