File: rules

package info (click to toggle)
code-saturne 5.3.2+repack-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 76,868 kB
  • sloc: ansic: 338,582; f90: 118,487; python: 65,227; makefile: 4,429; cpp: 3,826; xml: 3,078; sh: 1,205; lex: 170; yacc: 100
file content (79 lines) | stat: -rwxr-xr-x 3,224 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
#!/usr/bin/make -f

# Which MPI implementation?
# set ARCH_DEFAULT_MPI_IMPL
include /usr/share/mpi-default-dev/debian_defaults

DEB_CONFIGURE_USER_FLAGS := --with-mpi --libexecdir=/usr/lib/ --disable-rpath

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL)/libhdf5.so),)
  DEB_CONFIGURE_USER_FLAGS += \
	--with-hdf5-include=/usr/include/hdf5/$(ARCH_DEFAULT_MPI_IMPL) \
	--with-hdf5-lib=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL) \
	--with-mpi-include=/usr/include/$(DEB_HOST_MULTIARCH)/mpi
endif

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean -- distclean
	rm -f debian/epoch.tex
	cd libple/po && rm -f *.gmo *.pot stamp-po
	cd po && rm -f *.gmo *.pot stamp-po
	rm -fr libple/build-aux

override_dh_autoreconf:
	dh_autoreconf sbin/bootstrap

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CONFIGURE_USER_FLAGS)
	# Drop dpkg-buildflags from ple-config to improve reproducibility
	sed -i $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS FCFLAGS LDFLAGS,-e '/^build_$(shell echo $(flags) | tr A-Z a-z)=/s/$(shell dpkg-buildflags --get $(flags) | sed 's:/:\\/:g')//') \
	  libple/ple-config

override_dh_auto_build-arch:
	dh_auto_build

override_dh_auto_build-indep: override_dh_auto_build-arch
	# Force source date in pdf (instead of compile date)
	/bin/echo -e "$(shell date -d@$(SOURCE_DATE_EPOCH) "+\year=%Y\n\month=%m")" >debian/epoch.tex
	dh_auto_build -- doc

override_dh_auto_install-arch:
	dh_auto_install
	# Restore self.rpath in cs_config.py
	sed -i 's/self\.rpath = "" #/self.rpath =/' debian/tmp/usr/lib/python*/dist-packages/code_saturne/cs_config.py
	# Drop dpkg-buildflags from cs_config.py
	sed -i $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS FCFLAGS LDFLAGS,-e "/'$(shell echo $(flags) | tr A-Z a-z)':/s/$(shell dpkg-buildflags --get $(flags) | sed 's:/:\\/:g')//") \
	  debian/tmp/usr/lib/python*/dist-packages/code_saturne/cs_config.py

override_dh_auto_install-indep: override_dh_auto_install-arch
	$(MAKE) install-doc DESTDIR=$(CURDIR)/debian/tmp
	# Fix location of the ple doc and fix paths
	mv debian/tmp/usr/share/doc/ple/doxygen debian/tmp/usr/share/doc/code_saturne/doxygen/ple
	sed -i 's:$(CURDIR)/docs/doxygen/ple.tag:/usr/share/doc/code-saturne/doxygen/ple/ple.tag:' debian/tmp/usr/share/doc/code_saturne/doxygen/src/html/index.html
	find debian/tmp/usr/share/doc/code_saturne/doxygen/src/html -type f \
	  -exec grep -q '/usr/share/doc/ple/doxygen' {} \; \
	  -exec sed -i 's:/usr/share/doc/ple/doxygen:/usr/share/doc/code-saturne/doxygen/ple:g' {} \; \
	  -print
	sed -i 's:$(CURDIR)/::g' debian/tmp/usr/share/doc/code_saturne/doxygen/ple/ple.tag

override_dh_install-arch:
	dh_install -a
	dh_python2 -pcode-saturne-include

override_dh_install-indep:
	# Exclude cs_config.py from package code-saturne-data:
	# It should go into code-saturne-include.
	# Exclude extra license file COPYING as well.
	dh_install -i -Xcs_config.py -XCOPYING
	chmod +x debian/code-saturne-data/usr/share/code_saturne/runcase*
	find debian/code-saturne-data -type f \( -name \*.pyc -o -name \*.pyo \) -delete
	dh_python2 -pcode-saturne-data

override_dh_installdocs:
	dh_installdocs -A AUTHORS

override_dh_compress:
	dh_compress -X.pdf -X.xml -X.des -X.f90 -X.c -X.tag