Debian
dh_install 找不到 usr/lib/lib*.a
我正在嘗試
.deb
為樹莓派的 openCV 3.2 創建一個包。我的
control
文件是:Source: opencv Priority: optional Maintainer: xxx <xxx@xx.xx> Build-Depends: debhelper (>= 9), cmake Standards-Version: 3.9.5 Section: libs Homepage: <insert the upstream URL, if relevant> #Vcs-Git: git://anonscm.debian.org/collab-maint/opencv.git #Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/opencv.git;a=summary Package: opencv-dev Section: libdevel Architecture: any Depends: opencv (= ${binary:Version}), ${misc:Depends} Description: <insert up to 60 chars description> <insert long description, indented with spaces> Package: opencv1 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: <insert up to 60 chars description> <insert long description, indented with spaces>
我
opencv1.install
的是:usr/lib/lib*.so.*
我的
rules
文件是:#!/usr/bin/make -f # See debhelper(7) (uncomment to enable) # output every command that modifies files on the build system. DH_VERBOSE = 1 export DH_OPTIONS=-v # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk # see FEATURE AREAS in dpkg-buildflags(1) #export DEB_BUILD_MAINT_OPTIONS = hardening=+all # see ENVIRONMENT in dpkg-buildflags(1) # package maintainers to append CFLAGS #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed # main packaging script based on dh7 syntax %: dh $@ --buildsystem=cmake # debmake generated override targets # This is example for Cmake (See http://bugs.debian.org/641051 ) override_dh_auto_configure: dh_auto_configure -- \ -D CMAKE_BUILD_TYPE=RELEASE \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D BUILD_EXAMPLES=ON .. override_dh_auto_test:
問題是當我執行以下命令時:
dpkg-buildpackage -us -uc --source-option=--include-binaries --source-option=-isession
它配置和建構 opencv,但是當它嘗試安裝時,它輸出以下錯誤:
make[1]: Leaving directory '/home/pi/debianizator/opencv-3.2.0/obj-arm-linux-gnueabihf' cd /home/pi/debianizator/opencv-3.2.0 dh_install -O--buildsystem=cmake cp --reflink=auto -a debian/tmp/usr/include/opencv debian/opencv-dev//usr/include/ cp --reflink=auto -a debian/tmp/usr/include/opencv2 debian/opencv-dev//usr/include/ dh_install: Cannot find (any matches for) "usr/lib/lib*.a" (tried in "." and "debian/tmp") dh_install: opencv-dev missing files: usr/lib/lib*.a dh_install: Cannot find (any matches for) "usr/share/pkgconfig/*" (tried in "." and "debian/tmp") dh_install: opencv-dev missing files: usr/share/pkgconfig/* dh_install: missing files, aborting debian/rules:23: recipe for target 'binary' failed make: *** [binary] Error 2 dpkg-buildpackage: fallo: fakeroot debian/rules binary devolvió un estado de salida de error 2
似乎沒有找到靜態庫,事實上,如果我列出
tmp/lib
沒有靜態庫。這是內容debian/tmp/lib
libopencv_calib3d.so libopencv_objdetect.so.3.2.0 libopencv_calib3d.so.3.2 libopencv_photo.so libopencv_calib3d.so.3.2.0 libopencv_photo.so.3.2 libopencv_core.so libopencv_photo.so.3.2.0 libopencv_core.so.3.2 libopencv_shape.so libopencv_core.so.3.2.0 libopencv_shape.so.3.2 libopencv_features2d.so libopencv_shape.so.3.2.0 libopencv_features2d.so.3.2 libopencv_stitching.so libopencv_features2d.so.3.2.0 libopencv_stitching.so.3.2 libopencv_flann.so libopencv_stitching.so.3.2.0 libopencv_flann.so.3.2 libopencv_superres.so libopencv_flann.so.3.2.0 libopencv_superres.so.3.2 libopencv_highgui.so libopencv_superres.so.3.2.0 libopencv_highgui.so.3.2 libopencv_videoio.so libopencv_highgui.so.3.2.0 libopencv_videoio.so.3.2 libopencv_imgcodecs.so libopencv_videoio.so.3.2.0 libopencv_imgcodecs.so.3.2 libopencv_video.so libopencv_imgcodecs.so.3.2.0 libopencv_video.so.3.2 libopencv_imgproc.so libopencv_video.so.3.2.0 libopencv_imgproc.so.3.2 libopencv_videostab.so libopencv_imgproc.so.3.2.0 libopencv_videostab.so.3.2 libopencv_ml.so libopencv_videostab.so.3.2.0 libopencv_ml.so.3.2 pkgconfig libopencv_ml.so.3.2.0 python2.7 libopencv_objdetect.so python3.4 libopencv_objdetect.so.3.2
另一方面,我不知道為什麼它會嘗試安裝靜態庫,因為正如我在上面發布的那樣,
opencv1.install
並沒有說明必須安裝靜態庫。那麼我該如何解決這個錯誤並生成一個
.deb
?
您需要編輯
debian/opencv-dev.install
和刪除對不存在文件的引用(至少usr/lib/lib*a.
andusr/share/pkg-config/*
,儘管後者感覺像是一個錯誤)。