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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for the Debian/GNU Linux octave package
# Copyright 1997-98 by Dirk Eddelbuettel <edd@debian.org>
package = octave
doc_package = octave-doc
html_package = octave-htmldoc
lib_package = octave-staticlibs
# extract the upstream version
version = $(shell head -1 debian/changelog | \
perl -nle 'm/\S+\s+\((\S+)-\S+\)/ && print $$1')
debbase := $(shell pwd)/debian
debtmp := $(debbase)/tmp
debdoc := $(debtmp)/usr/doc/$(package)
deblsp := $(debtmp)/usr/share/emacs/site-lisp/$(package)
debini := $(debtmp)/usr/share/octave/site/m/startup
debema := $(debtmp)/usr/lib/emacsen-common/packages
debest := $(debtmp)/etc/emacs/site-start.d/
doc_doc := $(debbase)/$(doc_package)/usr/doc/$(doc_package)
html_doc := $(debbase)/$(html_package)/usr/doc/$(html_package)
lib_doc := $(debbase)/$(lib_package)/usr/doc/$(lib_package)
lib_lib := $(debbase)/$(lib_package)/usr/lib/$(package)-$(version)
# We need the egcc compiler driver on some platforms as Octave uses C++ and
# Fortran and only egcc know how to combine with the eg++/eg77-derived g++
# and g77 compilers. I know it's needed on i386, and Joel Klecker says it's
# also needed on alpha and sparc --edd
compiler=gcc
fortrancompiler=f2c
arch = $(shell dpkg --print-architecture)
ifeq (i386,$(arch))
compiler=egcc
fortrancompiler=g77
endif
ifeq (alpha,$(arch))
compiler=egcc
fortrancompiler=g77
endif
ifeq (sparc,$(arch))
compiler=egcc
fortrancompiler=g77
endif
# edd 10 Feb 98 See section 4.1 of Policy Manual
arch = $(shell dpkg --print-architecture)-linux
compilerflags = "-O2"
# export DH_VERBOSE=1
build: build-stamp
build-stamp: configure-stamp make-stamp check-stamp
touch build-stamp
configure: configure-stamp
configure-stamp:
dh_testdir
perl -p -i -e 's|/tmp/octave-bug.\$$\$$|`tempfile`|' octave-bug.in
(cd kpathsea; \
perl -p -i -e \
's|--config-dir \.\.|--config-dir \.|' \
acklibtool.m4; \
autoconf; )
./configure --prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--with-$(fortrancompiler) \
--enable-dl \
--enable-shared \
--enable-lite-kernel \
--host $(arch)
touch configure-stamp
make: make-stamp
make-stamp:
$(MAKE) CFLAGS=$(compilerflags) \
CXXFLAGS=$(compilerflags) \
FFLAGS=$(compilerflags) \
LDFLAGS=-s \
CC=$(compiler)
touch make-stamp
check: make-check
check-stamp:
-$(MAKE) check
touch check-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp make-stamp check-stamp
-$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
dh_clean
binary-indep: build
# dh_testversion
dh_testdir -i
dh_testroot -i
dh_clean -i -k
dh_installdirs -p$(doc_package) usr/doc/$(doc_package)
dh_installdirs -p$(html_package) usr/doc/$(html_package)
#$(MAKE) prefix=`pwd`/debian/tmp install
# copy .ps for the -doc package
cp -a doc/*/*.ps $(doc_doc)/.
# copy .html for the -htmldoc package
cp -a doc/*/*.html $(html_doc)/.
# dh_movefiles -i
dh_installdocs -i
# dh_installexamples -i
dh_installmenu -p$(html_package)
# dh_installinit -i
# dh_installcron -i
# dh_installmanpages -i
# dh_undocumented
dh_installchangelogs -i ChangeLog
dh_compress -i
dh_fixperms -i
# dh_suidregister -i
dh_installdeb -i
dh_gencontrol -i
# dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build
# dh_testversion
dh_testdir -a
dh_testroot -a
dh_clean -a -k
dh_installdirs -a -p$(package)
# debhelper can't do versioned expansions
install -d -m 0755 $(lib_lib)
$(MAKE) INSTALL_PROGRAM="install -s" \
prefix=$(debtmp)/usr \
libdir=$(debtmp)/usr/lib \
libexecdir=$(debtmp)/usr/lib install
# remove the /usr/info/dir stab
rm -vf $(debtmp)/usr/info/dir
# save the static libs for seperate package octave-staticlibs
mv -v -f $(debtmp)/usr/lib/$(package)-$(version)/*.a $(lib_lib)/
# install /etc/octave.conf
install -p -m 0644 debian/octave.conf $(debtmp)/etc/
rm -v $(debini)/octaverc
ln -sf /etc/octave.conf $(debini)/octaverc
# install Octave Emacs files and Debian Emacsen files
install -p -m 0644 emacs/*.el $(deblsp)/.
install -p -m 0755 debian/octave.install $(debema)/install/$(package)
install -p -m 0755 debian/octave.remove $(debema)/remove/$(package)
install -p -m 0644 debian/octave.el $(debest)/50octave.el
dh_installdocs -a README NEWS* PROJECTS
dh_installexamples -a examples/*
# dh_installmenu -a
# dh_installinit -a
# dh_installcron -a
# dh_installmanpages -a
dh_undocumented -a mkoctfile.1 octave-bug.1
dh_installchangelogs -a ChangeLog
for i in glob kpathsea readline libcruft liboctave \
src scripts test doc; do \
cp -v $$i/ChangeLog $(debdoc)/changelog.$$i; done
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 make configure binary-indep binary-arch binary
|