From 1ad9b7c6aa6cb139f091e2e577fa36f04fa0f1c8 Mon Sep 17 00:00:00 2001 From: florent pirou Date: Fri, 17 Jun 2022 07:01:29 -0700 Subject: [PATCH 1/3] debian: initial erpc packages build * build liberpc, python3-erpc and erc-tools using debhelper ``` Format: 1.0 Source: erpc Binary: liberpc-dev, erpc-tools, python3-erpc Architecture: any Version: 1.9.0 Maintainer: Dusan Cervenka Standards-Version: 4.1.4 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 Package-List: erpc-tools deb libs extra arch=amd64 liberpc-dev deb libdevel extra arch=amd64 python3-erpc deb python extra arch=any ``` Signed-off-by: florent pirou --- .gitignore | 6 +- debian/changelog | 5 ++ debian/compat | 1 + debian/control | 32 ++++++++ debian/copyright | 1 + debian/docs | 1 + debian/erpc-tools.install | 2 + debian/liberpc-dev.install | 6 ++ .../debian-add-liberpc-pkg-config-file.patch | 76 +++++++++++++++++++ ...ynamic_init-not-available-to-clients.patch | 38 ++++++++++ debian/patches/series | 2 + debian/python3-erpc.install | 1 + debian/rules | 50 ++++++++++++ debian/source/format | 1 + 14 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/erpc-tools.install create mode 100644 debian/liberpc-dev.install create mode 100644 debian/patches/debian-add-liberpc-pkg-config-file.patch create mode 100644 debian/patches/fix-erpc_mbf_dynamic_init-not-available-to-clients.patch create mode 100644 debian/patches/series create mode 100644 debian/python3-erpc.install create mode 100755 debian/rules create mode 100644 debian/source/format diff --git a/.gitignore b/.gitignore index 949e5573..95296ac5 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/debian/changelog b/debian/changelog new file mode 100644 index 00000000..f95b9687 --- /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 00000000..b4de3947 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..6e231756 --- /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 00000000..7a694c96 --- /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 00000000..42061c01 --- /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 00000000..09b438aa --- /dev/null +++ b/debian/erpc-tools.install @@ -0,0 +1,2 @@ +Debug/Linux/erpcgen/erpcgen usr/bin +Debug/Linux/erpcsniffer/erpcsniffer usr/bin diff --git a/debian/liberpc-dev.install b/debian/liberpc-dev.install new file mode 100644 index 00000000..940a4074 --- /dev/null +++ b/debian/liberpc-dev.install @@ -0,0 +1,6 @@ +erpc_c/config/*.h usr/include/erpc/ +erpc_c/infra/*.h usr/include/erpc/ +erpc_c/port/*.h usr/include/erpc/ +erpc_c/setup/*.h usr/include/erpc/ +Debug/Linux/erpc/lib/liberpc.a usr/lib/x86_64-linux-gnu/ +erpc_c/erpc.pc usr/lib/x86_64-linux-gnu/pkgconfig diff --git a/debian/patches/debian-add-liberpc-pkg-config-file.patch b/debian/patches/debian-add-liberpc-pkg-config-file.patch new file mode 100644 index 00000000..faf06480 --- /dev/null +++ b/debian/patches/debian-add-liberpc-pkg-config-file.patch @@ -0,0 +1,76 @@ +From 9382f1d480aabeca854546d45e365fdc62853e3f Mon Sep 17 00:00:00 2001 +From: florent pirou +Date: Fri, 17 Jun 2022 03:03:30 -0700 +Subject: [PATCH 5/5] debian: add liberpc pkg-config file + +Signed-off-by: florent pirou +--- + Makefile | 1 + + erpc_c/Makefile | 8 ++++++++ + mk/pkgconfig.mk | 17 +++++++++++++++++ + 3 files changed, 26 insertions(+) + create mode 100644 mk/pkgconfig.mk + +diff --git a/Makefile b/Makefile +index 5dca3bf..6edf7ab 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/erpc_c/Makefile b/erpc_c/Makefile +index f5d33b3..06c0840 100644 +--- a/erpc_c/Makefile ++++ b/erpc_c/Makefile +@@ -106,6 +106,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 $(@)) +@@ -129,5 +131,11 @@ install_lib: $(TARGET_LIB) + $(at)mkdir -p $(LIB_INSTALL_DIR) + $(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR) + ++.PHONY: install_pc ++install_pc: $(LIB_NAME).pc ++ @$(call printmessage,ar,pkg-config version, $(ERPC_VERSION)) ++ $(at)mkdir -p $(LIB_INSTALL_DIR) ++ $(at)install $(LIB_NAME).pc $(LIB_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 0000000..eeae82a +--- /dev/null ++++ b/mk/pkgconfig.mk +@@ -0,0 +1,17 @@ ++define PKG_CONFIG ++prefix=/usr ++exec_prefix=$${prefix} ++includedir=$${prefix}/include ++libdir=$${exec_prefix}/lib/x86_64-linux-gnu ++ ++Name: $(LIB_NAME) ++Description: The embeddedRPC Library ++Version: $(ERPC_VERSION) ++Cflags: -I$${includedir}/$(LIB_NAME) ++Libs: -L$${libdir} -l$(LIB_NAME) ++endef ++ ++ERPC_VERSION := $(shell sed -n 's/^\#define ERPC_VERSION .*"\([^"]*\)".*/\1/p' $(ERPC_C_ROOT)/infra/erpc_version.h) ++ ++$(LIB_NAME).pc: ++ $(file > $@,$(PKG_CONFIG)) +-- +2.17.1 + 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 00000000..45501a2d --- /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 00000000..e1d46d2c --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +fix-erpc_mbf_dynamic_init-not-available-to-clients.patch +debian-add-liberpc-pkg-config-file.patch diff --git a/debian/python3-erpc.install b/debian/python3-erpc.install new file mode 100644 index 00000000..d03e1c79 --- /dev/null +++ b/debian/python3-erpc.install @@ -0,0 +1 @@ +.pybuild/cpython3_3.9_eprc/build/erpc/* lib/python3/dist-packages/erpc diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..b5c0c29a --- /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=eprc +export PYBUILD_SYSTEM=distutils + +CONFIGURE_PREFIX=/usr + +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` + dh_auto_build -O--buildsystem=pybuild -O--with=python3 --sourcedirectory=$(CURDIR)/erpc_python + +override_dh_auto_install: + dh_auto_install -- \ + prefix=$(CONFIGURE_PREFIX) \ + includedir=include \ + libdir=lib/$(DEB_HOST_MULTIARCH) + dh_auto_install -O--buildsystem=pybuild --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)/.pybuild/ \ + $(CURDIR)/Debug/ + +%: + dh $@ --parallel --with=python3 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..d3827e75 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +1.0 From 700a35c2db856f43d9287baec5de783c6da5e179 Mon Sep 17 00:00:00 2001 From: florent pirou Date: Fri, 17 Jun 2022 03:03:30 -0700 Subject: [PATCH 2/3] debian: add liberpc pkg-config file Signed-off-by: florent pirou --- Makefile | 1 + erpc_c/Makefile | 15 ++++++++++++--- mk/pkgconfig.mk | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 mk/pkgconfig.mk diff --git a/Makefile b/Makefile index 5dca3bf6..6edf7ab9 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/erpc_c/Makefile b/erpc_c/Makefile index facfa358..4be4c2ab 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 00000000..da4a04fd --- /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)) From 81ae999d4d9405693b24faaa3fe132c68f50e67f Mon Sep 17 00:00:00 2001 From: florent pirou Date: Fri, 17 Jun 2022 09:52:49 -0700 Subject: [PATCH 3/3] debhelper: fix prefix install path Signed-off-by: florent pirou --- debian/erpc-tools.install | 4 +- debian/liberpc-dev.install | 9 +-- .../debian-add-liberpc-pkg-config-file.patch | 76 ------------------- debian/patches/series | 1 - debian/python3-erpc.install | 1 - debian/rules | 16 ++-- 6 files changed, 13 insertions(+), 94 deletions(-) delete mode 100644 debian/patches/debian-add-liberpc-pkg-config-file.patch delete mode 100644 debian/python3-erpc.install diff --git a/debian/erpc-tools.install b/debian/erpc-tools.install index 09b438aa..fe0b9953 100644 --- a/debian/erpc-tools.install +++ b/debian/erpc-tools.install @@ -1,2 +1,2 @@ -Debug/Linux/erpcgen/erpcgen usr/bin -Debug/Linux/erpcsniffer/erpcsniffer usr/bin +usr/bin/erpcgen +usr/bin/erpcsniffer diff --git a/debian/liberpc-dev.install b/debian/liberpc-dev.install index 940a4074..bcc42b02 100644 --- a/debian/liberpc-dev.install +++ b/debian/liberpc-dev.install @@ -1,6 +1,3 @@ -erpc_c/config/*.h usr/include/erpc/ -erpc_c/infra/*.h usr/include/erpc/ -erpc_c/port/*.h usr/include/erpc/ -erpc_c/setup/*.h usr/include/erpc/ -Debug/Linux/erpc/lib/liberpc.a usr/lib/x86_64-linux-gnu/ -erpc_c/erpc.pc usr/lib/x86_64-linux-gnu/pkgconfig +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/debian-add-liberpc-pkg-config-file.patch b/debian/patches/debian-add-liberpc-pkg-config-file.patch deleted file mode 100644 index faf06480..00000000 --- a/debian/patches/debian-add-liberpc-pkg-config-file.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 9382f1d480aabeca854546d45e365fdc62853e3f Mon Sep 17 00:00:00 2001 -From: florent pirou -Date: Fri, 17 Jun 2022 03:03:30 -0700 -Subject: [PATCH 5/5] debian: add liberpc pkg-config file - -Signed-off-by: florent pirou ---- - Makefile | 1 + - erpc_c/Makefile | 8 ++++++++ - mk/pkgconfig.mk | 17 +++++++++++++++++ - 3 files changed, 26 insertions(+) - create mode 100644 mk/pkgconfig.mk - -diff --git a/Makefile b/Makefile -index 5dca3bf..6edf7ab 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/erpc_c/Makefile b/erpc_c/Makefile -index f5d33b3..06c0840 100644 ---- a/erpc_c/Makefile -+++ b/erpc_c/Makefile -@@ -106,6 +106,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 $(@)) -@@ -129,5 +131,11 @@ install_lib: $(TARGET_LIB) - $(at)mkdir -p $(LIB_INSTALL_DIR) - $(at)install $(TARGET_LIB) $(LIB_INSTALL_DIR) - -+.PHONY: install_pc -+install_pc: $(LIB_NAME).pc -+ @$(call printmessage,ar,pkg-config version, $(ERPC_VERSION)) -+ $(at)mkdir -p $(LIB_INSTALL_DIR) -+ $(at)install $(LIB_NAME).pc $(LIB_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 0000000..eeae82a ---- /dev/null -+++ b/mk/pkgconfig.mk -@@ -0,0 +1,17 @@ -+define PKG_CONFIG -+prefix=/usr -+exec_prefix=$${prefix} -+includedir=$${prefix}/include -+libdir=$${exec_prefix}/lib/x86_64-linux-gnu -+ -+Name: $(LIB_NAME) -+Description: The embeddedRPC Library -+Version: $(ERPC_VERSION) -+Cflags: -I$${includedir}/$(LIB_NAME) -+Libs: -L$${libdir} -l$(LIB_NAME) -+endef -+ -+ERPC_VERSION := $(shell sed -n 's/^\#define ERPC_VERSION .*"\([^"]*\)".*/\1/p' $(ERPC_C_ROOT)/infra/erpc_version.h) -+ -+$(LIB_NAME).pc: -+ $(file > $@,$(PKG_CONFIG)) --- -2.17.1 - diff --git a/debian/patches/series b/debian/patches/series index e1d46d2c..ad61b3f3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ fix-erpc_mbf_dynamic_init-not-available-to-clients.patch -debian-add-liberpc-pkg-config-file.patch diff --git a/debian/python3-erpc.install b/debian/python3-erpc.install deleted file mode 100644 index d03e1c79..00000000 --- a/debian/python3-erpc.install +++ /dev/null @@ -1 +0,0 @@ -.pybuild/cpython3_3.9_eprc/build/erpc/* lib/python3/dist-packages/erpc diff --git a/debian/rules b/debian/rules index b5c0c29a..8e1c233a 100755 --- a/debian/rules +++ b/debian/rules @@ -16,11 +16,9 @@ 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=eprc +export PYBUILD_NAME=erpc export PYBUILD_SYSTEM=distutils -CONFIGURE_PREFIX=/usr - override_dh_auto_configure: dh_auto_configure -O--buildsystem=pybuild --sourcedirectory=$(CURDIR)/erpc_python @@ -28,21 +26,23 @@ override_dh_auto_test: dh_auto_test -- override_dh_auto_build: - dh_auto_build -- -j`nproc --ignore=2` + 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=$(CONFIGURE_PREFIX) \ - includedir=include \ - libdir=lib/$(DEB_HOST_MULTIARCH) - dh_auto_install -O--buildsystem=pybuild --sourcedirectory=$(CURDIR)/erpc_python + 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/