Você precisa editar debian/opencv-dev.install
e remover referências a arquivos inexistentes (pelo menos usr/lib/lib*a.
e usr/share/pkg-config/*
, embora o último pareça um erro).
Estou tentando criar um pacote .deb
para o openCV 3.2 para o raspberry pi.
Meu arquivo control
é:
Source: opencv
Priority: optional
Maintainer: xxx <[email protected]>
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>
Meu opencv1.install
é:
usr/lib/lib*.so.*
e meu arquivo 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:
O problema é que quando eu executo o seguinte comando:
dpkg-buildpackage -us -uc --source-option=--include-binaries --source-option=-isession
Ele configura e constrói o opencv, mas quando tenta instalar, gera o seguinte erro:
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
Parece que não encontra as bibliotecas estáticas e, de fato, se eu listar tmp/lib
, não haverá bibliotecas estáticas. Este é o conteúdo de 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
Por outro lado, eu não sei por que ele tenta instalar bibliotecas estáticas porque, como eu postei acima, o opencv1.install
não diz que bibliotecas estáticas devem ser instaladas.
Então, como posso resolver esse erro e gerar um .deb
?