File: rules

package info (click to toggle)
dolfin 1.4.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 38,696 kB
  • ctags: 29,035
  • sloc: cpp: 409,305; python: 22,067; sh: 230; makefile: 215; xml: 126
file content (140 lines) | stat: -rwxr-xr-x 5,552 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
#!/usr/bin/make -f

# FIXME: Is this needed?
#CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
#CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
#CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
#LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

# Allow test programs that uses OpenMPI to run
export OMPI_MCA_plm_rsh_agent=/bin/false

# Disable MPI on lam architectures
ifeq ($(DEB_BUILD_ARCH), armel)
ENABLE_MPI=OFF
else ifeq ($(DEB_BUILD_ARCH), s390)
ENABLE_MPI=OFF
else
ENABLE_MPI=ON
endif

DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)

BUILDDIR = $(CURDIR)/debian/build
DOLFIN_HOME = $(CURDIR)/$(DEB_SRCDIR)
USCAN_DESTDIR := $(CURDIR)
PYVERS := $(shell pyversions --requested debian/control | tac -s' ')
DEFAULT_PYVER := $(shell pyversions -d)

CMAKE_OPTS := \
	-D CMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
	-D BUILD_SHARED_LIBS:BOOL=ON \
	-D CMAKE_SKIP_RPATH:BOOL=ON \
	-D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \
	-D DOLFIN_ENABLE_TRILINOS:BOOL=OFF \
	-D DOLFIN_ENABLE_CGAL:BOOL=ON \
	-D DOLFIN_ENABLE_HDF5:BOOL=ON \
	-D DOLFIN_ENABLE_VTK:BOOL=ON \
	-D DOLFIN_ENABLE_QT:BOOL=ON \
	-D DOLFIN_ENABLE_PARMETIS:BOOL=OFF \
	-D DOLFIN_ENABLE_PASTIX:BOOL=OFF \
	-D DOLFIN_ENABLE_SCOTCH:BOOL=OFF \
	-D DOLFIN_ENABLE_UNIT_TESTS:BOOL=OFF \
	-D SWIG_EXECUTABLE:FILEPATH=/usr/bin/swig \
        -D DOLFIN_ENABLE_MPI:BOOL=$(ENABLE_MPI) \
	-D PETSC_DIR:PATH=/usr/lib/petscdir/3.4.2 \
	-D SLEPC_DIR:PATH=/usr/lib/slepcdir/3.4.2 \
	-D DOLFIN_LIB_DIR:PATH=lib/$(DEB_BUILD_MULTIARCH) \
	-D DOLFIN_PKGCONFIG_DIR:PATH=lib/$(DEB_BUILD_MULTIARCH)/pkgconfig \
	$(DOLFIN_HOME)

ifeq (,$(DISTRIBUTION))
        DISTRIBUTION := $(shell dpkg-parsechangelog --format rfc822 | sed -ne "s/^Distribution: //p")
endif

ifneq ($(DISTRIBUTION),$(findstring $(DISTRIBUTION),"squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy"))
        DISTRIBUTION := sid
endif

ifneq (,$(findstring $(DISTRIBUTION),"raring saucy sid"))
        PYTHON_INCLUDE_DIR2 = /usr/include/$(DEB_BUILD_MULTIARCH)
        PYTHON_LIBRARY_DIR = /usr/lib/$(DEB_BUILD_MULTIARCH)
else
        PYTHON_INCLUDE_DIR2 = /usr/include
        PYTHON_LIBRARY_DIR = /usr/lib
endif

%:
	dh $@ --buildsystem=cmake \
	      --builddirectory=$(BUILDDIR)-$(DEFAULT_PYVER) \
	      --with python2

override_dh_compress:
	dh_compress -X.py -X.cpp -X.h -X.pdf -X.ufl

override_dh_auto_clean:
	for v in $(PYVERS); do \
	   rm -rf $(BUILDDIR)-$$v; \
	done

override_dh_auto_configure:
	for v in $(PYVERS); do \
	dh_auto_configure --builddirectory=$(BUILDDIR)-$$v -- \
	   -D PYTHON_EXECUTABLE:FILEPATH=/usr/bin/$$v \
	   -D PYTHON_LIBRARY:FILEPATH=$(PYTHON_LIBRARY_DIR)/lib$$v.so \
	   -D PYTHON_INCLUDE_DIR:PATH=/usr/include/$$v \
	   -D PYTHON_INCLUDE_DIR2:PATH=$(PYTHON_INCLUDE_DIR2)/$$v \
	   -- $(CMAKE_OPTS) ;\
	done

override_dh_auto_build:
	for v in $(PYVERS); do \
	   dh_auto_build --builddirectory=$(BUILDDIR)-$$v; \
	done

override_dh_auto_install:
	for v in $(PYVERS); do \
	   dh_auto_install --builddirectory=$(BUILDDIR)-$$v; \
	done
	dh_numpy
	sed -i "s/-Werror=format-security//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc
	sed -i "s/-g -O2//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc
	sed -i "s/-D_FORTIFY_SOURCE=2//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc
	sed -i "s/-frounding-math//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc
	sed -i "s/-Wformat//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc
	sed -i "s/-Wno-deprecated//g" $(CURDIR)/debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/pkgconfig/dolfin.pc

override_dh_gencontrol:
	# We have a tight dependency on swig - #675207
	set -e; \
	swig_version=$$(dpkg-query -W swig | cut -f 2 | cut -d- -f 1); \
	next_swig_version="$${swig_version%.*}.$$(($${swig_version##*.} + 1))"; \
	echo "swig:Depends=swig (>= $$swig_version), swig (<< $$next_swig_version~)" >> debian/python-dolfin.substvars
	dh_gencontrol

override_dh_strip:
	dh_strip -a --package=libdolfin1.4 --dbg-package=libdolfin1.4-dbg -Xpython
	dh_strip -a --package=python-dolfin --dbg-package=python-dolfin-dbg

override_dh_installman:
	dh_installman


DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
DEB_STRIPPED_UPSTREAM_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -n -e 's/\+dfsg.*$$//p')

.PHONY: get-orig-source override_dh_strip
get-orig-source:
	set -ex ; \
	TMPDIR=`mktemp -d $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig.XXXXXX` ; \
	export PERL_LWP_SSL_VERIFY_HOSTNAME=0; \
	uscan --force-download --check-dirname-level 0 --destdir "$$TMPDIR" --download-version $(DEB_STRIPPED_UPSTREAM_VERSION) --upstream-version $(DEB_STRIPPED_UPSTREAM_VERSION); \
	tar -C "$$TMPDIR" --strip-components 1 -xzf "$$TMPDIR"/$(DEB_SOURCE_PACKAGE)_$(DEB_STRIPPED_UPSTREAM_VERSION).orig.tar.gz ; \
	rm -rf "$$TMPDIR"/demo/undocumented/waveguide/waveguide_TM_cutoff_modes.pdf ; \
	rm -f "$$TMPDIR"/$(DEB_SOURCE_PACKAGE)*.tar.gz ; \
	mv "$$TMPDIR" $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig ; \
	GZIP=-9 tar -czf $(CURDIR)/$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig ; \
	rm -rf $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig