#!/usr/bin/make -f
# 							-*- makefile -*-
# debian/rules file for the Debian/GNU Linux r-cran-epi package
# Copyright 2008 by Andreas Tille <tille@debian.org>

include /usr/share/R/debian/r-cran.mk

DEB_COMPRESS_EXCLUDE_ALL := .pdf

install/$(package)::
	# Require a number equal or superior than the R version the package was built with.
	echo "R:Depends=r-base-core (>= $(shell R --version | head -n1 | perl -ne 'print / +([0-9]\.[0-9]+\.[0-9])/')~)" >> debian/r-$(debRreposname)-$(cranName).substvars
	#
	mv debian/$(package)/usr/lib/R/site-library/Epi/doc/* debian/$(package)/usr/share/doc/$(package)
	rmdir debian/$(package)/usr/lib/R/site-library/Epi/doc
	# install examples and unset executable flag (which is the reason why no debian/examples
	# is used which is executed past install/$(package) target
	cp -a Examples/* debian/$(package)/usr/share/doc/$(package)/examples
	chmod 644 debian/$(package)/usr/share/doc/$(package)/examples/*.R
