| 1 |
|
| 2 |
export DH_VERBOSE=1 |
| 3 |
|
| 4 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 5 |
include /usr/share/dpkg/default.mk |
| 6 |
|
| 7 |
|
| 8 |
ifneq ($(SALSABUILD),) |
| 9 |
export DEB_CXXFLAGS_MAINT_APPEND += -g0 |
| 10 |
endif |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) |
| 15 |
export DEB_CXXFLAGS_MAINT_APPEND += -g0 |
| 16 |
endif |
| 17 |
|
| 18 |
SHARED_LIB_PATH = shared_lib |
| 19 |
STATIC_LIB_PATH = static_lib |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
eigenvercurr := $(shell dpkg-query -W -f '$${Source:Upstream-Version}' libeigen3-dev | awk -F. '{print $$1"."$$2"."$$3}') |
| 25 |
eigenvernext := $(shell dpkg-query -W -f '$${Source:Upstream-Version}' libeigen3-dev | awk -F. '{print $$1"."$$2"."$$3+1}') |
| 26 |
|
| 27 |
%: |
| 28 |
dh $@ |
| 29 |
|
| 30 |
override_dh_auto_configure: |
| 31 |
dh_auto_configure -B$(SHARED_LIB_PATH) -- \ |
| 32 |
-DBUILD_SHARED_LIBS=ON \ |
| 33 |
-DBUILD_EXAMPLES=OFF \ |
| 34 |
-DBUILD_TESTING=ON \ |
| 35 |
-DSUITESPARSE_LIBRARY_DIR_HINTS=/usr/lib/${DEB_HOST_MULTIARCH}/ \ |
| 36 |
-DSUITESPARSE_INCLUDE_DIR_HINTS=/usr/include/suitesparse/ \ |
| 37 |
-DCXSPARSE_LIBRARY_DIR_HINTS=/usr/lib/${DEB_HOST_MULTIARCH}/ \ |
| 38 |
-DCXSPARSE_INCLUDE_DIR=/usr/include/suitesparse/ \ |
| 39 |
-DBUILD_DOCUMENTATION=$(if $(filter ceres-solver-doc,$(shell dh_listpackages)),ON,OFF) |
| 40 |
dh_auto_configure -B$(STATIC_LIB_PATH) -- \ |
| 41 |
-DBUILD_SHARED_LIBS=OFF \ |
| 42 |
-DBUILD_EXAMPLES=OFF \ |
| 43 |
-DBUILD_TESTING=OFF \ |
| 44 |
-DSUITESPARSE_LIBRARY_DIR_HINTS=/usr/lib/${DEB_HOST_MULTIARCH}/ \ |
| 45 |
-DSUITESPARSE_INCLUDE_DIR_HINTS=/usr/include/suitesparse/ \ |
| 46 |
-DCXSPARSE_LIBRARY_DIR_HINTS=/usr/lib/${DEB_HOST_MULTIARCH}/ \ |
| 47 |
-DCXSPARSE_INCLUDE_DIR=/usr/include/suitesparse/ \ |
| 48 |
-DBUILD_DOCUMENTATION=OFF \ |
| 49 |
-DCMAKE_BUILD_TYPE=Release |
| 50 |
|
| 51 |
override_dh_auto_build: |
| 52 |
dh_auto_build -B$(SHARED_LIB_PATH) |
| 53 |
dh_auto_build -B$(STATIC_LIB_PATH) |
| 54 |
|
| 55 |
override_dh_auto_test: |
| 56 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 57 |
dh_auto_test -B$(SHARED_LIB_PATH) |
| 58 |
endif |
| 59 |
|
| 60 |
override_dh_auto_clean: |
| 61 |
dh_auto_clean |
| 62 |
-rm -rf $(SHARED_LIB_PATH) $(STATIC_LIB_PATH) |
| 63 |
|
| 64 |
execute_before_dh_gencontrol: |
| 65 |
echo 'eigen:Upstream-Version=$(eigenvercurr)' >> debian/libceres-dev.substvars |
| 66 |
echo 'eigen:Upstream-Version-Next=$(eigenvernext)' >> debian/libceres-dev.substvars |
| 67 |
|
| 68 |
override_dh_compress: |
| 69 |
dh_compress -X.cc -X.h |
| 70 |
|
| 71 |
override_dh_auto_install: |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
dh_auto_install -B$(STATIC_LIB_PATH) |
| 76 |
dh_auto_install -B$(SHARED_LIB_PATH) |
| 77 |
|
| 78 |
override_dh_installdocs-indep: |
| 79 |
|
| 80 |
|
| 81 |
sed -i 's/https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/mathjax\/2.7.1/\/usr\/share\/javascript\/mathjax/g' $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/*.html |
| 82 |
sed -i 's/https:\/\/cdn.jsdelivr.net//g' $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/*.html |
| 83 |
rm $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/doctools.js |
| 84 |
ln -s /usr/share/javascript/sphinxdoc/1.0/doctools.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/doctools.js |
| 85 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/js/html5shiv-printshiv.min.js |
| 86 |
ln -s /usr/share/javascript/html5shiv/html5shiv-printshiv.min.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/js/html5shiv-printshiv.min.js |
| 87 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/js/html5shiv.min.js |
| 88 |
ln -s /usr/share/javascript/html5shiv/html5shiv.min.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/js/html5shiv.min.js |
| 89 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/language_data.js |
| 90 |
ln -s /usr/share/javascript/sphinxdoc/1.0/language_data.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/language_data.js |
| 91 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/searchtools.js |
| 92 |
ln -s /usr/share/javascript/sphinxdoc/1.0/searchtools.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/searchtools.js |
| 93 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/jquery.js |
| 94 |
ln -s /usr/share/javascript/jquery/jquery.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/jquery.js |
| 95 |
rm -f $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/underscore.js |
| 96 |
ln -s /usr/share/javascript/underscore/underscore.js $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/underscore.js |
| 97 |
rm -rf $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/fonts |
| 98 |
ln -s /usr/share/fonts/truetype/lato $(CURDIR)/debian/tmp/usr/share/doc/Ceres/html/_static/fonts |
| 99 |
dh_installdocs |