Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian: add initial erpc packages build #288

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Module.symvers
patches-*

# quilt's files
patches
series
*.patch
#patches
#series
#*.patch

# cscope files
cscope.*
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ install: erpc erpc_c erpcgen $(ERPCSNIFFER)
@$(MAKE) $(silent_make) -j$(MAKETHREADS) -r -C erpc_c install
@$(MAKE) $(silent_make) -j$(MAKETHREADS) -r -C erpcgen install
ifeq "$(is_linux)" "1"
@$(MAKE) $(silent_make) -j$(MAKETHREADS) -r -C erpc_c install_pc
@$(MAKE) $(silent_make) -j$(MAKETHREADS) -r -C erpcsniffer install
endif

Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
erpc (1.9.0) UNRELEASED; urgency=low

* Initial release as Debian bullseye package.

-- Florent Pirou <[email protected]> Fri, 17 Jun 2022 00:00:42 +0000
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
32 changes: 32 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Source: erpc
Section: libs
Priority: extra
Maintainer: ECI Maintainer <[email protected]>
Build-Depends: make, debhelper (>=11~), bison, flex, libfl-dev, libboost-dev, libboost-filesystem-dev, libboost-system-dev, python-is-python3, dh-python, python3-all-dev, python3-six, python3-setuptools, python3-pkg-resources, python3-serial, python3-yaml, pypy-enum34
Standards-Version: 4.1.4

Package: liberpc-dev
Section: libdevel
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends},
Description: EmbeddedRPC static library and development headers

Package: erpc-tools
Section: libs
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends},
Description: EmbeddedRPC dynamic library

Package: python3-erpc
Section: python
Architecture: any
Depends:
${misc:Depends},
${python3:Depends},
${shlibs:Depends},
Description: Embedded RPC system (Python 3)
A embedded remote procedure call (eRPC) framework that can
run anywhere. It enables client and server applications to communicate
transparently, and makes it easier to build RTOS connected systems.
.
This package contains the Python 3 bindings.
1 change: 1 addition & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LICENSE
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
2 changes: 2 additions & 0 deletions debian/erpc-tools.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/bin/erpcgen
usr/bin/erpcsniffer
3 changes: 3 additions & 0 deletions debian/liberpc-dev.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
usr/include/erpc
usr/lib/x86_64-linux-gnu/liberpc.a
usr/lib/x86_64-linux-gnu/pkgconfig/erpc.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From a57954befc5a51b1849bd4d2127798cd165fe0d5 Mon Sep 17 00:00:00 2001
From: florent pirou <[email protected]>
Date: Wed, 15 Jun 2022 21:15:23 -0700
Subject: [PATCH 4/4] fix: erpc_mbf_dynamic_init not available to clients

some files that are relevant to Linux are missing there,
incl. erpc_mbf_setup.h and erpc_setup_mbf_[dynamic, static].cpp sources
https://github.com/EmbeddedRPC/erpc/issues/114

Signed-off-by: florent pirou <[email protected]>
---
erpc_c/Makefile | 3 +++
1 file changed, 3 insertions(+)

diff --git a/erpc_c/Makefile b/erpc_c/Makefile
index 36b172a..f5d33b3 100644
--- a/erpc_c/Makefile
+++ b/erpc_c/Makefile
@@ -65,6 +65,8 @@ SOURCES += $(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.cpp \
$(ERPC_C_ROOT)/port/erpc_serial.cpp \
$(ERPC_C_ROOT)/setup/erpc_arbitrated_client_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_client_setup.cpp \
+ $(ERPC_C_ROOT)/setup/erpc_setup_mbf_dynamic.cpp \
+ $(ERPC_C_ROOT)/setup/erpc_setup_mbf_static.cpp \
$(ERPC_C_ROOT)/setup/erpc_server_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_serial.cpp \
$(ERPC_C_ROOT)/transports/erpc_inter_thread_buffer_transport.cpp \
@@ -93,6 +95,7 @@ HEADERS += $(ERPC_C_ROOT)/config/erpc_config.h \
$(ERPC_C_ROOT)/port/erpc_serial.h \
$(ERPC_C_ROOT)/setup/erpc_arbitrated_client_setup.h \
$(ERPC_C_ROOT)/setup/erpc_client_setup.h \
+ $(ERPC_C_ROOT)/setup/erpc_mbf_setup.h \
$(ERPC_C_ROOT)/setup/erpc_server_setup.h \
$(ERPC_C_ROOT)/setup/erpc_transport_setup.h \
$(ERPC_C_ROOT)/transports/erpc_inter_thread_buffer_transport.h \
--
2.17.1

1 change: 1 addition & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix-erpc_mbf_dynamic_init-not-available-to-clients.patch
50 changes: 50 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/make -f

export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
export CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
# use --as-needed only if supported by dh-autoreconf (to simplify backporting)
export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed

#security specific flags
CFLAGS += -fPIC -fcf-protection=full -z noexecstack -fstack-clash-protection
CPPFLAGS += -fPIC -fcf-protection=full -z noexecstack -fstack-clash-protection
CXXFLAGS += -fPIC -fcf-protection=full -z noexecstack -fstack-clash-protection

export V=1
export PYBUILD_NAME=erpc
export PYBUILD_SYSTEM=distutils

override_dh_auto_configure:
dh_auto_configure -O--buildsystem=pybuild --sourcedirectory=$(CURDIR)/erpc_python

override_dh_auto_test:
dh_auto_test --

override_dh_auto_build:
dh_auto_build -- -j`nproc --ignore=2` \
PREFIX=$(CURDIR)/debian/tmp/usr
dh_auto_build -O--buildsystem=pybuild -O--with=python3 --sourcedirectory=$(CURDIR)/erpc_python

override_dh_auto_install:
dh_auto_install -- \
PREFIX=$(CURDIR)/debian/tmp/usr \
arch_libdir=$(DEB_HOST_MULTIARCH)/
dh_auto_install -O--buildsystem=pybuild -O--with=python3 --sourcedirectory=$(CURDIR)/erpc_python

override_dh_auto_clean:
dh_auto_clean
dh_auto_clean -O--buildsystem=pybuild --sourcedirectory=$(CURDIR)/erpc_python
$(RM) -fr $(CURDIR)/__pycache__/ \
$(CURDIR)/python_build/ \
$(CURDIR)/debian/tmp/ \
$(CURDIR)/debian/.pybuild/ \
$(CURDIR)/.pybuild/ \
$(CURDIR)/Debug/

%:
dh $@ --parallel --with=python3
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0
15 changes: 12 additions & 3 deletions erpc_c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ MAKE_TARGET = $(TARGET_LIB)($(OBJECTS_ALL))

include $(ERPC_ROOT)/mk/targets.mk

include $(ERPC_ROOT)/mk/pkgconfig.mk

$(TARGET_LIB)(%): %
@$(call printmessage,ar,Archiving, $(?F) in $(@F))
$(at)mkdir -p $(dir $(@))
Expand All @@ -130,9 +132,16 @@ $(INC_INSTALL_DIR):

.PHONY: install_lib
install_lib: $(TARGET_LIB)
@$(call printmessage,c,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(LIB_INSTALL_DIR))
$(at)mkdir -p $(LIB_INSTALL_DIR)
$(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR)
@$(call printmessage,c,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(LIB_INSTALL_DIR)/$(arch_libdir))
$(at)mkdir -p $(LIB_INSTALL_DIR)/$(arch_libdir)
$(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR)/$(arch_libdir)

.PHONY: install_pc
install_pc: $(LIB_NAME).pc
@$(call printmessage,ar,pkg-config version, $(ERPC_VERSION))
@$(call printmessage,ar,Installing, $(subst $(LIBS_ROOT)/,,$<) in $(CFG_INSTALL_DIR))
$(at)mkdir -p $(CFG_INSTALL_DIR)
$(at)install $(LIB_NAME).pc $(CFG_INSTALL_DIR)

clean::
$(at)rm -rf $(OBJS_ROOT)/*.cpp $(OBJS_ROOT)/*.hpp $(OBJS_ROOT)/*.c
20 changes: 20 additions & 0 deletions mk/pkgconfig.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
define PKG_CONFIG
prefix=$(PREFIX)
exec_prefix=$${prefix}
includedir=$${prefix}/$(INC_INSTALL_DIR)
libdir=$${exec_prefix}/$(LIB_INSTALL_DIR)/$(arch_libdir)

Name: $(LIB_NAME)
Description: The embeddedRPC Library
Version: $(ERPC_VERSION)
Cflags: -I$${includedir}
Libs: -L$${libdir} -l$(LIB_NAME)
endef

#arch_libdir ?= x86_64-linux-gnu/
CFG_INSTALL_DIR := $(LIB_INSTALL_DIR)/$(arch_libdir)pkgconfig

ERPC_VERSION := $(shell sed -n 's/^\#define ERPC_VERSION .*"\([^"]*\)".*/\1/p' $(ERPC_C_ROOT)/infra/erpc_version.h)

$(LIB_NAME).pc:
$(file > $@,$(PKG_CONFIG))