Debian
如何將共享庫依賴項添加到 debian/control?
我正在嘗試從一個依賴 OpenCV 的 Qt 應用程序製作一個 debian 包。
到目前為止我做了什麼:
- 我在 Virtualbox 中設置了一個 Ubuntu
- 我安裝了必要的軟體來編譯和執行應用程序(Qt 相關的東西
ffmpeg
、編解碼器、OpenCV 等)- 我成功編譯並執行了應用程序
- 我創建了一個 GPG 密鑰
- 使用 dh_make 我在項目目錄中創建了 debian 目錄
- 我將軟體包添加到 debian/control->Build 取決於我通過執行得到的結果
dpkg-depcheck -d qmake
- 我還添加了 dpkg-depcheck -d SampleApp 獲得的 Depends
- 我編輯了版權和變更日誌文件
- 我試著跑
dpkg-buildpackage -b
此時我收到錯誤消息:
dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libopencv_imgcodecs.so.3.1 (used by debian/sampleapp/opt/SampleApp/bin/SampleApp) dh_shlibdeps: dpkg-shlibdeps -Tdebian/sampleapp.substvars debian/sampleapp/opt/SampleApp/bin/SampleApp returned exit code 2 make: *** [binary] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2
所有這些文件都可以在
/usr/local/lib/
. 我已閱讀此內容:https ://www.debian.org/doc/debian-policy/ch-sharedlibs.html但我找不到解決方案。如何將這些依賴項添加到包中?編輯:
Build-Depends field: Build-Depends: debhelper (>= 8.0.0), libpopt0:i386, libqt5core5a:i386, qtdeclarative5-dev, libglib2.0-0:i386, qtchooser, pkg-config, qt5-qmake:i386, locales Depends field: Depends: ${shlibs:Depends}, ${misc:Depends}, udev, libxext6:i386, libxcomposite1:i386, libopencore-amrwb0:i386, libglib2.0-0:i386, libpangocairo-1.0-0:i386, libva-drm1:i386, libxinerama1:i386, libmp3lame0:i386, libnih1:i386, libx11-6:i386, libxcb-render0:i386, libffi6:i386, libgdk-pixbuf2.0-0:i386, libdrm2:i386, libvorbis0a:i386, libfontconfig1:i386, libxrender1:i386, libpango-1.0-0:i386, libdbus-1-3:i386, libpixman-1-0:i386, libopenexr6:i386, libxvidcore4:i386, libjpeg-turbo8:i386, libcgmanager0:i386, libcairo2:i386, libjasper1:i386, libxfixes3:i386, libilmbase6:i386, libtiff5:i386, libusb-1.0-0:i386, libdc1394-22:i386, libxi6:i386, libfreetype6:i386, libxrandr2:i386, libqt5network5:i386, libpng12-0:i386, libthai0:i386, libxcb-shm0:i386, libva1:i386, libvorbisenc2:i386, libtheora0:i386, libharfbuzz0b:i386, libicu52:i386, libjbig0:i386, libopencore-amrnb0:i386, libogg0:i386, libxcursor1:i386, libxcb1:i386, libraw1394-11:i386, libudev1:i386, libnih-dbus1:i386, libqt5core5a:i386, libgraphite2-3:i386, libva-x11-1:i386, libatk1.0-0:i386, libexpat1:i386, libgtk2.0-0:i386, libpangoft2-1.0-0:i386, libdatrie1:i386, libxdmcp6:i386, libvdpau1:i386, libxdamage1:i386, libxau6:i386
如果您所依賴的共享庫安裝在
/usr/local/lib
而不是/usr/lib
(或類似)中,那麼我懷疑它不是包管理器管理的任何包的一部分dpkg
。dh_shlibdeps
想要建構一個完整列表,列出新包必須依賴的所有內容,但在這種情況下,其中一個似乎存在於任何包之外,因此無法列出。您應該從 Debian 軟體包(加上其相應的
-dev
軟體包,以便您可以針對它進行建構)安裝 OpenCV,而不是從本地安裝。