~ubuntu-branches/debian/lenny/octave3.0/lenny

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2007-12-23 16:04:15 UTC
  • Revision ID: james.westby@ubuntu.com-20071223160415-jfriqav7corvoi9d
Tags: 3.0.0-1
The "Seasons Greetings" release

* New upstream release.  A big thanks to John W. Eaton and all the
  Octave development team for this most awaited release.

* debian/in/control, debian/rules: Replaced most of the references to
  octave2.9 by octave3.0.  Made all octave3.0* packages
  provide/replace/conflict with the respective octave2.9* packages.
* debian/patches/02_prelease_warning.dpatch: Dropped patch, since this
  is the real 3.0 release
* debian/in/control: Dropped the build-conflict with atlas3-base-dev.
  This will make the autobuilders happy.
* debian/in/control: Dropped the empty octave package.  This will allow
  releasing octave3.0 without an epoch in its version number.  We will
  reintroduce this package later, if necessary (anyway, octave3.0
  provides octave).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
#                                                       -*- makefile -*-
 
3
# debian/rules file for the Debian/GNU Linux octave package
 
4
# Copyright 1997-99,2000-03 by Dirk Eddelbuettel <edd@debian.org>
 
5
#
 
6
# $Id: rules 1128 2007-12-21 14:53:46Z rafael $
 
7
 
 
8
include /usr/share/dpatch/dpatch.make
 
9
 
 
10
# in order: octave, octave2.1, 2.1.28, 2.1  (or whatever the version is), 3.0
 
11
# the difference in major and PACKAGEVER: first one is taken from the octave
 
12
# version (ie 2.1.69), the second one from the binary package name in Debian
 
13
# (ie octave2.1); necessary for the 3.0 rc uploads.
 
14
source          := $(shell head -1 debian/changelog | \
 
15
                        perl -nle 'm/^([a-z]+)/ and print $$1')
 
16
PACKAGE         := $(shell head -1 debian/changelog | \
 
17
                        perl -nle 'm/^(\S+)\s+/ and print $$1')
 
18
version         := $(shell head -1 debian/changelog | \
 
19
                        perl -nle 'm/\S+\s+\((?:\d:)*(\S+)-\S+\)/ and print $$1')
 
20
major           := $(shell echo $(version) | perl -nle \
 
21
                        'm/(\d\.\d)\.\d+/ and print $$1')
 
22
PACKAGEVER      := $(shell echo $(PACKAGE) | \
 
23
                        perl -nle 'm/.*(\d.\d)/ and print $$1')
 
24
#FIXME: drop PACKAGEVER after the release of 3.0 source packages!
 
25
 
 
26
hack:
 
27
        @echo $(PACKAGEVER)
 
28
 
 
29
ifeq ($(major),3.0)
 
30
priority        := 90
 
31
else
 
32
ifeq ($(major),2.1)
 
33
priority        := 80
 
34
endif
 
35
endif
 
36
 
 
37
doc_package     = $(PACKAGE)-doc
 
38
html_package    = $(PACKAGE)-htmldoc
 
39
dev_package     = $(PACKAGE)-headers
 
40
emacs_package   = $(PACKAGE)-emacsen
 
41
info_package    = $(PACKAGE)-info
 
42
 
 
43
debbase         := $(CURDIR)/debian
 
44
debtmp          := $(debbase)/$(PACKAGE)
 
45
debshare        := $(debtmp)/usr/share
 
46
deblib          := $(debtmp)/usr/lib
 
47
debdoc          := $(debshare)/doc/$(PACKAGE)
 
48
debhtmldoc      := $(debtmp)-htmldoc/usr/share/doc/$(PACKAGE)-htmldoc
 
49
deblsp          := $(debbase)/$(emacs_package)/usr/share/emacs/site-lisp/$(emacs_package)
 
50
debini          := $(debshare)/octave/site/m/startup
 
51
debininew       := $(debshare)/octave/$(version)/m/startup
 
52
debapp          := $(debshare)/applications
 
53
 
 
54
savefiles       := configure config.h.in scripts/configure      \
 
55
                        doc/conf.texi examples/octave.desktop.in
 
56
texifiles       := doc/interpreter/octave.texi          \
 
57
                        doc/liboctave/liboctave.texi    \
 
58
                        doc/faq/Octave-FAQ.texi
 
59
 
 
60
## edd  3 Feb 2003  gcc 3.2, also imposed uniformly via Build-Depends
 
61
## edd 27 Jun 2003  now that gcc 3.3 is in unstable and testing, relax this
 
62
#c_compiler     = /usr/bin/gcc-3.3
 
63
#cxx_compiler   = /usr/bin/g++-3.3
 
64
#f77_compiler   = /usr/bin/g77-3.3
 
65
c_compiler      = /usr/bin/gcc
 
66
cxx_compiler    = /usr/bin/g++
 
67
f77_compiler    = /usr/bin/g77
 
68
fc_flag         = --with-f77=$(f77_compiler)
 
69
fc_libs         =
 
70
compilerflags   = -O2
 
71
# linkerflags   = -s
 
72
 
 
73
# default to blas, atlas can overload where available (see README.Atlas)
 
74
#atlas          = --with-blas=/usr/lib/libblas.so \
 
75
#                 --with-lapack=/usr/lib/liblapack.so
 
76
#atlas          = --with-blas=/usr/lib/libblas-3.so \
 
77
#                 --with-lapack=/usr/lib/liblapack-3.so
 
78
atlas           = --with-blas=-lblas-3 --with-lapack=-llapack-3
 
79
 
 
80
arch            := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
81
 
 
82
## edd 20 Jun 2002      no optimisation or debugging on baby systems
 
83
ifneq "$(findstring $(arch), arm-linux-gnu)" ""
 
84
compilerflags   = -O0 -g0
 
85
endif
 
86
 
 
87
# edd 25 Aug 2002  arm does not have atlas
 
88
ifeq ($(arch),arm-linux)
 
89
atlas           = --without-blas
 
90
endif
 
91
 
 
92
#export DH_VERBOSE=1
 
93
 
 
94
sliceterm = UNDEF+V_$(shell echo $(PACKAGEVER) | sed s/\\./_/g)
 
95
 
 
96
debian/control: debian/in/control
 
97
        slice -o $(sliceterm):$@ $<
 
98
 
 
99
maintainer-clean:
 
100
        rm -f debian/control
 
101
 
 
102
maintainer-scripts: debian/control
 
103
        for in in debian/in/PACKAGE* ; do \
 
104
                out=`echo $$in | sed 's:/in/:/:;s/PACKAGE/$(PACKAGE)/'` ; \
 
105
                sed 's/@VERSION@/$(version)/g;s/@PACKAGE@/$(PACKAGE)/g;s/@MAJOR@/$(major)/g;s/@PRIORITY@/$(priority)/g;' \
 
106
                        < $$in > $$out ; \
 
107
        done
 
108
 
 
109
        for f in octave-depends defs.make ; do \
 
110
                sed 's/@VERSION@/$(version)/g;s/@MAJOR@/$(major)/g' \
 
111
                        < debian/in/$$f > debian/$$f ; \
 
112
        done
 
113
        cp debian/in/$(PACKAGE)-00list debian/patches/00list
 
114
        cp debian/in/$(PACKAGE)-watch debian/watch
 
115
        for ext in .conf .dirs -emacsen.dirs ; do               \
 
116
                slice -o $(sliceterm):debian/$(PACKAGE)$$ext    \
 
117
                        debian/in/PACKAGE$$ext ;                \
 
118
        done
 
119
        -cp debian/in/$(PACKAGE)-NEWS debian/NEWS
 
120
 
 
121
get-orig-source: upstream
 
122
upstream:
 
123
        links ftp://ftp.octave.org/pub/octave/bleeding-edge
 
124
 
 
125
$(patsubst %,build-%,arch indep) :: build-% : \
 
126
                build-%-stamp configure-stamp make-%-stamp check-stamp
 
127
$(patsubst %,build-%-stamp,arch indep) :: build-%-stamp : \
 
128
                configure make-% check
 
129
        touch $@
 
130
 
 
131
.PHONY: save-files
 
132
save-files:
 
133
        -for f in $(savefiles) $(texifiles) ; do        \
 
134
                test -f $$f && cp $$f $$f-save ;        \
 
135
        done
 
136
 
 
137
configure: maintainer-scripts save-files patch-stamp configure-stamp
 
138
configure-stamp:
 
139
        dh_testdir
 
140
 
 
141
        [ -f autogen.sh ] &&  ./autogen.sh && chmod 0755 configure
 
142
 
 
143
        # Patch desktop file such that the referenced command exists
 
144
        -test -f examples/octave.desktop.in                             \
 
145
                && perl -pi -e 's:/bin/octave:/bin/octave-$(version):'  \
 
146
                        examples/octave.desktop.in
 
147
 
 
148
        DEFAULT_PAGER=pager                             \
 
149
        CC=$(c_compiler)                                \
 
150
        CXX=$(cxx_compiler)                             \
 
151
        F77=$(f77_compiler)                             \
 
152
        FLIBS=$(fc_libs)                                \
 
153
        infofile=/usr/share/info/$(PACKAGE).info        \
 
154
        ./configure                                     \
 
155
                        --prefix=/usr                   \
 
156
                        --datadir=/usr/share            \
 
157
                        --libdir=/usr/lib               \
 
158
                        --libexecdir=/usr/lib           \
 
159
                        --infodir=/usr/share/info       \
 
160
                        --mandir=/usr/share/man         \
 
161
                        $(atlas)                        \
 
162
                        --with-hdf5                     \
 
163
                        --with-fftw                     \
 
164
                        $(fc_flag)                      \
 
165
                        --enable-shared                 \
 
166
                        --enable-rpath                  \
 
167
                        --disable-static                \
 
168
                        --build $(arch)
 
169
 
 
170
        pod2man debian/octave-depends > octave-depends-$(version).1
 
171
 
 
172
        for f in $(texifiles) ; do                                      \
 
173
                perl -pi -e 's/^(\@setfilename .+ctave)/$${1}$(major)/' \
 
174
                        $$f ;                                           \
 
175
        done
 
176
 
 
177
        chmod +x debian/subdirs-vars.pl
 
178
        cp octMakefile octMakefile-orig
 
179
        for i in no-doc only-doc ; do                           \
 
180
                debian/subdirs-vars.pl $$i                      \
 
181
                        < octMakefile > octMakefile-$$i ;       \
 
182
        done
 
183
 
 
184
        touch configure-stamp
 
185
 
 
186
make-arch: configure-stamp make-arch-stamp
 
187
make-arch-stamp:
 
188
 
 
189
        ln -fs octMakefile-no-doc octMakefile
 
190
        $(MAKE)         CFLAGS="$(compilerflags)"               \
 
191
                        CXXFLAGS="$(compilerflags)"             \
 
192
                        FFLAGS="$(compilerflags)"               \
 
193
                        LDFLAGS="$(linkerflags)"                \
 
194
                        CC="$(c_compiler)"                      \
 
195
                        CXX="$(cxx_compiler)"                   \
 
196
                        F77="$(f77_compiler)"
 
197
 
 
198
        touch make-arch-stamp
 
199
 
 
200
make-indep: configure-stamp make-arch-stamp make-indep-stamp
 
201
make-indep-stamp:
 
202
 
 
203
        ln -fs octMakefile-only-doc octMakefile
 
204
        $(MAKE) AWK=gawk
 
205
 
 
206
        touch make-indep-stamp
 
207
 
 
208
check: configure-stamp make-arch-stamp check-stamp
 
209
check-stamp:
 
210
        ln -fs octMakefile-no-doc octMakefile
 
211
        -$(MAKE) check
 
212
        touch check-stamp
 
213
 
 
214
clean: unpatch
 
215
        dh_testdir
 
216
        dh_testroot
 
217
 
 
218
        [ ! -f doc/Makefile ] || $(MAKE) -C doc clean
 
219
        [ ! -f doc/interpreter/images/Makefile ] \
 
220
                || $(MAKE) -C doc/interpreter/images distclean
 
221
        [ ! -f doc/Makefile ] || $(MAKE) -C doc maintainer-clean
 
222
        find doc -name \*.info\* | xargs rm -f
 
223
 
 
224
        -test -f octMakefile-orig && mv octMakefile-orig octMakefile
 
225
        [ ! -f Makefile ] || $(MAKE) -i distclean \
 
226
                || $(MAKE) -f Makefile.in distclean
 
227
 
 
228
        rm -f build-*-stamp configure-stamp make-*-stamp check-stamp    \
 
229
                install-*-stamp Makefile.tmp octMakefile-*
 
230
 
 
231
        rm -f `ls debian/in/PACKAGE* | sed 's/PACKAGE/$(PACKAGE)/;s:/in::'`
 
232
        rm -f octave-depends-$(version).1
 
233
        ( cd debian ; rm -f watch octave-depends defs.make )
 
234
 
 
235
        -for f in $(savefiles) $(texifiles) ; do        \
 
236
                test -f $$f-save && mv $$f-save $$f ;   \
 
237
        done
 
238
 
 
239
        rm -f debian/NEWS
 
240
 
 
241
        dh_clean
 
242
 
 
243
install: install-arch install-indep
 
244
 
 
245
install-indep: configure-stamp make-indep-stamp install-indep-stamp
 
246
install-indep-stamp :
 
247
        dh_testdir
 
248
        dh_testroot
 
249
        dh_installdirs -A
 
250
 
 
251
        ln -fs octMakefile-only-doc octMakefile
 
252
        $(MAKE) INSTALL_PROGRAM="install -s" DESTDIR=$(debtmp)  \
 
253
                install
 
254
 
 
255
        touch install-indep-stamp
 
256
 
 
257
install-arch: configure-stamp make-arch-stamp check-stamp install-arch-stamp
 
258
install-arch-stamp :
 
259
        dh_testdir
 
260
        dh_testroot
 
261
        dh_installdirs -A
 
262
 
 
263
        ln -fs octMakefile-no-doc octMakefile
 
264
        $(MAKE) INSTALL_PROGRAM="install -s" DESTDIR=$(debtmp)  \
 
265
                install
 
266
 
 
267
        dh_installman                           \
 
268
                octave-depends-$(version).1     \
 
269
                doc/interpreter/octave.1        \
 
270
                doc/interpreter/octave-bug.1    \
 
271
                doc/interpreter/mkoctfile.1     \
 
272
                doc/interpreter/octave-config.1
 
273
 
 
274
        install debian/octave-depends \
 
275
                 $(debtmp)/usr/bin/octave-depends-$(version)
 
276
        install --mode=644 debian/defs.make \
 
277
                $(debtmp)/usr/share/octave/debian/defs.make-$(version)
 
278
 
 
279
        (cd $(debtmp)/usr/share/man/man1;                               \
 
280
                mv -v   octave.1        octave-$(version).1;            \
 
281
                ln -s   octave-$(version).1     octave$(major).1;       \
 
282
                mv -v   octave-bug.1    octave-bug-$(version).1;        \
 
283
                mv -v   octave-config.1 octave-config-$(version).1;     \
 
284
                mv -v   mkoctfile.1     mkoctfile-$(version).1;         )
 
285
        (cd $(debtmp)/usr/bin;                                          \
 
286
                rm -v   octave  octave-bug mkoctfile octave-config)
 
287
 
 
288
        -test "$(PACKAGEVER)" = 2.1                     \
 
289
                || install --mode=644 debian/octave.st  \
 
290
                        $(debtmp)/usr/share/enscript/hl
 
291
 
 
292
        touch install-arch-stamp
 
293
 
 
294
binary-indep: build-indep install-indep
 
295
        dh_testdir -i
 
296
        dh_testroot -i
 
297
 
 
298
        # already installed by make
 
299
        dh_installinfo -n -p$(info_package)     doc/*/*$(major)*.info*
 
300
 
 
301
        dh_installdocs -n -p$(doc_package) doc/*/*.pdf
 
302
        dh_installdocs -i
 
303
        for dir in faq interpreter liboctave ; do                       \
 
304
                test -d $(debhtmldoc)/$$dir                             \
 
305
                        || mkdir $(debhtmldoc)/$$dir ;                  \
 
306
                find doc/$$dir \( -name \*.html -o -name \*.png \)      \
 
307
                         -exec cp \{} $(debhtmldoc)/$$dir \; ;          \
 
308
        done
 
309
 
 
310
        # install Octave Emacs files and Debian Emacsen files
 
311
        dh_installdirs -p$(emacs_package)
 
312
        dh_installdirs -p$(emacs_package) \
 
313
                usr/share/emacs/site-lisp/$(emacs_package)
 
314
        install -p -m 0644 emacs/*.el           $(deblsp)
 
315
        dh_installemacsen -p$(emacs_package)
 
316
        -install -p -m 0755 emacs/octave-tags                   \
 
317
                $(debbase)/$(emacs_package)/usr/bin/octave-tags-$(version)
 
318
        -install -p -m 0644 emacs/octave-tags.1                 \
 
319
             $(debbase)/$(emacs_package)/usr/share/man/man1/octave-tags-$(version).1
 
320
 
 
321
        dh_installchangelogs -i ChangeLog
 
322
        dh_compress -i --exclude=.pdf
 
323
        dh_fixperms -i
 
324
        dh_installdeb -i
 
325
        dh_gencontrol -i
 
326
        dh_builddeb -i
 
327
 
 
328
# Build architecture-dependent files here.
 
329
binary-arch: build-arch install-arch check
 
330
        dh_testdir -a
 
331
        dh_testroot -a
 
332
        dh_installdirs -p$(PACKAGE)
 
333
 
 
334
        # remove the /usr/share/info/dir stab
 
335
        rm -vf $(debtmp)/usr/share/info/dir
 
336
 
 
337
        # save the include files for the header package
 
338
        dh_movefiles -p$(dev_package) --sourcedir=debian/$(PACKAGE)     \
 
339
                        usr/include/                                    \
 
340
                        usr/bin/mkoctfile-$(version)                    \
 
341
                        usr/bin/octave-config-$(version)                \
 
342
                        usr/bin/octave-depends-$(version)               \
 
343
                        usr/share/man/man1/mkoctfile-$(version).1       \
 
344
                        usr/share/man/man1/octave-config-$(version).1   \
 
345
                        usr/share/man/man1/octave-depends-$(version).1  \
 
346
                        usr/share/octave/debian/defs.make-$(version)
 
347
        rm -r $(debtmp)/usr/include
 
348
        rm -rf $(debtmp)/usr/share/info
 
349
        rm -rf $(debtmp)/usr/share/octave/debian/
 
350
 
 
351
        install -p -m 0644  debian/$(PACKAGE).conf  $(debtmp)/etc
 
352
 
 
353
        # install lintian overrride
 
354
        install -p -m 0644  debian/$(PACKAGE).lintian \
 
355
                        $(debtmp)/usr/share/lintian/overrides/$(PACKAGE)
 
356
 
 
357
        ## link the conf.file back from /etc over the version.spec. rc
 
358
        ln -sf /etc/$(PACKAGE).conf             $(debininew)/octaverc
 
359
 
 
360
        # Remove empty dirs
 
361
        rm -rf $(debshare)/octave/site  \
 
362
                $(deblib)/octave/*/site \
 
363
                $(deblib)/octave/site
 
364
 
 
365
        dh_installdocs -a                       README README.kpathsea  \
 
366
                                                NEWS* PROJECTS THANKS   \
 
367
                                                BUGS SENDING-PATCHES
 
368
        dh_installdocs -p$(PACKAGE)             debian/README.Atlas
 
369
        # recreated in postinst in share/, not needed in lib
 
370
        rm -vf  $(debtmp)/usr/lib/octave/ls-R \
 
371
                $(debtmp)/usr/share/octave/ls-R
 
372
 
 
373
        ## Rename the desktop file
 
374
        -[ -e $(debapp)/www.octave.org-octave.desktop ]         \
 
375
                && mv $(debapp)/www.octave.org-octave.desktop   \
 
376
                        $(debapp)/octave$(major).desktop
 
377
 
 
378
        dh_installexamples -p$(dev_package) examples/* \
 
379
                --exclude=octave.desktop
 
380
 
 
381
        dh_installmenu -p$(PACKAGE)
 
382
        dh_installchangelogs -a ChangeLog ChangeLog.1
 
383
        for i in glob libcruft liboctave src scripts test doc; do \
 
384
                cp -vax $$i/ChangeLog $(debdoc)/changelog.$$i; done
 
385
        # make octaveX.Y a symlink to octave-x.y.z and link the manpage to octaveX.Y
 
386
        dh_link --package=$(PACKAGE) \
 
387
                usr/bin/octave-$(version) usr/bin/$(PACKAGE)
 
388
        dh_link --package=$(PACKAGE) \
 
389
                usr/share/man/man1/octave-$(version).1.gz \
 
390
                usr/share/man/man1/octave$(major).1.gz
 
391
        # FIXME: The following should be removed after the final 3.0 release
 
392
ifneq ($(PACKAGEVER),$(major))
 
393
        dh_link --package=$(PACKAGE) \
 
394
                usr/share/man/man1/octave$(major).1.gz \
 
395
                usr/share/man/man1/octave$(PACKAGEVER).1.gz
 
396
endif
 
397
        # make mkoctfileX.Y a symlink and symlink the manpage as well
 
398
        dh_link --package=$(dev_package) \
 
399
                usr/bin/mkoctfile-$(version) usr/bin/mkoctfile$(major)
 
400
        dh_link --package=$(dev_package) \
 
401
                usr/share/man/man1/mkoctfile-$(version).1.gz \
 
402
                usr/share/man/man1/mkoctfile$(major).1.gz
 
403
        # FIXME: The following should be removed after the final 3.0 release
 
404
ifneq ($(PACKAGEVER),$(major))
 
405
        dh_link --package=$(dev_package) \
 
406
                usr/share/man/man1/mkoctfile$(major).1.gz \
 
407
                usr/share/man/man1/mkoctfile$(PACKAGEVER).1.gz
 
408
endif
 
409
        # make octaveX.Y-depends a symlink and symlink the manpage as well
 
410
        dh_link --package=$(dev_package) \
 
411
                usr/bin/octave-depends-$(version) \
 
412
                usr/bin/octave$(major)-depends
 
413
        dh_link --package=$(dev_package) \
 
414
                usr/share/man/man1/octave-depends-$(version).1.gz \
 
415
                usr/share/man/man1/octave$(major)-depends.1.gz
 
416
        # FIXME: The following should be removed after the final 3.0 release
 
417
ifneq ($(PACKAGEVER),$(major))
 
418
        dh_link --package=$(dev_package) \
 
419
                usr/share/man/man1/octave$(major)-depends.1.gz \
 
420
                usr/share/man/man1/octave$(PACKAGEVER)-depends.1.gz
 
421
endif
 
422
        dh_strip -a
 
423
        dh_compress -a
 
424
        dh_fixperms -a
 
425
        dh_installdeb -a
 
426
        dh_shlibdeps -a -l/usr/lib/octave-$(version)
 
427
        if [ `dpkg-architecture -qDEB_BUILD_ARCH` = "m68k" ];then \
 
428
                echo "m68k:Depends=f2c" >> debian/$(PACKAGE)-headers.substvars; \
 
429
        fi
 
430
        dh_gencontrol -a
 
431
        dh_builddeb -a
 
432
 
 
433
source diff:
 
434
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
435
 
 
436
binary: binary-arch binary-indep
 
437
.PHONY: build clean make configure binary-indep binary-arch binary
 
438
 
 
439
.NOTPARALLEL:
 
440