File: rules

package info (click to toggle)
vr 7.2.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,228 kB
  • ctags: 182
  • sloc: ansic: 2,393; makefile: 28; sh: 28
file content (49 lines) | stat: -rwxr-xr-x 2,118 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/make -f
# 							-*- makefile -*-
# debian/rules file for the Debian/GNU Linux r-cran-vr package
# Copyright 2004 by Dirk Eddelbuettel <edd@debian.org>

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/langcore.mk

## We need the CRAN (upstream) name -- special case for Bundle
##cranName	:= $(shell grep Package: DESCRIPTION | cut -f2 -d" ")
cranName	:= $(shell grep Bundle: DESCRIPTION | cut -f2 -d" ")
## and we need to build a Debian Policy-conformant lower-case package name
cranNameLC	:= $(shell echo $(cranName) | tr "[A-Z]" "[a-z]" | tr "." "-" )
## which we can use to build the package directory 
package		:= r-cran-$(cranNameLC)
## which we use for the to-be-installed-in directory
## nb: recommended packages go in $R_HOME/library, not site-library
#debRlib	:= $(CURDIR)/debian/$(package)/usr/lib/R/site-library
debRlib	:= $(CURDIR)/debian/$(package)/usr/lib/R/library

arch 		:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)

common-install-indep:: R_any_arch
common-install-arch:: R_any_arch

R_any_arch:
                ##dh_installdirs		usr/lib/R/site-library
		dh_installdirs		usr/lib/R/library
                ##R CMD INSTALL -l $(debRlib) --clean .
## edd 14 Nov 2004      do run R CMD check on these only
##                      if arch in argument list, result is "..." and != ""
##                      else we get that arch string and skip the test
ifeq "$(findstring $(arch), alpha-linux s390-linux mipsel-linux mips-linux m68k-linux arm-linux)" ""
	        mkdir debian/$(cranName)
	        find . -not -path "./debian*" | cpio -p -m debian/$(cranName)
	        (cd debian 						&& \
			R CMD check --no-latex $(cranName)		&& \
			R CMD INSTALL -l $(debRlib) $(cranName) 	&& \
			rm -rf $(cranName) 				)
else 
		R CMD INSTALL -l $(debRlib) --clean .
endif
		rm -vf $(debRlib)/R.css $(debRlib)/$(cranNameLC)/COPYING
		rm -vf $(debRlib)/MASS/LICENCE		\
		       $(debRlib)/class/LICENCE		\
		       $(debRlib)/nnet/LICENCE		\
		       $(debRlib)/spatial/LICENCE	
		chmod -v 0644 $(debRlib)/MASS/scripts/*.R
		chmod -v 0644 $(debRlib)/MASS/scripts/README