#!/usr/bin/make -f #export DH_VERBOSE=1 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed # as per upstream request: #export DEB_CFLAGS_MAINT_APPEND = -fvisibility=hidden DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) VER_FULL = $(shell dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-) VER_SONAME = $(shell dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d- | cut -f1-2 -d.) # CFLAGS+=$(CPPFLAGS) -fvisibility=hidden -fvisibility-inlines-hidden CXXFLAGS+=$(CPPFLAGS) -fvisibility=hidden -fvisibility-inlines-hidden # tbb issue: DEB_BUILD_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null) ifeq ($(DEB_BUILD_ARCH_CPU), arm) CXXFLAGS+=-Wa,-mimplicit-it=thumb endif # Disable optimization on mips* because the compiler is running out of memory # see #847752 / #879636 ifneq (,$(filter $(DEB_BUILD_ARCH_CPU), mips mipsel sh4)) CXXFLAGS:=$(filter-out -O2,$(CXXFLAGS)) --param ggc-min-expand=10 -O1 endif # -g is already passed through different mechanism, simply set OPTIMIZE make # variable on mips/el. -g1 seems to be solve symptoms, eg. #890237 ifneq (,$(filter $(DEB_BUILD_ARCH_CPU), mips mipsel)) OPTIMIZE=-g1 endif # deduce documentation option (build-indep target) ifeq "" "$(filter %-doc,$(shell dh_listpackages))" BUILDDOC = DOXYGEN= EPYDOC= else BUILDDOC = endif TESTOPS = CPPUNIT_INCL_DIR=/usr/include CPPUNIT_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) OPTIMIZE=$(OPTIMIZE) \ EXR_INCL_DIR=/usr/include/OpenEXR EXR_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ ILMBASE_INCL_DIR=/usr/include/OpenEXR ILMBASE_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ HT=/usr HDSO=/usr/lib \ LOG4CPLUS_INCL_DIR=/usr/include LOG4CPLUS_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) ALLOPTS = $(BUILDDOC) $(TESTOPS) BOOST_PYTHON_LIB=-lboost_python27 PYTHON_VERSION=2.7 \ BOOST_PYTHON_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) PYTHON_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ PYTHON_INCL_DIR=/usr/include/python2.7 NUMPY_INCL_DIR=/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ \ PYTHON_SONAME_FLAGS= \ GLFW_INCL_DIR=/usr/include/GL GLFW_LIB_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \ LIBS_RPATH='$(LDFLAGS) -ldl -lm -lz -lHalf -ltbb -latomic -lblosc -llog4cplus -lboost_filesystem -lboost_system -lboost_iostreams' LIBOPENVDB_RPATH= \ verbose=yes debug=yes rpath=no shared=yes %: dh $@ --parallel --with python2 MPL: LICENSE cp -f $< $@ override_dh_auto_build-arch: test -h openvdb || ln -f -s . openvdb dh_auto_build -- $(ALLOPTS) override_dh_auto_test-arch: timeout 2h dh_auto_test -- $(TESTOPS) || true override_dh_auto_build-indep: $(MAKE) doc # No tests needed for docs override_dh_auto_test-indep: override_dh_auto_install-indep: # do not run make install override_dh_auto_install-arch: dh_auto_install -- $(ALLOPTS) DESTDIR=$(CURDIR)$(DESTDIR)/debian/tmp/usr DESTDIR_LIB_DIR=$(CURDIR)$(DESTDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) rm openvdb pkg_run = libopenvdb-tools pkg_lib = libopenvdb$(VER_SONAME) pkg_dev = libopenvdb-dev pkg_doc = libopenvdb-doc pkg_py = python-openvdb PYMODDIR := /usr/lib/$(shell pyversions -r) override_dh_install-indep: override_dh_install-arch: dh_numpy --package=$(pkg_py) dh_install -p$(pkg_run) debian/tmp/usr/bin dh_install -p$(pkg_lib) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libopenvdb.so.$(VER_SONAME) dh_install -p$(pkg_lib) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libopenvdb.so.$(VER_FULL) dh_install -p$(pkg_dev) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libopenvdb.so dh_install -p$(pkg_dev) debian/tmp/usr/include #dh_install -p$(pkg_doc) debian/tmp/usr/share/doc dh_install -p$(pkg_py) debian/tmp/usr/python/lib/python2.7/pyopenvdb.so $(PYMODDIR)/dist-packages/ override_dh_installdocs: MPL dh_installdocs -A $^ #override_dh_shlibdeps: # dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info override_dh_clean: #test -h openvdb || { unlink openvdb; } dh_clean doc/doxygen_sqlite3.db # man page cannot be automatically generated since we need to cleanup help2man output debian/vdb_print.1: debian/vdb_print.1.in help2man --version-string=$(VER_FULL) --include=$< --output=$@ --no-info --no-discard-stderr vdb_print debian/vdb_view.1: debian/vdb_view.1.in help2man --version-string=$(VER_FULL) --include=$< --output=$@ --no-info --no-discard-stderr vdb_view debian/vdb_render.1: debian/vdb_render.1.in help2man --version-string=$(VER_FULL) --include=$< --output=$@ --no-info --no-discard-stderr vdb_render debian/vdb_lod.1: debian/vdb_lod.1.in help2man --version-string=$(VER_FULL) --include=$< --output=$@ --no-info --no-discard-stderr vdb_lod get-orig-source: uscan --verbose --force-download --rename --repack