| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 4 |
|
| 5 |
# Since upstream commit 61f747d, upstream build system only builds |
| 6 |
# either static link files or shared libraries at the same time, |
| 7 |
# but not both. In order to generate all needed files for proper |
| 8 |
# Debian packaging we have therefore to build two times, with |
| 9 |
# different BUILD_SHARED_LIBS. |
| 10 |
# |
| 11 |
# See https://github.com/davisking/dlib/issues/923 for more info |
| 12 |
|
| 13 |
CONFIG_SHARED_PATH = config_shared |
| 14 |
CONFIG_STATIC_PATH = config_static |
| 15 |
LIB_SOVERSION = 20.0 |
| 16 |
EXAMPLES_PATH = debian/libdlib$(LIB_SOVERSION)/usr/share/doc/libdlib$(LIB_SOVERSION)/examples/ |
| 17 |
|
| 18 |
%: |
| 19 |
dh $@ --buildsystem=cmake |
| 20 |
|
| 21 |
override_dh_auto_configure: |
| 22 |
dh_auto_configure -B$(CONFIG_SHARED_PATH) -- -DDLIB_NO_GUI_SUPPORT=ON -DBUILD_SHARED_LIBS=ON -DSOVERSION=$(LIB_SOVERSION) |
| 23 |
dh_auto_configure -B$(CONFIG_STATIC_PATH) -- -DDLIB_NO_GUI_SUPPORT=ON -DBUILD_SHARED_LIBS=OFF -DSOVERSION=$(LIB_SOVERSION) |
| 24 |
|
| 25 |
override_dh_auto_build: |
| 26 |
dh_auto_build -B$(CONFIG_STATIC_PATH) |
| 27 |
dh_auto_build -B$(CONFIG_SHARED_PATH) |
| 28 |
|
| 29 |
override_dh_auto_test: |
| 30 |
dh_auto_test -B$(CONFIG_STATIC_PATH) |
| 31 |
dh_auto_test -B$(CONFIG_SHARED_PATH) |
| 32 |
|
| 33 |
override_dh_auto_clean: |
| 34 |
dh_auto_clean |
| 35 |
rm -rf $(CONFIG_SHARED_PATH) $(CONFIG_STATIC_PATH) |
| 36 |
|
| 37 |
override_dh_auto_install: |
| 38 |
dh_auto_install -B$(CONFIG_STATIC_PATH) |
| 39 |
dh_auto_install -B$(CONFIG_SHARED_PATH) |
| 40 |
# Remove empty directories |
| 41 |
find $(CURDIR)/debian/tmp/usr/include/dlib -type d -empty -delete |
| 42 |
|
| 43 |
override_dh_fixperms-arch: |
| 44 |
dh_fixperms |
| 45 |
# Fix wrong permissions in examples/ |
| 46 |
chmod 644 $(EXAMPLES_PATH)/max_cost_assignment_ex.cpp |