| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 8 |
BUILDDIR = obj-$(DEB_HOST_MULTIARCH) |
| 9 |
|
| 10 |
CONFIGURE_ARGS= \ |
| 11 |
-DCMAKE_BUILD_TYPE=Release \ |
| 12 |
-DLIB_INSTALL_DIR:STRING="lib/$(DEB_HOST_MULTIARCH)" |
| 13 |
|
| 14 |
override_dh_auto_configure-arch: |
| 15 |
# statically linked |
| 16 |
dh_auto_configure -B $(BUILDDIR)-static \ |
| 17 |
-- $(CONFIGURE_ARGS) \ |
| 18 |
-DBUILD_SHARED_LIBS=OFF \ |
| 19 |
-DBUILD_TESTING=OFF |
| 20 |
|
| 21 |
# dynamically linked |
| 22 |
dh_auto_configure -B $(BUILDDIR) \ |
| 23 |
-- $(CONFIGURE_ARGS) \ |
| 24 |
-DBUILD_SHARED_LIBS=ON \ |
| 25 |
-DBUILD_TESTING=ON |
| 26 |
|
| 27 |
override_dh_auto_configure-indep: |
| 28 |
# not needed |
| 29 |
|
| 30 |
override_dh_auto_build-arch: |
| 31 |
# statically linked |
| 32 |
dh_auto_build -a -B $(BUILDDIR)-static |
| 33 |
# dynamically linked |
| 34 |
dh_auto_build -a -B $(BUILDDIR) |
| 35 |
|
| 36 |
override_dh_auto_build-indep: |
| 37 |
# not needed |
| 38 |
|
| 39 |
|
| 40 |
override_dh_auto_install-arch: |
| 41 |
dh_auto_install -a -O--buildsystem=cmake -B $(BUILDDIR)-static |
| 42 |
dh_auto_install -a -O--buildsystem=cmake -B $(BUILDDIR) |
| 43 |
# put the static libs together with the rest of the stuff |
| 44 |
cp -v $(BUILDDIR)-static/*.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ |
| 45 |
-$(RM) -r $(BUILDDIR)-static |
| 46 |
find $(CURDIR)/debian/tmp/ -type d -name .cmake | xargs -r rm -rfv |
| 47 |
|
| 48 |
override_dh_auto_install-indep: |
| 49 |
# not needed |
| 50 |
|
| 51 |
override_dh_install-arch: |
| 52 |
dh_install -a -O--buildsystem=cmake |
| 53 |
ifneq (,$(findstring $(DEB_HOST_ARCH),amd64 i386 ia64)) |
| 54 |
dh_install -plibgoogle-glog-dev debian/tmp/usr/share/glog usr/share/ |
| 55 |
endif |
| 56 |
|
| 57 |
override_dh_install-indep: |
| 58 |
# not needed |
| 59 |
|
| 60 |
override_dh_auto_test-arch: |
| 61 |
-if [ -f /proc/version ]; then $(MAKE) check; fi |
| 62 |
|
| 63 |
override_dh_auto_test-indep: |
| 64 |
# not needed |
| 65 |
|
| 66 |
override_dh_compress: |
| 67 |
dh_compress -X.rst |
| 68 |
|
| 69 |
%: |
| 70 |
dh $@ --buildsystem=cmake |
| 71 |
|
| 72 |
get-orig-source: |
| 73 |
uscan --verbose --force-download --rename |
| 74 |
|
| 75 |
.PHONY: override_dh_auto_configure-arch override_dh_auto_configure-indep \ |
| 76 |
override_dh_auto_build-arch override_dh_auto_build-indep \ |
| 77 |
override_dh_auto_install-arch override_dh_auto_install-indep \ |
| 78 |
override_dh_install-arch override_dh_install-indep \ |
| 79 |
override_dh_auto_test-arch override_dh_auto_test-indep \ |
| 80 |
override_dh_compress |