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
|
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for the Debian/GNU Linux quantlib package
# Copyright (C) 2001 by Dirk Eddelbuettel <edd@debian.org>
source := $(shell head -1 debian/changelog | awk '{print $$1}')
sonum := 0
libpack := lib$(source)$(sonum)
devpack := $(libpack)-dev
debtmp := $(CURDIR)/debian/$(libpack)
debdoc := $(CURDIR)/debian/$(libpack)/usr/share/doc/$(libpack)
arch := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DH_COMPAT=3
# edd 29 Nov 2001 Default to g++
cxxcompiler = g++
# but use g++-3.0 on i386, ia64, alpha
##ifneq "$(findstring $(arch), i386-linux alpha-linux ia64-linux)" ""
ifneq "$(findstring $(arch), ia64-linux)" ""
cxxcompiler = g++-3.0
endif
upstream: get-orig-source
get-orig-source:
lynx http://quantlib.org/download.html
build: build-stamp
build-stamp:
dh_testdir
#./autogen.sh
CXX=$(cxxcompiler) ./configure --prefix=/usr \
--enable-shared \
--enable-static \
--with-gnu-ld \
--mandir=$(debtmp)/usr/share/man \
--host $(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
$(MAKE) CFLAGS="-O2 -D_REENTRANT" \
CXXFLAGS="-O2 -D_REENTRANT" \
CXX=$(cxxcompiler)
touch build-stamp
test: test-stamp
test-stamp: build-stamp
-$(MAKE) check
touch test-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp install-stamp test-stamp
rm -rf debian/static/
dh_clean lib/*so* build/*.so*
-$(MAKE) distclean
install: install-stamp
install-stamp:
$(MAKE) -f debian/rules DH_OPTIONS= install-work
install-work:
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) prefix=$(debtmp)/usr install
# move static libs into dev-package
dh_movefiles -p$(devpack) --sourcedir=debian/$(libpack)
# some cleanup after movefiles
-rm -vf $(debtmp)/usr/lib/lib*.la
-rm -rvf $(debtmp)/usr/include
# install lintian "silencer"
dh_installdirs -p$(libpack) usr/share/lintian/overrides
install -p -m 0644 debian/$(libpack).lintian \
$(debtmp)/usr/share/lintian/overrides/$(libpack)
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
dh_installdocs -p$(libpack) Readme.txt TODO.txt \
Authors.txt Contributors.txt \
History.txt TODO.txt News.txt
dh_installexamples -p$(libpack) Examples/*
(cd $(debdoc)/examples; rm -vf Makefile */Makefile */*.o; \
rm -rvf */.deps */.libs) || true
# dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
dh_installman -p$(libpack) debian/Parities.1 \
debian/DiscreteHedging.1 \
debian/quantlib-config.1
# dh_installinfo
# dh_undocumented
dh_installchangelogs ChangeLog.txt
dh_compress
dh_fixperms
dh_strip -N$(devpack)
# dh_suidregister
dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
# dh_md5sums
dh_builddeb
# 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
|