/[escript]/trunk/localdebian/rules
ViewVC logotype

Contents of /trunk/localdebian/rules

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6310 - (show annotations)
Tue Jun 21 04:18:28 2016 UTC (2 years ago) by jfenwick
File size: 5771 byte(s)
Bringing in some changes from debian

1 #!/usr/bin/make -f
2
3 PROJROOT=$(CURDIR)
4 BDEST=$(CURDIR)/debian/python-escript
5 BMDEST=$(CURDIR)/debian/python-escript-mpi
6 B3DEST=$(CURDIR)/debian/python3-escript
7 B3MDEST=$(CURDIR)/debian/python3-escript-mpi
8 DDEST=$(CURDIR)/debian/python-escript-doc
9 BUILD=$(CURDIR)/debian/tmp2
10 BUILDM=$(CURDIR)/debian/tmp2M
11 BUILD3=$(CURDIR)/debian/tmp3
12 BUILD3M=$(CURDIR)/debian/tmp3M
13 WORK=$(CURDIR)/debian/stage2
14 WORKM=$(CURDIR)/debian/stage2M
15 WORK3=$(CURDIR)/debian/stage3
16 WORK3M=$(CURDIR)/debian/stage3M
17
18
19
20
21 #thanks to the debian manual
22 # export DEB_BUILD_OPTIONS="parallel=10"
23 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
24 parbuild=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
25 sflags=-j$(parbuild)
26 else
27 sflags=-j1
28 endif
29
30 %:
31 dh $@ --with python2,python3,sphinxdoc -v
32
33 override_dh_clean:
34 rm -rf build condif.log esys include lib release .sconf_tmp .sconsign.dblite config.log .sconf_temp
35 rm -rf scons/templates/*.pyc
36 rm -rf $(BDEST)
37 rm -rf $(B3DEST)
38 rm -rf $(BMDEST)
39 rm -rf $(B3MDEST)
40 rm -rf $(DDEST)
41 rm -rf $(BUILD)
42 rm -rf $(BUILDM)
43 rm -rf $(BUILD3)
44 rm -rf $(BUILD3M)
45 rm -rf $(WORK)
46 rm -rf $(WORKM)
47 rm -rf $(WORK3)
48 rm -rf $(WORK3M)
49 rm -rf $(CURDIR)/debian/tmp/*
50 rm -f debian/files
51 rm -f debian/substvars
52 dh_clean
53
54 override_dh_installchangelogs:
55 dh_installchangelogs debian/changelog.trivial
56
57 override_dh_auto_build:
58 #Build steps for py2
59 mkdir -p $(WORK)
60 if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
61 scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD) verbose=on prefix=$(WORK) options_file=scons/templates/sid_options.py
62 # extract the relevant .py files
63 cd $(WORK); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
64 cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK)/run-escript2.man
65 mv $(WORK)/bin/run-escript $(WORK)/bin/run-escript2
66 find $(WORK) -name '*.pyc' -print0 | xargs -0 rm -f
67
68 # build_steps for documentation
69 # depends on the py2 build so don't do anything here
70 # which will overwrite changes made in the py2 build
71 mkdir -p $(BUILD)
72 scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD) verbose=on prefix=$(WORK) options_file=scons/templates/sid_options.py docs
73 find $(WORK) -name '*.pyc' -print0 | xargs -0 rm -f
74
75 # Build steps for py2 with MPI
76 mkdir -p $(WORKM)
77 if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
78 scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILDM) cc_optim='-O3 -DOVERLORDPATH=\"/usr/lib/python-escript-mpi/\"' verbose=on prefix=$(WORKM) options_file=scons/templates/sid_mpi_options.py
79 # extract the relevant .py files
80 cd $(WORKM); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
81 cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORKM)/run-escript2-mpi.man
82 ln $(WORKM)/bin/run-escript $(WORKM)/bin/run-escript2-mpi
83 find $(WORKM) -name '*.pyc' -print0| xargs -0 rm -f
84 #rm -rf $(BUILDM)
85
86 # Build steps for py3
87 mkdir -p $(WORK3)
88 if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
89 scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD3) verbose=on prefix=$(WORK3) options_file=scons/templates/sid_py3_options.py
90 # extract the relevant .py files
91 cd $(WORK3); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
92 cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3)/run-escript3.man
93 ln $(WORK3)/bin/run-escript $(WORK3)/bin/run-escript3
94 find $(WORK3) -name '*.pyc' -print0| xargs -0 rm -f
95 #rm -rf $(BUILD3)
96
97 # Build steps for py3 with MPI
98 mkdir -p $(WORK3M)
99 if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
100 scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD3M) cc_optim='-O3 -DOVERLORDPATH=\"/usr/lib/python-escript3-mpi/\"' verbose=on prefix=$(WORK3M) options_file=scons/templates/sid_py3_mpi_options.py
101 # extract the relevant .py files
102 cd $(WORK3M); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
103 cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3M)/run-escript3-mpi.man
104 ln $(WORK3M)/bin/run-escript $(WORK3M)/bin/run-escript3-mpi
105 find $(WORK3M) -name '*.pyc' -print0| xargs -0 rm -f
106 #rm -rf $(BUILD3M)
107
108 # fix paths in each package and
109 # fix some external links in the doc package
110 debian/utils/tweak.sh "$(WORK)" "$(WORKM)" "$(WORK3)" "$(WORK3M)"
111 rm -f scons/templates/*.pyc
112 rm -f site_scons/*.pyc
113 rm -f utest.sh
114
115 override_dh_shlibdeps:
116 # so libraries we just built are checked as well
117 dh_shlibdeps -ppython-escript -Npython3-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc -P$(BDEST) -l$(BDEST)/usr/lib/python-escript/lib
118 dh_shlibdeps -ppython-escript-mpi -Npython3-escript -Npython-escript -Npython3-escript-mpi -Npython-escript-doc -P$(BMDEST) -l$(BMDEST)/usr/lib/python-escript-mpi/lib
119 dh_shlibdeps -ppython3-escript -Npython-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc -P$(B3DEST) -l$(B3DEST)/usr/lib/python3-escript/lib
120 dh_shlibdeps -ppython3-escript-mpi -Npython3-escript -Npython-escript -Npython-escript-mpi -Npython-escript-doc -P$(B3MDEST) -l$(B3MDEST)/usr/lib/python3-escript-mpi/lib
121
122
123 override_dh_python2:
124 dh_python2 -ppython-escript -Npython3-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python-escript/esys
125 dh_python2 -ppython-escript-mpi -Npython3-escript -Npython-escript -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python-escript-mpi/esys
126
127 override_dh_python3:
128 dh_python3 -ppython3-escript -Npython-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python3-escript/esys
129 dh_python3 -ppython3-escript-mpi -Npython3-escript -Npython-escript -Npython-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python3-escript-mpi/esys
130

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26