[Dist/Debian] Add a .pc file to the development package 01/221201/2
authorWook Song <wook16.song@samsung.com>
Tue, 24 Dec 2019 05:41:19 +0000 (14:41 +0900)
committerWook Song <wook16.song@samsung.com>
Fri, 3 Jan 2020 07:36:27 +0000 (16:36 +0900)
This patch adds libinference-engine.pc to the development package in
order to make this package provide the information required to build
binaries using the OpenVino headers and libraries.

Change-Id: Ideaa6a4bf3cc7cb8dd29edc225657dfca076dbdd
Signed-off-by: Wook Song <wook16.song@samsung.com>
debian/libinference-engine-dev.install
debian/rules
packaging/libinference-engine.pc.in [new file with mode: 0644]

index 4bf50dc..d9f03d1 100644 (file)
@@ -4,3 +4,4 @@
 /usr/lib/*/libinference_engine_s.a
 /usr/lib/*/libngraph.a
 /usr/lib/*/libpugixml.a
+/usr/lib/*/pkgconfig/*.pc
index 99da19d..e92137e 100755 (executable)
@@ -14,6 +14,8 @@ LIBDIR        :=      lib/${DEB_HOST_MULTIARCH}
 INCDIR :=      include
 SYSCONFDIR := /etc
 DATADIR        :=      $(PREFIX)/share
+DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
+VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
 
 %:
        dh $@ --with quilt --parallel
@@ -58,10 +60,17 @@ override_dh_auto_build:
 override_dh_auto_install:
                mkdir -p $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR)
                mkdir -p $(SRC_ROOT)/debian/tmp$(PREFIX)/$(INCDIR)
+               mkdir -p debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig
                find $(SRC_ROOT)/inference-engine/bin -name "*.so" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
                find $(SRC_ROOT)/inference-engine/bin -name "plugins.xml" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
                cp -r $(SRC_ROOT)/inference-engine/include/* $(SRC_ROOT)/debian/tmp$(PREFIX)/$(INCDIR)
                find $(SRC_ROOT)/inference-engine/bin -name "*.a" -exec install -m 644 {} $(SRC_ROOT)/debian/tmp$(PREFIX)/$(LIBDIR) \;
+               cp -f $(SRC_ROOT)/packaging/libinference-engine.pc.in debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig
+               sed -i 's|@VERSION@|$(VERSION)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc.in
+               sed -i 's|@PREFIX@|$(PREFIX)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc.in
+               sed -i 's|@LIB_INSTALL_DIR@|$(PREFIX)/$(LIBDIR)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc.in
+               sed -i 's|@INCLUDE_INSTALL_DIR@|$(PREFIX)/$(INCDIR)|g' debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc.in
+               mv debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc.in debian/tmp$(PREFIX)/$(LIBDIR)/pkgconfig/libinference-engine.pc
 
 override_dh_auto_clean:
                dh_auto_clean --builddirectory=$(SRC_ROOT)/inference-engine/build --
diff --git a/packaging/libinference-engine.pc.in b/packaging/libinference-engine.pc.in
new file mode 100644 (file)
index 0000000..8a4b71d
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libinference-engine
+Description: OpenVINO™ Toolkit Development package
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -linference_engine
+Cflags: -I${includedir}