#!/usr/bin/make -f

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_HOST_ARCH),amd64)
export instantclientdir = instantclient-linux-x86_64
export ARCH = 64
else
export instantclientdir = instantclient-linux_i386
export ARCH =
endif

export LIB_VERSION = 19.6

DESTDIR = $(CURDIR)/debian/oracle-instantclient-basic

%:
	dh $@

execute_after_dh_install:
	$(shell (echo "/usr/lib/oracle/$(LIB_VERSION)/client$(ARCH)/lib/" >$(DESTDIR)/etc/ld.so.conf.d/oracle.conf))
	# remove symlink for libclntsh.so and libocci.so:
	# it's provided by oracle-instantclient$(LIB_VERSION)-devel
	rm -v $(DESTDIR)/usr/lib/oracle/$(LIB_VERSION)/client$(ARCH)/lib/libclntsh.so
	rm -v $(DESTDIR)/usr/lib/oracle/$(LIB_VERSION)/client$(ARCH)/lib/libocci.so

override_dh_dwz:
	# don't run tools on binaries files. We just want to install the
	# upstream binaries files

override_dh_shlibdeps:
	dh_shlibdeps -l$(DESTDIR)/usr/lib/oracle/$(LIB_VERSION)/client$(ARCH)/lib
