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 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
|
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for the Debian/GNU Linux quantlib package
# Copyright (C) 2001 - 2016 by Dirk Eddelbuettel <edd@debian.org>
source := $(shell head -1 debian/changelog | awk '{print $$1}')
# 'quantlib-config --version' after configure is easier ...
# that currently gets 1.0 only
# reverted back to using libquantlib0
#sonum := 1.3
#sonum := $(shell grep AC_INIT configure.ac | \
# perl -ne 'm/([0-9\\.]+)/ and print $$1')
#libpkg := lib$(source)-$(sonum)
#libpkg := lib$(source)-1.1
libpkg := lib$(source)0v5
devpkg := lib$(source)0-dev
smppkg := $(source)-examples
debtmp := $(CURDIR)/debian/$(libpkg)
libdoc := $(CURDIR)/debian/$(libpkg)/usr/share/doc/$(libpkg)
arch := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
cpu := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
#export DH_VERBOSE=1
## edd 29 Nov 2001 Default to g++
## edd 18 Jun 2005 g++-3.4 for testing
## edd 18 Jul 2005 back to g++
## edd 17 Nov 2005 g++-4.0
## edd 16 Mar 2006 back to g++
cxx = g++
## edd 13 Apr 2014 use dpkg-buildflags as a base
cxxbuildflags = $(shell dpkg-buildflags --get CXXFLAGS)
cppbuildflags = $(shell dpkg-buildflags --get CPPFLAGS)
buildflags = $(cxxbuildflags) $(cppbuildflags)
ldflags = $(shell dpkg-buildflags --get LDFLAGS)
## edd 18 May 2002 standard flags for libraries
## edd 18 Jun 2005 no optim., debugging
## edd 18 Jul 2005 back to normal
## edd 17 Nov 2005 added -fpermissive for 0.3.11-2
## edd 13 Apr 2014 use buildflags as base
compilerflags = $(buildflags) -g0 -O2 -D_REENTRANT -fpermissive
# edd 14 Jan 2003 no longer override g++ as 3.2 is now default everywhere
## but use g++-3.0 on ia64
#ifneq "$(findstring $(arch), ia64-linux)" ""
#cxx = 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
## edd 26 Jun 2007 use cpu test, not arch test -- thanks to Riku via #430709
## edd 13 Apr 2014 use buildflags as base
ifneq "$(findstring $(cpu), m68k arm armeb mipsel mips)" ""
compilerflags = $(buildflags) -O0 -g0 -D_REENTRANT -fpermissive
endif
### edd 22 Dec 2002 g++-3.2 for s390
#ifneq "$(findstring $(arch), s390-linux)" ""
#cxx = g++-3.2
#endif
## edd 19 June 2004 no optimisation on amd64 (#255100)
#ifneq "$(findstring $(arch), x86_64-linux)" ""
#compilerflags = -O0 -D_REENTRANT
#endif
upstream: get-orig-source
get-orig-source:
#lynx http://quantlib.org/download.html
#lynx http://prdownloads.sf.net/quantlib
links http://quantlib.org/download.shtml
prerelease:
# links http://quantlib.org/gm/
# links http://quantlib.org/prerelease
links https://sourceforge.net/projects/quantlib/files/prerelease
configure: configure-stamp
configure-stamp:
dh_testdir
dh_autoreconf
#./autogen.sh
CXX=$(cxx) \
CXXFLAGS="$(compilerflags)" \
CFLAGS="$(compilerflags)" \
LDFLAGS="$(ldflags)" \
./configure --prefix=/usr \
--enable-openmp \
--enable-intraday \
--enable-examples \
--enable-benchmark \
--enable-shared \
--enable-static \
--with-gnu-ld \
--mandir=$(debtmp)/usr/share/man \
--build $(arch)
# patch libtool re rpath (see lintian docu)
sed < libtool > libtool-2 \
-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
mv libtool-2 libtool
chmod 755 libtool
# end libtool rpath patch
touch configure-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
-$(MAKE) CFLAGS="$(compilerflags)" \
CXXFLAGS="$(compilerflags)" \
LDFLAGS="$(ldflags)" \
CXX=$(cxx)
# edd 17 May 2005 create shlibs on the fly
# edd 11 Feb 2007 libQuantLibFunctions is no more
# edd 07 Mar 2012 need to tag this as so number 0
# edd 01 Sep 2013 back to libquantlib0 and fixed file
#@echo "libQuantLib ${sonum} libquantlib-${sonum}" \
# > debian/libquantlib-${sonum}.shlibs
#@echo "libQuantLib 0 libquantlib-${sonum}" \
# > debian/shlibs.local
#@echo "libQuantLibFunctions ${sonum} libquantlib-${sonum}" \
# >> debian/libquantlib-${sonum}.shlibs
touch build-stamp
test: test-stamp
test-stamp: build-stamp
ifeq "$(findstring $(cpu), m68k arm aarch64 armeb armel mipsel mips hppa)" ""
-LD_LIBRARY_PATH=$(CURDIR)/ql/.libs $(MAKE) check
#-LD_LIBRARY_PATH=$(CURDIR)/ql/.libs $(MAKE) benchmark
endif
touch test-stamp
clean:
dh_testdir
dh_testroot
dh_autoreconf_clean
rm -f configure-stamp build-stamp install-stamp test-stamp
rm -rf debian/static/
dh_clean lib/*so* build/*.so*
[ ! -f Makefile ] || $(MAKE) distclean
-rm -rf config.log config.status
#-rm -rf debian/libquantlib-${sonum}.shlibs
install: install-stamp
install-stamp: test-stamp
$(MAKE) -f debian/rules DH_OPTIONS= install-work
install-work:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
-$(MAKE) prefix=$(debtmp)/usr install
-$(MAKE) prefix=$(debtmp)/usr install-am
# clean usr/aclocal
rm -rvf $(debtmp)/usr/aclocal
dh_installexamples -p$(libpkg) Examples/ \
test-suite/ \
quantlib.el
(cd $(libdoc)/examples/Examples; \
rm -vf */*.o */*.dsp */*.mak *.dsw *.mak; \
rm -rvf */.deps/ */.libs/; \
find . -type f -perm 0755 | xargs rm -vf ) || true
(cd $(libdoc)/examples/test-suite; \
rm -rvf *.o .deps/ .libs/; \
find . -type f -perm 0755 | xargs rm -vf ) || true
# dh_installman -p$(devpkg) debian/quantlib-test-suite.1
# now part of upstream: debian/DiscreteHedging.1 \
# debian/quantlib-config.1 \
# defunct debian/Parities.1
# dh_installdirs -p$(smppkg) usr/share/man/man1
# dh_installman -p$(smppkg) debian/EquityOption.1 \
# debian/ConvertibleBonds.1
# dh_installman -p$(smppkg) debian/FittedBondCurve.1
# dh_installman -p$(smppkg) debian/CDS.1 debian/CallableBonds.1
# install -d debian/libquantlib0/usr/bin
# install -m 0755 -c quantlib-config debian/libquantlib0/usr/bin
# move static libs into dev-package
dh_movefiles -p$(devpkg) --sourcedir=debian/$(libpkg)
# move example files into smp-package
dh_movefiles -p$(smppkg) --sourcedir=debian/$(libpkg)
# some cleanup after movefiles
-rm -vf $(debtmp)/usr/lib/lib*.la
-rm -rvf $(debtmp)/usr/include
-rm -rvf $(debtmp)/usr/share/doc/$(libpkg)/examples/
# install lintian "silencer"
# edd 15 May 2005 no longer needed #
#dh_installdirs -p$(libpkg) usr/share/lintian/overrides
#install -p -m 0644 debian/$(libpkg).lintian \
# $(debtmp)/usr/share/lintian/overrides/$(libpkg)
# remove redundant LGPL license
rm -vf $(CURDIR)/debian/$(devpkg)/usr/share/doc/$(libpkg)/examples/test-suite/CPPUNIT-COPYING
# try this here
dh_installchangelogs -p$(libpkg) -N$(debpkg) -N$(smppkg) ChangeLog.txt
# remove empty examples/ dir
# rm -vf $(CURDIR)/debian/$(devpkg)/usr/share/doc/$(libpkg)/examples/test-suite/CPPUNIT-COPYING
touch install-stamp
# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common: build test install
dh_testdir
dh_testroot
# dh_installdebconf
dh_link -p$(smppkg) -p$(devpkg)
dh_installdocs -p$(libpkg) -N$(debpkg) -N$(smppkg) \
Readme.txt Announce.txt \
Authors.txt \
Contributors.txt \
News.txt
# dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
# dh_installinfo
# dh_undocumented
dh_strip
# dh_link
dh_compress
dh_lintian
dh_fixperms
# dh_suidregister
dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
# dh_md5sums
# because of how we install and move examples, copyright files are
# spuriously installed -- remove'em here as both are gotten via
# via symlink to the one in the main package
rm -vf $(CURDIR)/debian/$(smppkg)/usr/share/doc/$(libpkg)/copyright \
$(CURDIR)/debian/$(devpkg)/usr/share/doc/$(libpkg)/copyright
dh_builddeb || true
# Build architecture independant packages using the common target.
binary-indep: build install
# (Uncomment this next line if you have such packages.)
# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: build install
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
# Any other binary targets build just one binary package at a time.
binary-%: build install
make -f debian/rules binary-common DH_OPTIONS=-p$*
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install test
|