File: rules

package info (click to toggle)
python-escript 5.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 144,196 kB
  • sloc: python: 592,057; cpp: 136,909; ansic: 18,675; javascript: 9,411; xml: 3,384; sh: 740; makefile: 203
file content (101 lines) | stat: -rwxr-xr-x 3,641 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

PROJROOT=$(CURDIR)
B3DEST=$(CURDIR)/debian/python3-escript
B3MDEST=$(CURDIR)/debian/python3-escript-mpi
DDEST=$(CURDIR)/debian/python-escript-doc
BUILD3=$(CURDIR)/debian/tmp3
BUILD3M=$(CURDIR)/debian/tmp3M
WORK3=$(CURDIR)/debian/stage3
WORK3M=$(CURDIR)/debian/stage3M

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

#export DEB_CXXFLAGS_MAINT_APPEND = -Wno-maybe-uninitialized
#export DEB_CFLAGS_MAINT_APPEND = -Wno-maybe-uninitialized
export DEB_CXXFLAGS_MAINT_APPEND = -Wno-uninitialized
export DEB_CFLAGS_MAINT_APPEND = -Wno-uninitialized

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk


#thanks to the debian manual
# export DEB_BUILD_OPTIONS="parallel=10"
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    PARBUILD:=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    SFLAGS:=-j$(PARBUILD)
else
    SFLAGS:=-j1
endif

# Some archs have memory / speed issues See #917869
SMALL_ARCHS:= mips64el 
SFLAGS:= $(if $(filter $(DEB_TARGET_ARCH), $(SMALL_ARCHS)),-j1, $(SFLAGS) ) 
OPT:= $(if $(filter $(DEB_TARGET_ARCH), $(SMALL_ARCHS)),-O0 mxgot , -O3 ) 

%:
	dh $@  -v

override_dh_clean:
	find . -name '*.pyc' -delete 
	rm -f itest.sh utest.sh
	rm -rf build condif.log esys include lib release .sconf_tmp .sconsign.dblite config.log .sconf_temp
	rm -rf $(B3DEST)
	rm -rf $(B3MDEST)
	rm -rf $(DDEST)
	rm -rf $(BUILD3)
	rm -rf $(BUILD3M)
	rm -rf $(WORK3)
	rm -rf $(WORK3M)
	rm -rf $(CURDIR)/debian/tmp/*
	rm -f debian/files
	rm -f debian/substvars
	dh_clean

override_dh_auto_clean:
	dh_clean

override_dh_installchangelogs:
	dh_installchangelogs debian/changelog.trivial

override_dh_auto_build:
	# Build steps for py3
	mkdir -p $(WORK3)
	scons $(SFLAGS) cc_optim='$(OPT)'  build_dir=$(BUILD3) verbose=on prefix=$(WORK3) options_file=debian/sid_options.py docs
	# extract the relevant .py files
	cd $(WORK3); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
	cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3)/run-escript3.man
	ln $(WORK3)/bin/run-escript $(WORK3)/bin/run-escript3
	find $(WORK3) -name '*.pyc' -print0| xargs -0 rm -f

	mkdir -p $(BUILD3)
	scons $(SFLAGS) build_dir=$(BUILD3) verbose=on prefix=$(WORK3) options_file=debian/sid_options.py docs
	find $(WORK3) -name '*.pyc' -print0 | xargs -0 rm -f

	# Build steps for py3 with MPI
	mkdir -p $(WORK3M)
	scons $(sflags)  build_dir=$(BUILD3M)  cc_optim='$(OPT) -DOVERLORDPATH=\"/usr/lib/python-escript3-mpi/\"' \
		verbose=on prefix=$(WORK3M) options_file=debian/sid_options_mpi.py
	# extract the relevant .py files
	cd $(WORK3M); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
	cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3M)/run-escript3-mpi.man
	ln $(WORK3M)/bin/run-escript $(WORK3M)/bin/run-escript3-mpi
	find $(WORK3M) -name '*.pyc' -print0| xargs -0 rm -f	
	#rm -rf $(BUILD3M)	
	# fix paths in each package and
	# fix some external links in the doc package
	debian/utils/tweak.sh  "$(WORK3)" "$(WORK3M)"
	rm -f scons/templates/*.pyc
	rm -f site_scons/*.pyc
	rm -f utest.sh

override_dh_shlibdeps:
	# so libraries we just built are checked as well
	dh_shlibdeps -ppython3-escript  -Npython3-escript-mpi -Npython-escript-doc -P$(B3DEST) -l$(B3DEST)/usr/lib/python3-escript/lib
	dh_shlibdeps -ppython3-escript-mpi -Npython3-escript -Npython-escript-doc -P$(B3MDEST) -l$(B3MDEST)/usr/lib/python3-escript-mpi/lib

override_dh_python3:
	dh_python3 -ppython3-escript -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename	usr/lib/python3-escript/esys
	dh_python3 -ppython3-escript-mpi -Npython3-escript -Npython-escript-doc --no-ext-rename	usr/lib/python3-escript-mpi/esys