| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# export DH_VERBOSE = 1 |
| 4 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 5 |
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-error |
| 6 |
|
| 7 |
include /usr/share/dpkg/architecture.mk |
| 8 |
|
| 9 |
ifeq ($(DEB_HOST_ARCH_OS),linux) |
| 10 |
CONFFLAGS += \ |
| 11 |
-Dv4l2=true |
| 12 |
endif |
| 13 |
|
| 14 |
ifneq (,$(filter i386,$(DEB_HOST_ARCH))) |
| 15 |
QCAM=disabled |
| 16 |
# See https://bugs.debian.org/1076986 |
| 17 |
else |
| 18 |
QCAM=enabled |
| 19 |
endif |
| 20 |
|
| 21 |
%: |
| 22 |
dh $@ |
| 23 |
|
| 24 |
override_dh_auto_configure: |
| 25 |
dh_auto_configure -- \ |
| 26 |
--libexecdir=libexec/${DEB_HOST_MULTIARCH} \ |
| 27 |
-Dgstreamer=enabled \ |
| 28 |
-Dlibunwind=disabled \ |
| 29 |
-Dpycamera=enabled \ |
| 30 |
-Dqcam=$(QCAM) \ |
| 31 |
-Dtest=true \ |
| 32 |
$(CONFFLAGS) \ |
| 33 |
$(empty) |
| 34 |
|
| 35 |
# Only make the tests fail for key architectures |
| 36 |
override_dh_auto_test: |
| 37 |
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf)) |
| 38 |
dh_auto_test |
| 39 |
else |
| 40 |
-dh_auto_test |
| 41 |
endif |
| 42 |
|
| 43 |
override_dh_install-indep: |
| 44 |
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) |
| 45 |
mv debian/tmp/usr/share/doc/libcamera-0.* debian/tmp/usr/share/doc/libcamera-doc |
| 46 |
endif |
| 47 |
dh_install -X/.doctrees/ |
| 48 |
|
| 49 |
execute_before_dh_install-arch: |
| 50 |
cp ./obj-${DEB_HOST_GNU_TYPE}/src/apps/ipa-verify/ipa_verify \ |
| 51 |
debian/tmp/usr/bin/ |
| 52 |
|
| 53 |
override_dh_strip: |
| 54 |
dh_strip -a |
| 55 |
MESON_INSTALL_DESTDIR_PREFIX=. ./src/ipa/ipa-sign-install.sh \ |
| 56 |
./obj-${DEB_HOST_GNU_TYPE}/src/ipa-priv-key.pem \ |
| 57 |
debian/libcamera-ipa/usr/lib/${DEB_HOST_MULTIARCH}/libcamera/ipa/ipa_*.so |
| 58 |
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) |
| 59 |
echo "Cross-building: signatures verification disabled!" |
| 60 |
else |
| 61 |
for IPA_MOD in debian/libcamera-ipa/usr/lib/*/libcamera/ipa/ipa_*.so; \ |
| 62 |
do \ |
| 63 |
echo "Verifying signature of $${IPA_MOD}"; \ |
| 64 |
./obj-${DEB_HOST_GNU_TYPE}/src/apps/ipa-verify/ipa_verify $${IPA_MOD}; \ |
| 65 |
done |
| 66 |
endif |
| 67 |
|
| 68 |
execute_after_dh_fixperms: |
| 69 |
find debian/ -name 'v4l2-compat.so' -exec chmod -x '{}' \; |
| 70 |
|
| 71 |
.PHONY: licensecheck |
| 72 |
licensecheck: |
| 73 |
licensecheck --deb-machine -r * \ |
| 74 |
> debian/copyright_newhints |
| 75 |
cmp debian/copyright_hints debian/copyright_newhints \ |
| 76 |
&& rm debian/copyright_newhints |