#!/usr/bin/make -f package := libopendbx1 backends := firebird mssql mysql pgsql odbc sqlite3 sybase includes := -I/usr/include/mysql -I/usr/include/postgresql tmpdir := debian/tmp # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # see FEATURE AREAS in dpkg-buildflags(1) export DEB_BUILD_MAINT_OPTIONS = hardening=+all # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) doxygen_version := $(shell dpkg-query -W -f="\$${Version}\n" doxygen) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) CONFFLAGS = --build $(DEB_HOST_GNU_TYPE) else CONFFLAGS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) with_check := disabled by DEB_BUILD_OPTIONS. else ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) with_check := disabled because cross-compiling. else with_check := yes endif endif ifneq (/usr/share/pkg-kde-tools/bin,$(filter /usr/share/pkg-kde-tools/bin,$(subst :, ,$(PATH)))) export PATH := /usr/share/pkg-kde-tools/bin:$(PATH) endif CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -Wall -pedantic -std=c99 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) -Wall -pedantic -std=c++11 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) %: dh $@ override_dh_auto_configure: CFLAGS="${CFLAGS}" \ CPPFLAGS="${includes} ${CPPFLAGS}" \ CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" \ ./configure ${CONFFLAGS} \ --prefix=/usr \ --disable-rpath \ --with-backends="${backends}" execute_after_dh_auto_build: ln $(CURDIR)/lib/opendbx/api $(CURDIR)/lib/opendbx/api.dox override_dh_auto_test: ifeq ($(with_check),yes) cp $(CURDIR)/debian/odbxtest.site $(CURDIR)/test cd test; ./odbxtest.sh rm -f $(CURDIR)/test/odbxtest.site rm -f $(CURDIR)/debian/testdb rm -r $(CURDIR)/test/testresult* else @echo "Testsuite not run: $(with_check)." endif override_dh_install-arch: dh_installdocs -p${package}t64 dh_installchangelogs -p${package}t64 ChangeLog dh_installman -p${package}-dev ${tmpdir}/usr/share/man/man3/* dh_install -p${package}t64 "${tmpdir}/usr/lib/libopendbx.so.*" "usr/lib/" dh_install -p${package}t64 "${tmpdir}/usr/lib/libopendbxplus.so.*" "usr/lib/" dh_install -p${package}t64 --autodest "${tmpdir}/usr/share/locale/*/*/opendbx.mo" dh_install -p${package}-dev "${tmpdir}/usr/include/opendbx/api" "usr/include/opendbx" dh_install -p${package}-dev "${tmpdir}/usr/include/opendbx/api.h" "usr/include/opendbx" dh_install -p${package}-dev "${tmpdir}/usr/lib/libopendbx.so" "${tmpdir}/usr/lib/libopendbx.a" "usr/lib/" dh_install -p${package}-dev "${tmpdir}/usr/lib/libopendbxplus.so" "${tmpdir}/usr/lib/libopendbxplus.a" "usr/lib/" dh_install -p${package}-dev "opendbx.pc" "usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/" dh_link -p${package}-dev "usr/share/doc/${package}t64" "usr/share/doc/${package}-dev" dh_link -p${package}-dev "usr/include/opendbx/api.h" "usr/include/odbx.h" dh_link -popendbx-utils "usr/share/doc/${package}t64" "usr/share/doc/opendbx-utils" set -e ; \ for be in ${backends} ; do \ dh_install -p${package}-$${be} "${tmpdir}/usr/lib/opendbx/lib$${be}backend.so*" "usr/lib/opendbx/" ; \ dh_link -p${package}-$${be} "usr/share/doc/${package}t64" "usr/share/doc/${package}-$${be}" ; \ done dh_installman -popendbx-utils ${tmpdir}/usr/share/man/man1/* dh_install -popendbx-utils mv $(CURDIR)/debian/opendbx-utils/usr/bin/odbxtest.sh $(CURDIR)/debian/opendbx-utils/usr/bin/odbxtest.master override_dh_missing: dh_missing --list-missing override_dh_makeshlibs: dh_makeshlibs --exclude=backend execute_after_dh_auto_clean: rm -f build*stamp rm -f install*stamp rm -f debian/files rm -rf doc/html rm -f doc/*.3 rm -rf doc/man rm -rf doc/xml rm -rf doc/doxygen_sqlite3.db rm -rf utils/doc/odbx-sql.1 rm -rf lib/opendbx/api.dox