#!/usr/bin/make -f


# Standard way of building Haskell libraries .
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/hlibrary.mk

# If no threaded RTS is found, disable it
DEB_SETUP_GHC_CONFIGURE_ARGS := $(shell test -e /usr/lib/ghc-$(GHC_VERSION)/libHSrts_thr.a || echo --flags=-threaded)

install/hlint :: debian/tmp-inst-ghc
	mkdir -p debian/$(CABAL_PACKAGE)/usr/share/emacs/site-lisp \
	debian/$(CABAL_PACKAGE)/usr/bin debian/$(CABAL_PACKAGE)/usr/share/man/man1
	mv debian/tmp-inst-ghc/usr/bin/hlint debian/$(CABAL_PACKAGE)/usr/bin/
	mv debian/tmp-inst-ghc/usr/share/hlint-*/hs-lint.el debian/$(CABAL_PACKAGE)/usr/share/emacs/site-lisp
	mv debian/tmp-inst-ghc/usr/share/hlint-*/ debian/$(CABAL_PACKAGE)/usr/share/
	rm -rf debian/$(CABAL_PACKAGE)/usr/share/doc
	install -Dm 644 hlint.htm debian/$(CABAL_PACKAGE)/usr/share/doc/$(CABAL_PACKAGE)/hlint.html
