#!/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)

build/$(CABAL_PACKAGE) :: build-ghc-stamp

install/$(CABAL_PACKAGE) :: build/$(CABAL_PACKAGE)
	$(DEB_SETUP_BIN_NAME) copy --builddir=dist-ghc --destdir=debian/$(CABAL_PACKAGE)
	mkdir -p debian/$(CABAL_PACKAGE)/usr/share/emacs/site-lisp
	mv debian/$(CABAL_PACKAGE)/usr/share/hlint-1.8.8/hs-lint.el debian/$(CABAL_PACKAGE)/usr/share/emacs/site-lisp
	rm -rf debian/$(CABAL_PACKAGE)/usr/share/doc
	install -Dm 644 hlint.htm debian/$(CABAL_PACKAGE)/usr/share/doc/$(CABAL_PACKAGE)/hlint.html

