The R Project SVN R

Rev

Rev 26524 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26524 Rev 27169
1
#!/usr/bin/make -f
1
#!/usr/bin/make -f
2
# debian/rules file for the Debian GNU/Linux r-base package
2
# debian/rules file for the Debian GNU/Linux r-base package
3
# Copyright 1997-2003 by Douglas Bates <bates@stat.wisc.edu> 
3
# Copyright 1997-2003 by Douglas Bates <bates@stat.wisc.edu> 
4
#                    and Dirk Eddelbuettel <edd@debian.org>
4
#                    and Dirk Eddelbuettel <edd@debian.org>
5
 
5
 
6
# $Id: rules,v 1.54 2003/10/05 20:32:03 bates Exp $
6
# $Id: rules,v 1.55 2003/11/20 16:13:01 bates Exp $
7
 
7
 
8
corepackage	= r-base-core
8
corepackage	= r-base-core
9
latexpackage	= r-base-latex
9
latexpackage	= r-base-latex
10
pdfpackage	= r-doc-pdf
10
pdfpackage	= r-doc-pdf
11
htmlpackage	= r-doc-html
11
htmlpackage	= r-doc-html
12
gnomepackage	= r-gnome
12
gnomepackage	= r-gnome
13
nmathpackage	= r-mathlib
13
nmathpackage	= r-mathlib
14
infopackage	= r-doc-info
14
infopackage	= r-doc-info
15
recdpackage	= r-recommended
15
recdpackage	= r-recommended
16
 
16
 
17
# for the standalone library, no sonames are assigned in the upstream Makefiles
17
# for the standalone library, no sonames are assigned in the upstream Makefiles
18
somaj		= 1
18
somaj		= 1
19
somin		= 0
19
somin		= 0
20
sorel		= 0
20
sorel		= 0
21
libver		= $(somaj).$(somin).$(sorel)
21
libver		= $(somaj).$(somin).$(sorel)
22
 
22
 
23
debbase		:= $(CURDIR)/debian
23
debbase		:= $(CURDIR)/debian
24
debtmp		:= $(debbase)/tmp
24
debtmp		:= $(debbase)/tmp
25
debdoc		:= $(debbase)/$(corepackage)/usr/share/doc/$(corepackage)
25
debdoc		:= $(debbase)/$(corepackage)/usr/share/doc/$(corepackage)
26
debmat		:= $(debbase)/$(nmathpackage)
26
debmat		:= $(debbase)/$(nmathpackage)
27
debetc		:= $(debbase)/$(corepackage)/usr/lib/R/etc
27
debetc		:= $(debbase)/$(corepackage)/usr/lib/R/etc
28
 
28
 
29
arch		:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
29
arch		:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
30
 
30
 
31
## set this to 1 if you want the skip the pdf creation and tests
-
 
32
#skipparts	= 1
-
 
33
 
-
 
34
# set this to 1 (default) if you want the Gnome GUI package
31
# set this to 1 (default) if you want the Gnome GUI package
35
gnome		= 1
32
gnome		= 1
36
ifeq ($(gnome),0)
33
ifeq ($(gnome),0)
37
gnomeconfig 	= --without-gnome
34
gnomeconfig 	= --without-gnome
38
else
35
else
39
gnomeconfig	= --with-gnome
36
gnomeconfig	= --with-gnome
40
endif
37
endif
41
 
38
 
42
#export DH_VERBOSE = 1
39
#export DH_VERBOSE = 1
43
export DH_COMPAT  = 3
40
export DH_COMPAT  = 3
44
 
41
 
45
# edd 15 Aug 2001  default to blas, atlas can override it 
42
# edd 15 Aug 2001  default to blas, atlas can override it 
46
#atlas 		= --with-blas=blas
43
#atlas 		= --with-blas=blas
47
# dmb 04 Apr 2003  better to use no specify blas
44
# dmb 04 Apr 2003  better to use no specify blas
48
# atlas 		= --with-blas
45
# atlas 		= --with-blas
49
# edd 28 Apr 2003  try configuring with atlas
46
# edd 28 Apr 2003  try configuring with atlas
50
atlas		= --with-blas=atlas
47
# atlas		= --with-blas=atlas
-
 
48
# edd 16 Oct 2003  back to older default
-
 
49
atlas 		= --with-blas=blas
51
# edd 08 Mar 2003  use the new lapack feature
50
# edd 08 Mar 2003  use the new lapack feature
52
# edd 27 Apr 2003  Set this to =no as we currently see numerical errors
51
# edd 27 Apr 2003  Set this to =no as we currently see numerical errors
53
lapack		= --with-lapack=no
52
lapack		= --with-lapack=no
54
 
53
 
55
# edd 02 Sep 2001  default to g77 but let m68k use f2c
54
# edd 02 Sep 2001  default to g77 but let m68k use f2c
56
# edd 06 Mar 2003  enforce 3.2 versions explicitly 
55
# edd 06 Mar 2003  enforce 3.2 versions explicitly 
57
#                  so that on testing we will pick them over 2.95
56
#                  so that on testing we will pick them over 2.95
58
# edd 07 Jun 2003  let's fall back to the default compilers
57
# edd 07 Jun 2003  let's fall back to the default compilers
59
fortrancompiler	= F77=g77
58
fortrancompiler	= F77=g77
60
compiler	= gcc
59
compiler	= gcc
61
cxxcompiler	= g++
60
cxxcompiler	= g++
62
compilerflags	= -O2
61
compilerflags	= -O2
63
 
62
 
64
# edd 04 Sep 2001  default compiler flags, lowered for m68k
63
# edd 04 Sep 2001  default compiler flags, lowered for m68k
65
compilerflags	= -O2
64
compilerflags	= -O2
66
# m68k barks when using g77, and when gcc use -O2
65
# m68k barks when using g77, and when gcc use -O2
67
# edd 26 Nov 2002  switched back to g77
66
# edd 26 Nov 2002  switched back to g77
68
# edd 02 Jun 2003  switched back
67
# edd 02 Jun 2003  switched back
69
# cts 04 Jun 2003  use -O1 on m68k
68
# cts 04 Jun 2003  use -O1 on m68k
70
ifeq ($(arch),m68k-linux)
69
ifeq ($(arch),m68k-linux)
71
fortrancompiler	= F2C=f2c
70
fortrancompiler	= F2C=f2c
72
compilerflags	= -O1
71
compilerflags	= -O1
73
endif
72
endif
74
 
73
 
75
## edd 09 Nov 2001  ia64 needs gcc-3.0, hppa gets it by default
74
## edd 09 Nov 2001  ia64 needs gcc-3.0, hppa gets it by default
76
#ifeq ($(arch),ia64-linux)
75
#ifeq ($(arch),ia64-linux)
77
#fortrancompiler = F77=g77-3.0
76
#fortrancompiler = F77=g77-3.0
78
#compiler	= gcc-3.0
77
#compiler	= gcc-3.0
79
#cxxcompiler	= g++-3.0
78
#cxxcompiler	= g++-3.0
80
#compilerflags	= -O2
79
#compilerflags	= -O2
81
#endif
80
#endif
82
 
81
 
83
## lamont@debian.org 06 Dec 2001  hppa needs -ffunction-sections  
82
## lamont@debian.org 06 Dec 2001  hppa needs -ffunction-sections  
84
ifeq ($(arch),hppa-linux)
83
ifeq ($(arch),hppa-linux)
85
compilerflags   = -O2 -ffunction-sections
84
compilerflags   = -O2 -ffunction-sections
86
endif
85
endif
87
 
86
 
88
## edd 20 Jun 2002      no optimisation or debugging on baby systems
87
## edd 20 Jun 2002      no optimisation or debugging on baby systems
89
## edd 02 Jun 2003	use this on arm only 
88
## edd 02 Jun 2003	use this on arm only 
90
##ifneq "$(findstring $(arch), m68k-linux arm-linux)" ""
89
##ifneq "$(findstring $(arch), m68k-linux arm-linux)" ""
91
ifneq "$(findstring $(arch), arm-linux)" ""
90
ifneq "$(findstring $(arch), arm-linux)" ""
92
compilerflags	= -O0 -g0
91
compilerflags	= -O0 -g0
93
endif
92
endif
94
 
93
 
95
get-orig-source: upstream
94
get-orig-source: upstream
96
upstream:
95
upstream:
97
	links http://cran.us.r-project.org/src/base
96
	links http://cran.us.r-project.org/src/base
98
 
97
 
99
upstreamdevel:
98
upstreamdevel:
100
        #links ftp://ftp.stat.math.ethz.ch/Software/R
99
	links ftp://ftp.stat.math.ethz.ch/Software/R
101
        #links http://cran.us.r-project.org/src/base
100
        #links http://cran.us.r-project.org/src/base
102
	rsync -vaC rsync.r-project.org::r-devel .
101
        #rsync -vaC rsync.r-project.org::r-devel .
-
 
102
 
-
 
103
## edd 24 Oct 2003  build is invoked by the buildd, so we would prefer to
-
 
104
##  		    not imply build-indep; unfortunately R does not build
-
 
105
##		    properly without it, so we have to stick with it
-
 
106
#build: build-arch build-indep
-
 
107
build: build-arch
103
 
108
 
104
build: build-arch build-indep
109
build-arch: make-arch 
105
 
110
 
106
build-arch: configure make-arch-stamp build-arch-stamp
-
 
107
build-arch-stamp:
-
 
108
	@echo "*** build-arch ***"
-
 
109
	touch build-arch-stamp
-
 
110
 
-
 
111
build-indep: configure make-indep-stamp build-indep-stamp
-
 
112
build-indep-stamp:
111
build-indep: make-indep 
113
	@echo "*** build-indep ***"
-
 
114
	touch build-indep-stamp
-
 
115
 
112
 
116
configure: configure-stamp
113
configure: configure-stamp
117
configure-stamp:	
114
configure-stamp:	
118
	@echo "*** configure ***"
115
	@echo "*** configure ***"
-
 
116
 
-
 
117
        # we have to disable use of the expanded R_LD_LIBRARY_PATH as it
-
 
118
        # conflicts with Debian's Atlas-can-replace-Blas scheme
-
 
119
        # so set R_LD_LIBRARY_PATH to the minimal value R_HOME/bin
-
 
120
        # and discard what configure finds for it on this machine
-
 
121
	perl -p -i -e 's|:\@R_LD_LIBRARY_PATH\@||' src/scripts/R.sh.in
-
 
122
 
119
	dh_testdir
123
	dh_testdir
120
	PERL=/usr/bin/perl				\
124
	PERL=/usr/bin/perl				\
121
	R_UNZIPCMD=/usr/bin/miniunzip			\
125
	R_UNZIPCMD=/usr/bin/miniunzip			\
122
	R_ZIPCMD=/usr/bin/minizip			\
126
	R_ZIPCMD=/usr/bin/minizip			\
-
 
127
	R_PRINTCMD=/usr/bin/lpr				\
123
	CC=${compiler}					\
128
	CC=${compiler}					\
124
	CXX=${cxxcompiler}				\
129
	CXX=${cxxcompiler}				\
125
	${fortrancompiler}				\
130
	${fortrancompiler}				\
126
	CPPFLAGS=					\
131
	CPPFLAGS=					\
127
	LDFLAGS=					\
132
	LDFLAGS=					\
128
	FLIBS=						\
133
	FLIBS=						\
129
	./configure --prefix=/usr			\
134
	./configure --prefix=/usr			\
130
		    --with-tcltk			\
135
		    --with-tcltk			\
131
		    --mandir=/usr/share/man		\
136
		    --mandir=/usr/share/man		\
132
		    --infodir=/usr/share/info		\
137
		    --infodir=/usr/share/info		\
133
		    $(atlas) $(lapack)			\
138
		    $(atlas) 				\
-
 
139
		    $(lapack)				\
134
		    $(gnomeconfig)			\
140
		    $(gnomeconfig)			\
135
		    --enable-R-profiling		\
141
		    --enable-R-profiling		\
136
		    --enable-R-shlib			\
142
		    --enable-R-shlib			\
137
		    --with-recommended-packages		\
143
		    --with-recommended-packages		\
138
		    --build $(arch)
144
		    --build $(arch)
139
 
145
 
140
#		    --with-tcl-config=/usr/lib/tcl8.3/tclConfig.sh	
146
#		    --with-tcl-config=/usr/lib/tcl8.3/tclConfig.sh	
141
#		    --with-tk-config=/usr/lib/tk8.3/tkConfig.sh		
147
#		    --with-tk-config=/usr/lib/tk8.3/tkConfig.sh		
142
 
148
 
143
	touch configure-stamp
149
	touch configure-stamp
144
 
150
 
145
make-arch: configure make-arch-stamp 
151
make-arch: configure make-arch-stamp 
146
make-arch-stamp: 
152
make-arch-stamp: 
147
	@echo "*** make-arch ***"
153
	@echo "*** make-arch ***"
148
	make		CFLAGS="$(compilerflags)"		\
154
	make		CFLAGS="$(compilerflags)"		\
149
			CXXFLAGS="$(compilerflags)"		\
155
			CXXFLAGS="$(compilerflags)"		\
150
			FFLAGS="$(compilerflags)"		\
156
			FFLAGS="$(compilerflags)"		\
151
			CC=${compiler} 				\
157
			CC=${compiler} 				\
152
			CXX=${cxxcompiler}			\
158
			CXX=${cxxcompiler}			\
153
			${fortrancompiler}			\
159
			${fortrancompiler}			\
154
			R
160
			R
-
 
161
 
-
 
162
        # the top-level 'make stamp-recommended' target implies 'make docs'
-
 
163
        # which (for the buildds) implies a lot of time wasted generating 
-
 
164
        # output we already take from the initial i386 build
155
	make		CFLAGS="$(compilerflags)"		\
165
	make		CFLAGS="$(compilerflags)"		\
156
			CXXFLAGS="$(compilerflags)"		\
166
			CXXFLAGS="$(compilerflags)"		\
157
			FFLAGS="$(compilerflags)"		\
167
			FFLAGS="$(compilerflags)"		\
158
			CC=${compiler} 				\
168
			CC=${compiler} 				\
159
			CXX=${cxxcompiler}			\
169
			CXX=${cxxcompiler}			\
160
			${fortrancompiler}			\
170
			${fortrancompiler}			\
161
			stamp-recommended
171
			stamp-recommended
162
        # currently needed for binary package with docs [FIXME: how?]
-
 
163
	make docs
-
 
164
 
172
 
165
        # make standalone math lib
173
        # make standalone math lib
166
	(cd src/nmath/standalone; 				\
174
	(cd src/nmath/standalone; 				\
167
		make	CFLAGS="$(compilerflags) -D_REENTRANT"	\
175
		make	CFLAGS="$(compilerflags) -D_REENTRANT"	\
168
			CXXFLAGS="$(compilerflags) -D_REENTRANT"\
176
			CXXFLAGS="$(compilerflags) -D_REENTRANT"\
169
			FFLAGS="$(compilerflags) -D_REENTRANT"	\
177
			FFLAGS="$(compilerflags) -D_REENTRANT"	\
170
			CC=${compiler} 				\
178
			CC=${compiler} 				\
171
			CXX=${cxxcompiler} 			\
179
			CXX=${cxxcompiler} 			\
172
			${fortrancompiler}			\
180
			${fortrancompiler}			\
173
			libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \
181
			libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \
174
			)
182
			)
175
        # FIXME
-
 
176
	make html
-
 
177
        # currently needed for binary package [FIXME: into r-doc-help]
-
 
178
	make help
183
 
179
	touch make-arch-stamp
184
	touch make-arch-stamp
180
 
185
 
181
make-indep: configure make-indep-stamp
186
make-indep: configure make-indep-stamp
182
make-indep-stamp:
187
make-indep-stamp:
183
	@echo "*** make-indep ***"
188
	@echo "*** make-indep ***"
184
        # FIXME would be nice here:   make docs
189
#	make docs
-
 
190
	make html
185
        #                             make help
191
	make help
186
        # currently needed for binary package [FIXME: into r-doc-info]
-
 
187
	make info
192
	make info
188
	make pdf
193
	make pdf
189
	touch make-indep-stamp
194
	touch make-indep-stamp
190
 
195
 
191
make: configure make-arch-stamp make-indep-stamp make-stamp
196
make: make-arch make-indep 
192
make-stamp: 
-
 
193
        # Already made in general 'make': make html
-
 
194
	touch make-stamp
-
 
195
 
197
 
196
check: configure make-arch check-stamp
198
check: make-arch check-stamp
197
check-stamp: 
199
check-stamp: 
198
	@echo "*** check ***"
200
	@echo "*** check ***"
199
ifneq	($(arch),arm-linux)
201
ifneq	($(arch),arm-linux)
200
	-make check
202
	-make check
201
endif
203
endif
202
	touch check-stamp
204
	touch check-stamp
203
 
205
 
204
clean:
206
clean:
205
	@echo "*** clean ***"
207
	@echo "*** clean ***"
206
	dh_testdir
208
	dh_testdir
207
	dh_testroot
209
	dh_testroot
208
	rm -f 	configure-stamp \
210
	rm -f 	configure-stamp \
209
		build-stamp build-indep-stamp build-arch-stamp \
211
		build-stamp build-indep-stamp build-arch-stamp \
210
		make-stamp make-arch-stamp make-indep-stamp \
212
		make-stamp make-arch-stamp make-indep-stamp \
211
		install-indep-stamp install-arch-stamp \
213
		install-indep-stamp install-arch-stamp \
212
		check-stamp 
214
		check-stamp 
213
	-make distclean
215
	-make distclean
214
	-rm -f `find . -name "*~"`
216
	-rm -f `find . -name "*~"`
215
	-rm -rf debian/tmp debian/files* core debian/substvars
217
	-rm -rf debian/tmp debian/files* core debian/substvars
216
	-rm -f doc/html/function.html doc/html/packages.html
218
	-rm -f doc/html/function.html doc/html/packages.html
217
	-rm -f modules/*.so
219
	-rm -f modules/*.so
218
        # left over in CVS from r-base --> r-base-core transition
220
        # left over in CVS from r-base --> r-base-core transition
219
	(cd debian; rm -vf r-base.dirs r-base.files r-base.lintian \
221
	(cd debian; rm -vf r-base.dirs r-base.files r-base.lintian \
220
			r-base.menu r-base.postinst)	
222
			r-base.menu r-base.postinst)	
221
	dh_clean
223
	dh_clean
222
 
224
 
223
install: install-arch install-indep 
225
install: install-arch install-indep 
224
 
226
 
225
install-arch: make-arch check install-arch-stamp
227
install-arch: make-arch check install-arch-stamp
226
install-arch-stamp: 
228
install-arch-stamp: 
227
	@echo "*** install-arch ***"
229
	@echo "*** install-arch ***"
228
	dh_testdir
230
	dh_testdir
229
	dh_testroot
231
	dh_testroot
230
	dh_clean -a -k
232
	dh_clean -a -k
231
	dh_installdirs -A
233
	dh_installdirs -A
232
 
234
 
233
	make    	prefix=$(debtmp)/usr   	 		\
235
	make    	prefix=$(debtmp)/usr   	 		\
234
			mandir=$(debtmp)/usr/share/man	 	install
236
			mandir=$(debtmp)/usr/share/man	 	install
235
 
237
 
236
        # Now for a set of fixes / corrections for the Debian installation 
238
        # link $R_HOME/bin/R to real one, and set R_HOME_DIR env.var. 
237
 
-
 
238
        # set R_HOME_DIR env.var. in R shell script
239
	(cd $(debtmp)/usr/lib/R/bin/; 					\
239
	sed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \
240
		ln -svf ../../../bin/R R;				\
240
	  < bin/R > $(debtmp)/usr/bin/R
241
		cd ../../../bin;					\
-
 
242
		perl -p -i -e						\
241
	sed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \
243
		    's|^R_HOME_DIR=.*|R_HOME_DIR=/usr/lib/R|' R)
242
	  < bin/R > $(debtmp)/usr/lib/R/bin/R
-
 
243
 
244
 
244
        # set browser to mozilla as mozilla-1.0.0 works with help.start()
245
        # set browser to mozilla as mozilla-1.0.0 works with help.start()
-
 
246
	(cd $(debtmp)/usr/lib/R/etc; \
-
 
247
		perl -p -i -e \
245
	sed -e '/^R_BROWSER=.*/s::R_BROWSER=$${R_BROWSER-/usr/bin/mozilla}:' \
248
			"s|R_BROWSER-'.*'|R_BROWSER-'/usr/bin/mozilla'|" \
246
	  < etc/Renviron > $(debtmp)/usr/lib/R/etc/Renviron
249
			Renviron)
247
 
250
 
248
        # fix permissions (Lintian)
251
        # fix permissions (Lintian)
249
	chmod a+x 	$(debtmp)/usr/lib/R/share/sh/echo.sh 		\
252
	chmod a+x 	$(debtmp)/usr/lib/R/share/sh/echo.sh 		\
250
			$(debtmp)/usr/lib/R/share/sh/help-links.sh	\
253
			$(debtmp)/usr/lib/R/share/sh/help-links.sh	\
251
			$(debtmp)/usr/lib/R/share/sh/help-print.sh
254
			$(debtmp)/usr/lib/R/share/sh/help-print.sh
252
 
255
 
253
        # remove unneeded license files, but link them back
256
        # remove unneeded license files, but link them back
254
	rm -v 	$(debtmp)/usr/lib/R/COPYING 		\
257
	rm -v 	$(debtmp)/usr/lib/R/COPYING 		\
255
		$(debtmp)/usr/lib/R/COPYING.LIB 
258
		$(debtmp)/usr/lib/R/COPYING.LIB 
256
	(cd $(debtmp)/usr/lib/R/; \
259
	(cd $(debtmp)/usr/lib/R/; \
257
		ln -s ../../share/common-licenses/GPL COPYING; \
260
		ln -s ../../share/common-licenses/GPL COPYING; \
258
		ln -s ../../share/common-licenses/LGPL COPYING.LIB)
261
		ln -s ../../share/common-licenses/LGPL COPYING.LIB)
259
 
262
 
260
        # edd 15 Jul 2002 reduce compile load on small machines
263
        # edd 15 Jul 2002 reduce compile load on small machines
261
ifneq "$(findstring $(arch), m68k-linux arm-linux)" ""
264
ifneq "$(findstring $(arch), m68k-linux arm-linux)" ""
262
	perl -p -i -e 's/-g -O2/-g0 -O0/g' $(debtmp)/usr/lib/R/etc/Makeconf
265
	perl -p -i -e 's/-g -O2/-g0 -O0/g' $(debtmp)/usr/lib/R/etc/Makeconf
263
endif
266
endif
264
 
267
 
265
        # edd 10 Jan 2003 fix Perl interpreter path
268
        # edd 10 Jan 2003 fix Perl interpreter path
266
	(cd $(debtmp)/usr/lib/R/bin; 					\
269
	(cd $(debtmp)/usr/lib/R/bin; 					\
267
	    for file in Rdconv Rdindex Rprof Sd2Rd build check; do 	\
270
	    for file in Rdconv Rdindex Rprof Sd2Rd build check; do 	\
268
		perl -p -i -e "s|/usr/local/bin/perl|/usr/bin/perl|" 	\
271
		perl -p -i -e "s|/usr/local/bin/perl|/usr/bin/perl|" 	\
269
		   $${file};						\
272
		   $${file};						\
270
	done)
273
	done)
271
 
274
 
272
        # that being done, now install in different sub-packages
275
        # that being done, now install in different sub-packages
273
 
276
 
274
        # move the GNOME version to the r-gnome package
277
        # move the GNOME version to the r-gnome package
275
ifneq ($(gnome),0)
278
ifneq ($(gnome),0)
276
	dh_movefiles	-p$(gnomepackage) 	usr/lib/R/modules/R_gnome.so
279
	dh_movefiles	-p$(gnomepackage) 	usr/lib/R/modules/R_gnome.so
277
endif
280
endif
278
 
281
 
279
        # move files for r-recommended
282
        # move files for r-recommended
280
        # doing this before html/latex moves ensure they keep their tex/latex
283
        # doing this before html/latex moves ensure they keep their tex/latex
281
	dh_movefiles	-p$(recdpackage)
284
	dh_movefiles	-p$(recdpackage)
282
        # move the html manual files in r-doc-html.files into r-doc-html 
285
        # move the html manual files in r-doc-html.files into r-doc-html 
283
        # these get built in make-arch too ...
286
        # these get built in make-arch too ...
284
	dh_movefiles	-p$(htmlpackage)		
287
	dh_movefiles	-p$(htmlpackage)		
285
        # move files for r-base-html
288
        # move files for r-base-html
286
	dh_movefiles	-pr-base-html
289
	dh_movefiles	-pr-base-html
287
        # move files for r-base-latex
290
        # move files for r-base-latex
288
	dh_movefiles	-pr-base-latex
291
	dh_movefiles	-pr-base-latex
289
        # move all the rest into r-base-core
292
        # move all the rest into r-base-core
290
	dh_movefiles	-p$(corepackage)
293
	dh_movefiles	-p$(corepackage)
291
 
294
 
292
        # for the standalone library package, move the two libs
295
        # for the standalone library package, move the two libs
293
        # as 'make install' ignore these, we have to do it by hand
296
        # as 'make install' ignores these, we have to do it by hand
294
	dh_installdirs -p$(nmathpackage) usr/include usr/lib
297
	dh_installdirs -p$(nmathpackage) usr/include usr/lib
295
	install -m 0644 src/nmath/standalone/libRmath.a     \
298
	install -m 0644 src/nmath/standalone/libRmath.a     \
296
			$(debmat)/usr/lib
299
			$(debmat)/usr/lib
297
	install -m 0644 src/nmath/standalone/libRmath.so    \
300
	install -m 0644 src/nmath/standalone/libRmath.so    \
298
			$(debmat)//usr/lib/libRmath.so.$(libver)
301
			$(debmat)//usr/lib/libRmath.so.$(libver)
299
	(cd $(debmat)/usr/lib; \
302
	(cd $(debmat)/usr/lib; \
300
			ln -s libRmath.so.$(libver) libRmath.so.$(somaj); \
303
			ln -s libRmath.so.$(libver) libRmath.so.$(somaj); \
301
			ln -s libRmath.so.$(somaj)  libRmath.so)
304
			ln -s libRmath.so.$(somaj)  libRmath.so)
302
        # and create a link for Rmath.h 
305
        # and create a link for Rmath.h 
303
	(cd $(debmat)/usr/include; \
306
	(cd $(debmat)/usr/include; \
304
			ln -s ../lib/R/include/Rmath.h .)
307
			ln -s ../lib/R/include/Rmath.h .)
305
 
308
 
306
        # now deal with $R_HOME/etc <--> /etc/R
309
        # now deal with $R_HOME/etc <--> /etc/R
307
	# edd 03 Apr 2003  patch Renviron for new R_LIBS standard
310
        # edd 03 Apr 2003  patch Renviron for new R_LIBS standard
308
	(cd $(debetc); \
311
	(cd $(debetc); \
309
		cat $(debbase)/Renviron-R_LIBS.patch | patch --verbose;	\
312
		cat $(debbase)/Renviron-R_LIBS.patch | patch --verbose;	\
310
		mv Makeconf Renviron	../../../../etc/R/; 		\
313
		mv Makeconf Renviron	../../../../etc/R/; 		\
311
		ln -s  /etc/R/Makeconf  .; 				\
314
		ln -s  /etc/R/Makeconf  .; 				\
312
		ln -s  /etc/R/Renviron  .  				)
315
		ln -s  /etc/R/Renviron  .  				)
313
        #
316
 
314
	touch install-arch-stamp
317
	touch install-arch-stamp
315
 
318
 
316
#install-indep: make-arch make-indep install-arch install-indep-stamp
319
#install-indep: make-arch make-indep install-arch install-indep-stamp
317
install-indep: make-indep install-indep-stamp
320
install-indep: make-indep install-indep-stamp
318
install-indep-stamp: 
321
install-indep-stamp: 
319
	@echo "*** install-indep ***"
322
	@echo "*** install-indep ***"
320
	dh_testdir
323
	dh_testdir
321
	dh_testroot
324
	dh_testroot
322
	dh_clean -a -k
325
	dh_clean -a -k
323
	dh_installdirs -A
326
	dh_installdirs -A
324
 
327
 
325
	make    	prefix=$(debtmp)/usr   	 		install-pdf
328
	make    	prefix=$(debtmp)/usr   	 		install-pdf
326
 
329
 
327
        # the indep package r-doc-info is made now 
330
        # the indep package r-doc-info is made now 
328
	make    	prefix=$(debtmp)/usr  \
331
	make    	prefix=$(debtmp)/usr  \
329
			infodir=$(debtmp)/usr/share/info	install-info
332
			infodir=$(debtmp)/usr/share/info	install-info
330
 
333
 
331
        # move the pdf manual files listed in r-doc-pdf.files into r-doc-pdf 
334
        # move the pdf manual files listed in r-doc-pdf.files into r-doc-pdf 
332
	dh_movefiles	-p$(pdfpackage)		
335
	dh_movefiles	-p$(pdfpackage)		
333
        # move the html manual files in r-doc-html.files into r-doc-html 
336
        # move the html manual files in r-doc-html.files into r-doc-html 
334
	dh_movefiles	-p$(htmlpackage)		
337
	dh_movefiles	-p$(htmlpackage)		
335
	touch install-indep-stamp
338
	touch install-indep-stamp
336
        # move files for r-doc-info
339
        # move files for r-doc-info
337
	dh_movefiles	-p$(infopackage)
340
	dh_movefiles	-p$(infopackage)
338
        # but clean up dir and old.dir	
341
        # but clean up dir and old.dir	
339
	rm -vf 		$(debbase)/$(infopackage)/usr/share/info/dir \
342
	rm -vf 		$(debbase)/$(infopackage)/usr/share/info/dir \
340
			$(debbase)/$(infopackage)/usr/share/info/dir.old
343
			$(debbase)/$(infopackage)/usr/share/info/dir.old
341
 
344
 
342
# Build architecture-independent files here.
345
# Build architecture-independent files here.
343
binary-indep: build-indep install-indep
346
binary-indep: build-indep install-indep
344
	@echo "*** binary-indep ***"
347
	@echo "*** binary-indep ***"
345
	dh_testdir -i
348
	dh_testdir -i
346
	dh_testroot -i
349
	dh_testroot -i
347
	dh_link -i
350
	dh_link -i
348
        #dh_installdebconf -i
351
        #dh_installdebconf -i
349
	dh_installdocs -i
352
	dh_installdocs -i
350
        #dh_installexamples -i
353
        #dh_installexamples -i
351
        #dh_installmenu -i
354
        #dh_installmenu -i
352
        #dh_installemacsen -i
355
        #dh_installemacsen -i
353
        #dh_installpam -i
356
        #dh_installpam -i
354
        #dh_installmime -i
357
        #dh_installmime -i
355
        #dh_installinit -i
358
        #dh_installinit -i
356
        #dh_installcron -i
359
        #dh_installcron -i
357
        #dh_installmanpages -i
360
        #dh_installmanpages -i
358
        #dh_installinfo -i
361
        #dh_installinfo -i
359
        #dh_undocumented -i
362
        #dh_undocumented -i
360
	dh_installchangelogs -i	
363
	dh_installchangelogs -i	
361
        # install lintian "silencer"
364
        # install lintian "silencer"
362
	install -p -m 0644  debian/$(latexpackage).lintian \
365
	install -p -m 0644  debian/$(latexpackage).lintian \
363
	 $(debbase)/$(latexpackage)/usr/share/lintian/overrides/$(latexpackage)
366
	 $(debbase)/$(latexpackage)/usr/share/lintian/overrides/$(latexpackage)
364
	dh_compress -i
367
	dh_compress -i
365
	dh_fixperms -i
368
	dh_fixperms -i
366
        #dh_suidregister -i
369
        #dh_suidregister -i
367
	dh_installdeb -i
370
	dh_installdeb -i
368
        #dh_perl -i
371
        #dh_perl -i
369
	dh_gencontrol -i
372
	dh_gencontrol -i
370
	dh_md5sums -i
373
	dh_md5sums -i
371
	dh_builddeb -i
374
	dh_builddeb -i
372
 
375
 
373
# Build architecture-dependent files here.
376
# Build architecture-dependent files here.
374
binary-arch: build-arch install-arch check
377
binary-arch: build-arch check install-arch 
375
	@echo "*** binary-arch ***"
378
	@echo "*** binary-arch ***"
376
	dh_testdir -a
379
	dh_testdir -a
377
	dh_testroot -a
380
	dh_testroot -a
378
        #dh_installdebconf -a
381
        #dh_installdebconf -a
379
	dh_link -a
382
	dh_link -a
380
	dh_installdocs -p$(corepackage) AUTHORS BUGS  NEWS ONEWS README \
383
	dh_installdocs -p$(corepackage) AUTHORS BUGS  NEWS ONEWS README \
381
					RESOURCES THANKS Y2K \
384
					RESOURCES THANKS Y2K \
382
					debian/README.Atlas \
385
					debian/README.Atlas \
383
					debian/README.mathlib
386
					debian/README.mathlib
384
	dh_installexamples -a
387
	dh_installexamples -a
385
	dh_installexamples -p$(corepackage)	src/nmath/standalone/test.c
388
	dh_installexamples -p$(corepackage)	src/nmath/standalone/test.c
386
	dh_installmenu -a
389
	dh_installmenu -a
387
        #dh_installemacsen -a
390
        #dh_installemacsen -a
388
        #dh_installpam -a
391
        #dh_installpam -a
389
        #dh_installmime -a
392
        #dh_installmime -a
390
        #dh_installinit -a
393
        #dh_installinit -a
391
        #dh_installcron -a
394
        #dh_installcron -a
392
        #dh_installmanpages -a	-N$(gnomepackage) -p$(corepackage) getline.3
395
        #dh_installmanpages -a	-N$(gnomepackage) -p$(corepackage) getline.3
393
        #dh_installman 		-p$(corepackage) doc/R.1
396
        #dh_installman 		-p$(corepackage) doc/R.1
394
	## dh_installinfo -a	-n doc/manual/R-*.info*
397
        ## dh_installinfo -a	-n doc/manual/R-*.info*
395
	## edd 04 Apr 2004 manual is dangling unless r-doc-pdf is installed ...
398
        ## edd 04 Apr 2004 manual is dangling unless r-doc-pdf is installed ...
396
	##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/html .)
399
        ##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/html .)
397
	##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/manual .)
400
        ##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/manual .)
398
	# ... so install doc as a link, as we already did with library
401
        # ... so install doc as a link, as we already did with library
399
	(cd $(debdoc) && ln -s ../../../lib/R/doc .)
402
	(cd $(debdoc) && ln -s ../../../lib/R/doc .)
400
	(cd $(debdoc) && ln -s ../../../lib/R/library .)
403
	(cd $(debdoc) && ln -s ../../../lib/R/library .)
401
        # install lintian "silencer"
404
        # install lintian "silencer"
402
	install -p -m 0644  debian/$(corepackage).lintian \
405
	install -p -m 0644  debian/$(corepackage).lintian \
403
	   $(debbase)/$(corepackage)/usr/share/lintian/overrides/$(corepackage)
406
	   $(debbase)/$(corepackage)/usr/share/lintian/overrides/$(corepackage)
404
	install -p -m 0644  debian/$(recdpackage).lintian \
407
	install -p -m 0644  debian/$(recdpackage).lintian \
405
	   $(debbase)/$(recdpackage)/usr/share/lintian/overrides/$(recdpackage)
408
	   $(debbase)/$(recdpackage)/usr/share/lintian/overrides/$(recdpackage)
406
        #dh_undocumented -a
409
        #dh_undocumented -a
407
	dh_installchangelogs -a	-k NEWS 
410
	dh_installchangelogs -a	-k NEWS 
408
	dh_strip -a
411
	dh_strip -a
409
	dh_compress -a
412
	dh_compress -a
410
	dh_fixperms -a
413
	dh_fixperms -a
411
        #dh_suidregister -a
414
        #dh_suidregister -a
412
	dh_makeshlibs -a
415
	dh_makeshlibs -a
413
	dh_installdeb -a
416
	dh_installdeb -a
414
	dh_perl -a
417
	dh_perl -a
415
	dh_shlibdeps -a
418
	dh_shlibdeps -a
416
	@echo "*** Pruning shlibdeps result from double atlas entry ***"
419
#	@echo "*** Pruning shlibdeps result from double atlas entry ***"
417
	cat debian/r-base-core.substvars
420
#	cat debian/r-base-core.substvars
418
	perl -p -i -e 's/atlas2-base, //' debian/r-base-core.substvars
421
#	perl -p -i -e 's/atlas2-base, //' debian/r-base-core.substvars
419
	cat debian/r-base-core.substvars
422
#	cat debian/r-base-core.substvars
420
	@echo "*** Pruning atlas from r-recommended shlibdeps ***"
423
#	@echo "*** Pruning atlas from r-recommended shlibdeps ***"
421
	cat debian/r-recommended.substvars
424
#	cat debian/r-recommended.substvars
422
	perl -p -i -e 's/atlas2-base, //' debian/r-recommended.substvars
425
#	perl -p -i -e 's/atlas2-base, //' debian/r-recommended.substvars
423
	cat debian/r-recommended.substvars
426
#	cat debian/r-recommended.substvars
424
	echo "*** Done ***"
427
#	echo "*** Done ***"
425
	dh_gencontrol -a
428
	dh_gencontrol -a
426
	dh_md5sums -a		-X'usr/bin/R'  -XLibIndex -Xindex.txt \
429
	dh_md5sums -a		-X'usr/bin/R'  -XLibIndex -Xindex.txt \
427
					-Xfunction.html -Xpackages.html
430
					-Xfunction.html -Xpackages.html
428
	dh_builddeb -a
431
	dh_builddeb -a
429
 
432
 
430
binary: binary-arch binary-indep 
433
binary: binary-arch binary-indep 
431
.PHONY: build clean binary-indep binary-arch binary install install-arch install-indep
434
.PHONY: build clean binary-indep binary-arch binary install install-arch install-indep