diff --git a/.gitignore b/.gitignore index 949e5573a..95296ac5c 100644 --- a/.gitignore +++ b/.gitignore @@ -52,9 +52,9 @@ Module.symvers patches-* # quilt's files -patches -series -*.patch +#patches +#series +#*.patch # cscope files cscope.* diff --git a/Makefile b/Makefile index 5dca3bf64..6edf7ab93 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 000000000..f95b96871 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +erpc (1.9.0) UNRELEASED; urgency=low + + * Initial release as Debian bullseye package. + + -- Florent Pirou Fri, 17 Jun 2022 00:00:42 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 000000000..b4de39476 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 000000000..6e231756a --- /dev/null +++ b/debian/control @@ -0,0 +1,32 @@ +Source: erpc +Section: libs +Priority: extra +Maintainer: ECI Maintainer +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. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 000000000..7a694c969 --- /dev/null +++ b/debian/copyright @@ -0,0 +1 @@ +LICENSE \ No newline at end of file diff --git a/debian/docs b/debian/docs new file mode 100644 index 000000000..42061c01a --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/debian/erpc-tools.install b/debian/erpc-tools.install new file mode 100644 index 000000000..fe0b9953f --- /dev/null +++ b/debian/erpc-tools.install @@ -0,0 +1,2 @@ +usr/bin/erpcgen +usr/bin/erpcsniffer diff --git a/debian/liberpc-dev.install b/debian/liberpc-dev.install new file mode 100644 index 000000000..bcc42b028 --- /dev/null +++ b/debian/liberpc-dev.install @@ -0,0 +1,3 @@ +usr/include/erpc +usr/lib/x86_64-linux-gnu/liberpc.a +usr/lib/x86_64-linux-gnu/pkgconfig/erpc.pc diff --git a/debian/patches/fix-erpc_mbf_dynamic_init-not-available-to-clients.patch b/debian/patches/fix-erpc_mbf_dynamic_init-not-available-to-clients.patch new file mode 100644 index 000000000..45501a2d5 --- /dev/null +++ b/debian/patches/fix-erpc_mbf_dynamic_init-not-available-to-clients.patch @@ -0,0 +1,38 @@ +From a57954befc5a51b1849bd4d2127798cd165fe0d5 Mon Sep 17 00:00:00 2001 +From: florent pirou +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 +--- + 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 + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..ad61b3f35 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +fix-erpc_mbf_dynamic_init-not-available-to-clients.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 000000000..8e1c233ac --- /dev/null +++ b/debian/rules @@ -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 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 000000000..d3827e75a --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 diff --git a/erpc_c/Makefile b/erpc_c/Makefile index facfa3587..4be4c2aba 100644 --- a/erpc_c/Makefile +++ b/erpc_c/Makefile @@ -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 $(@)) @@ -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 diff --git a/mk/pkgconfig.mk b/mk/pkgconfig.mk new file mode 100644 index 000000000..da4a04fd6 --- /dev/null +++ b/mk/pkgconfig.mk @@ -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))