File: rules

package info (click to toggle)
quantlib-swig 0.3.13-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 43,120 kB
  • ctags: 74,378
  • sloc: cpp: 795,926; ansic: 103,715; ml: 39,516; cs: 24,631; java: 17,063; perl: 12,601; python: 6,752; lisp: 2,223; ruby: 1,103; sh: 458; makefile: 319
file content (184 lines) | stat: -rwxr-xr-x 5,000 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
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
#! /usr/bin/make -f
#                                                       -*- makefile -*-
# debian/rules file for the Debian Linux quantlib-swig package
# Copyright (C) 2001 - 2006 by Dirk Eddelbuettel <edd@debian.org>

#package	:= $(shell grep Package debian/control | sed 's/^Package: //')
pypackage	= quantlib-python
rbpackage	= quantlib-ruby
rrpackage	= quantlib-r
version		:= $(shell head -1 debian/changelog | \
			perl -nle 'm/\S+\s+\((\S+)\)/ && print $$1')
pydeb		:= $(CURDIR)/debian/$(pypackage)
rbdeb		:= $(CURDIR)/debian/$(rbpackage)
rrdeb		:= $(CURDIR)/debian/$(rrpackage)

#arch 		:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
## edd 01 Nov 2005 use DEB_BUILD_ARCH_CPU, not DEB_BUILD_GNU_TYPE 
##                 updated rules throughout
arch		:= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)

PYTHON  	:= python2.4
RUBY		:= ruby

#export DH_VERBOSE=1
export DH_COMPAT=4

## edd 29 Nov 2001	Default to g++
cxxcompiler	= g++

## edd 14 Jan 2003	no longer change g++ as g++-3.2 is now default
# 			but use g++-3.0 on ia64
#ifneq "$(findstring $(arch), ia64)" ""
#cxxcompiler	= g++-3.0
#endif

## edd 01 Feb 2002  	allow -ffunction-sections on hppa 
compilerflags	= -O2 -Wall
ifeq ($(arch),hppa)
compilerflags   = -O2 -ffunction-sections
#cxxcompiler	= g++-3.0
endif

## edd 18 May 2002	no optimisation or debugging on baby systems
## edd 14 May 2005	don't do it on mipsel or mips either
ifneq "$(findstring $(arch), m68k arm mipsel mips)" ""
compilerflags   = -O0 -g0
endif

## edd 25 Dec 2002  g++-3.2 for s390
#ifneq "$(findstring $(arch), s390)" ""
#cxxcompiler	= g++-3.2
#endif

upstream: get-orig-source
get-orig-source:
        lynx http://quantlib.org

build: build-stamp
build-stamp:
	dh_testdir
	@echo "*** Running on $(arch)"

	# need to build the Makefile for R
#	./configure 	--prefix=/usr 				\
#			--build $(arch)

        # $(MAKE)
	(cd Python && 						\
			CC="$(cxxcompiler)"			\
			CXX="$(cxxcompiler)" 			\
			CFLAGS="$(compilerflags)" 		\
			CXXFLAGS="$(compilerflags)"		\
			$(PYTHON) setup.py build		)

	(cd Ruby && 						\
			CC="$(cxxcompiler)"			\
			CXX="$(cxxcompiler)" 			\
			CFLAGS="$(compilerflags)" 		\
			CXXFLAGS="$(compilerflags)"		\
		 	$(RUBY) setup.rb build  		)

# 	(cd R && 						\
# 			CC="$(cxxcompiler)"			\
# 			CXX="$(cxxcompiler)" 			\
# 			CFLAGS="$(compilerflags)" 		\
# 			CXXFLAGS="$(compilerflags)"		\
# 			make					)

	touch build-stamp

test:	build test-stamp
test-stamp:
## edd 01 Nov 2005  run check only on i386
#ifeq "$(findstring $(arch), m68k arm)" ""
ifeq ($(arch),i386)
        # -$(MAKE) test
	(cd Python && 						\
		$(PYTHON) setup.py test				)
	(cd Ruby   && 						\
		$(RUBY) setup.rb test				)
endif
	touch test-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp test-stamp install-stamp
	-test -f Makefile && $(MAKE) realclean
	(cd Python && 						\
			$(PYTHON) setup.py clean --all	&&	\
			rm -f QuantLib/*.pyc			)
	(cd Ruby &&						\
			rm -f quantlib_wrap.o QuantLibc.so 	)
	dh_clean

install: test install-stamp
install-stamp: 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs	-p$(pypackage)	usr/share/$(pypackage)
        #$(MAKE) install PREFIX=$(debtmp)/usr
	(cd Python && 						\
			$(PYTHON) setup.py 			\
				install --prefix=$(pydeb)/usr	)
        # edd 2005-Apr-14  copy swig file manually instead
	cp -vax SWIG/* 	$(pydeb)/usr/share/$(pypackage)/
	rm -fv 	Python/test/*.pyc
        # remove Docs installed by Python, we do that below
	rm -frv $(pydeb)/usr/share/doc/QuantLib-Python
        # remove .pyc which Lintian doesn't like
	rm -frv $(pydeb)/usr/lib/python*/site-packages/QuantLib/*.pyc

	dh_installdirs -p$(rbpackage)	usr/share/$(rbpackage)
        # $(MAKE) install PREFIX=$(debtmp)/usr
	(cd Ruby &&							\
		CXX="$(cxxcompiler)" 					\
		CFLAGS="$(compilerflags)" 				\
		CXXFLAGS="$(compilerflags)" 				\
		$(RUBY) setup.rb install				\
			--prefix=$(rbdeb)/usr --debian			)
        # fix mode, lintian complain about 755 and no #! line
	chmod 644 debian/$(rbpackage)/usr/lib/ruby/1.8/QuantLib.rb
	touch install-stamp

	touch install-stamp

binary-indep: build test install

binary-arch: build test install
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs	-A	Readme.txt News.txt 
	dh_installexamples -p$(pypackage) Python/test/*.py Python/examples/*.py
	dh_installexamples -p$(rbpackage) Ruby/test/*.rb   Ruby/examples/*.rb
#	dh_installmenu
#	dh_installemacsen
#	dh_installpam
#	dh_installinit
#	dh_installcron
#	dh_installmanpages
#	dh_installinfo		
#	dh_undocumented
	dh_installchangelogs -A	ChangeLog.txt
#	dh_link
	dh_compress
	dh_fixperms
	dh_strip
#	dh_suidregister
	dh_pycentral	-p$(pypackage)
	dh_python	-p$(pypackage)
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_md5sums
	dh_builddeb

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 install test