#!/usr/bin/make -f
## debian/rules for neko.

%:
	dh $@ --with apache2,bash-completion

## Both AMD64 and all kFreeBSDs seem to have problems with the type
## punning used in the Neko source.
ifeq (amd64,$(DEB_HOST_ARCH))
export DEB_CFLAGS_MAINT_APPEND = -fno-strict-aliasing
endif
ifeq (kfreebsd,$(DEB_HOST_ARCH_OS))
export DEB_CFLAGS_MAINT_APPEND = -fno-strict-aliasing
endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_SKIP_RPATH=ON -DRUN_LDCONFIG=OFF

# dh_shlibdeps does not see the ndll files as libraries, so we call dpkg-shlibdeps manually
override_dh_shlibdeps:
	dh_shlibdeps
	dpkg-shlibdeps -Tdebian/neko.substvars debian/neko/usr/bin/* debian/neko/usr/lib/neko/*.ndll

get-orig-source:
	uscan --verbose --rename --force-download
