#!/usr/bin/make -f
# debian/rules file for the Debian/GNU Linux r-cran and r-mlbench packages
# Copyright 1998 by Douglas M. Bates <bates@stat.wisc.edu>

package=r-cran
r-cran=class ctest e1071 jpn nnet oz polynom quadprog rational spatial splines

build: build-stamp
build-stamp:
	dh_testdir
# Nothing to do here
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

# Build architecture-independent files here.
binary-indep: build
# Nothing to do here

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir -a
	dh_testroot -a
	dh_clean -a -k
	dh_installdirs -a
        # Add here commands to install the files into debian/tmp
	for i in $(r-cran); do \
	  (cd debian/tmp; tar zxf ../../$${i}*.tar.gz; \
	   R INSTALL $$i ./usr/lib/R/library; rm -rf $$i); \
	done
	rm -f debian/tmp/usr/lib/R/library/LibIndex
	rm -f debian/tmp/usr/lib/R/library/index.html
	dh_installdocs -a
	dh_installchangelogs -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_suidregister -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
#	dh_makeshlibs -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary


