~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-08-05 20:54:29 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090805205429-pm4pnwew8axraosl
Tags: 1:13.b.1-dfsg-5
* Fixed parentheses in Emacs mode (closes: #536891).
* Removed unnecessary conflicts with erlang-manpages package.
* Added workaround for #475459: disabled threads on sparc architecture.
  This breaks wxErlang, so it's only a temporary solution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
2
 
3
 
# Please don't mind too much about BUILD_DIR,
4
 
# it was originally from an experiment that I did
5
 
# not keep in the package.  F-D
6
 
 
7
3
#export DH_VERBOSE=1
8
4
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
9
5
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10
6
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
7
export QUILT_PATCHES := debian/patches
 
8
 
12
9
ROOT_DIR=$(shell pwd)
13
 
BUILD_DIR=$(ROOT_DIR)
14
10
 
15
11
export HOME := $(ROOT_DIR)/debian
16
12
 
17
 
-include ${BUILD_DIR}/erts/vsn.mk
18
 
-include ${BUILD_DIR}/lib/erl_interface/vsn.mk
19
 
-include ${BUILD_DIR}/lib/ic/vsn.mk
20
 
-include ${BUILD_DIR}/lib/tools/vsn.mk
21
 
-include ${BUILD_DIR}/lib/webtool/vsn.mk
 
13
-include ${ROOT_DIR}/erts/vsn.mk
 
14
-include ${ROOT_DIR}/lib/erl_interface/vsn.mk
 
15
-include ${ROOT_DIR}/lib/ic/vsn.mk
 
16
-include ${ROOT_DIR}/lib/tools/vsn.mk
 
17
-include ${ROOT_DIR}/lib/webtool/vsn.mk
22
18
SOURCE_VERSION=$(shell dpkg-parsechangelog | sed -ne's!^Version: \(.*\)-.*!\1!p')
23
19
ABI_VERSION=$(shell cat debian/control | sed -ne's!^Provides: erlang-abi-\(.*\)!\1!p' | head -1)
24
20
HIPE_ARCHES=$(shell cat debian/control | grep '^Architecture:' | egrep -v '(all|any)' | sed -e 's/^Architecture: *//')
25
21
 
 
22
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
 
23
BUILD_HIPE := no
 
24
else
26
25
BUILD_HIPE := $(shell echo ' $(HIPE_ARCHES) ' | grep -c ' ${DEB_HOST_ARCH} ' | sed -es/1/yes/ -es/0/no/)
 
26
endif
27
27
ifeq ($(BUILD_HIPE), no)
28
28
BINARY_TARGETS=binary-erlang-base
29
29
INSTALL_RULE=install-stnd-stamp
50
50
CLOCK_GETTIME_OPT=--enable-clock-gettime
51
51
endif
52
52
 
 
53
# Temporary (until #475459 is fixed) disabling threads for sparc architecture
 
54
ifeq ($(DEB_HOST_ARCH), sparc)
 
55
THREAD_OPTS=--disable-threads --disable-smp-support
 
56
else
 
57
THREAD_OPTS=--enable-threads --enable-smp-support
 
58
endif
 
59
 
53
60
LIBSCTP=libsctp1
54
61
 
55
 
CFLAGS=-g -O2 -fno-strict-aliasing
56
 
GEN_OPT_FLGS=-O2 -fno-strict-aliasing
 
62
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
 
63
CFLAGS=-g -O2 -fno-strict-aliasing
 
64
GEN_OPT_FLGS=-O2 -fno-strict-aliasing
 
65
TYPE=debug
 
66
else
 
67
CFLAGS=-g -O2 -fno-strict-aliasing
 
68
GEN_OPT_FLGS=-O2 -fno-strict-aliasing
 
69
TYPE=
 
70
endif
57
71
 
58
72
unpatch: patch-stamp
59
73
        dh_testdir
76
90
        dh_testdir
77
91
        dh_testroot
78
92
 
79
 
        (cd ${BUILD_DIR} && [ ! -f Makefile ] || ${MAKE} clean)
 
93
        [ ! -f Makefile ] || ${MAKE} clean
80
94
        rm -f lib/dialyzer/SKIP
81
95
 
82
96
        # Remove installed erlang from debian/
84
98
        rm -rf debian/erlang-hipe
85
99
 
86
100
        # Restore replaced configure, config.guess, and config.sub files
87
 
        for i in `find ${BUILD_DIR} -name 'configure.backup'` ; do \
 
101
        for i in `find ${ROOT_DIR} -name 'configure.backup'` ; do \
88
102
            mv $$i $${i%%.backup} ; \
89
103
        done
90
 
        for i in `find ${BUILD_DIR} -name 'config.guess~'` ; do \
 
104
        for i in `find ${ROOT_DIR} -name 'config.guess~'` ; do \
91
105
            mv $$i $${i%%\~} ; \
92
106
        done
93
 
        for i in `find ${BUILD_DIR} -name 'config.sub~'` ; do \
 
107
        for i in `find ${ROOT_DIR} -name 'config.sub~'` ; do \
94
108
            mv $$i $${i%%\~} ; \
95
109
        done
96
110
 
102
116
        # *.install were also generated on-the-fly
103
117
        rm -f debian/*.install
104
118
 
105
 
        rm -f debian/AUTHORS debian/erlang-depends.1
 
119
        rm -f debian/AUTHORS
106
120
 
107
121
        # Don't remove patch-stamp
108
122
        rm -f [^p]*-stamp
130
144
        fi
131
145
 
132
146
        # Preserve configure scripts
133
 
        for i in `find ${BUILD_DIR} -not \( -wholename '*/.pc' -prune \) \
 
147
        for i in `find ${ROOT_DIR} -not \( -wholename '*/.pc' -prune \) \
134
148
                                    -a -name 'configure'` ; do \
135
149
            cp -f $$i $$i.backup ; \
136
150
        done
138
152
        # Replace config.guess and config.sub by installed in /usr/share/misc.
139
153
        # Also add suffix -gnu to ibm-linux in config.guess to fix FTBFS
140
154
        # on s390 architecture
141
 
        for i in `find ${BUILD_DIR} -not \( -wholename '*/.pc' -prune \) \
 
155
        for i in `find ${ROOT_DIR} -not \( -wholename '*/.pc' -prune \) \
142
156
                                    -a -name 'config.guess'` ; do \
143
157
            cp -fb /usr/share/misc/config.guess $$i ; \
144
158
            sed -i 's/-ibm-linux$$/-ibm-linux-gnu/g' $$i ; \
145
159
        done
146
 
        for i in `find ${BUILD_DIR} -not \( -wholename '*/.pc' -prune \) \
 
160
        for i in `find ${ROOT_DIR} -not \( -wholename '*/.pc' -prune \) \
147
161
                                    -a -name 'config.sub'` ; do \
148
162
            cp -fb /usr/share/misc/config.sub $$i ; \
149
163
        done
150
164
 
151
165
        # Regenerate configure scripts using autoconf
152
 
        for i in `find ${BUILD_DIR} -not \( -wholename '*/.pc' -prune \) \
 
166
        for i in `find ${ROOT_DIR} -not \( -wholename '*/.pc' -prune \) \
153
167
                                    -a -name 'configure.in' -printf "%h\n"`; do \
154
168
            echo "autoconf'ing $${i}"; \
155
169
            (cd $${i} && autoconf) \
165
179
        [ ! -f Makefile ] || ${MAKE} clean
166
180
        rm -f lib/dialyzer/SKIP
167
181
 
168
 
        (cd ${BUILD_DIR} && \
169
182
        CFLAGS="$(CFLAGS)" \
170
183
        ./configure --host=$(DEB_HOST_GNU_TYPE) \
171
184
                    --build=$(DEB_BUILD_GNU_TYPE) \
173
186
                    --libexecdir=/usr/bin \
174
187
                    --infodir=/usr/share/info \
175
188
                    --mandir=/usr/share/man \
176
 
                    --enable-smp-support \
177
189
                    --enable-hybrid-heap \
178
 
                    --enable-threads \
 
190
                    $(THREAD_OPTS) \
179
191
                    --enable-hipe \
180
192
                    $(KERNEL_POLL_OPT) \
181
193
                    --enable-sctp \
182
194
                    $(CLOCK_GETTIME_OPT) \
183
195
                    --enable-dynamic-ssl-lib \
184
 
                    --without-ssl-zlib)
 
196
                    --without-ssl-zlib
185
197
 
186
198
        touch configure-hipe-stamp
187
199
 
194
206
        [ ! -f Makefile ] || ${MAKE} clean
195
207
        rm -f lib/dialyzer/SKIP
196
208
 
197
 
        (cd ${BUILD_DIR} && \
198
209
        CFLAGS="$(CFLAGS)" \
199
210
        ./configure --host=$(DEB_HOST_GNU_TYPE) \
200
211
                    --build=$(DEB_BUILD_GNU_TYPE) \
202
213
                    --libexecdir=/usr/bin \
203
214
                    --infodir=/usr/share/info \
204
215
                    --mandir=/usr/share/man \
205
 
                    --enable-smp-support \
206
216
                    --enable-hybrid-heap \
207
 
                    --enable-threads \
 
217
                    $(THREAD_OPTS) \
208
218
                    --disable-hipe \
209
219
                    $(KERNEL_POLL_OPT) \
210
220
                    --enable-sctp \
211
221
                    $(CLOCK_GETTIME_OPT) \
212
222
                    --enable-dynamic-ssl-lib \
213
 
                    --without-ssl-zlib)
 
223
                    --without-ssl-zlib
214
224
 
215
225
        touch configure-stnd-stamp
216
226
 
218
228
        echo "*** do-install called for $(INSTALL_DIR)."
219
229
 
220
230
# Calls make install.
221
 
         (cd $(BUILD_DIR) && \
222
 
         ${MAKE} INSTALL_PREFIX=$(INSTALL_DIR) install)
 
231
         ${MAKE} INSTALL_PREFIX=$(INSTALL_DIR) TYPE=$(TYPE) install
223
232
 
224
233
# Replace ROOTDIR in "erl" and "start" scripts for real rootdir
225
234
# If there's no erl or start then it's better to fail than silently continue
275
284
build-hipe: build-hipe-stamp
276
285
build-hipe-stamp: configure-hipe-stamp
277
286
        dh_testdir
278
 
        (cd ${BUILD_DIR} && ${MAKE} GEN_OPT_FLGS="$(GEN_OPT_FLGS)" CC_R_FLAG= LD_R_FLAG= CC_R_OPT=)
279
287
        touch build-hipe-stamp
 
288
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
 
289
        ${MAKE} TYPE=$(TYPE) FLAVOR=smp GEN_OPT_FLGS="$(GEN_OPT_FLGS)" emulator
 
290
        ${MAKE} TYPE=$(TYPE) FLAVOR=plain GEN_OPT_FLGS="$(GEN_OPT_FLGS)" emulator
 
291
endif
 
292
        ${MAKE} TYPE=$(TYPE) GEN_OPT_FLGS="$(GEN_OPT_FLGS)" CC_R_FLAG= LD_R_FLAG= CC_R_OPT=
280
293
 
281
294
build-stnd: build-stnd-stamp
282
295
build-stnd-stamp: configure-stnd-stamp
283
296
        dh_testdir
284
 
        (cd ${BUILD_DIR} && ${MAKE} GEN_OPT_FLGS="$(GEN_OPT_FLGS)" CC_R_FLAG= LD_R_FLAG= CC_R_OPT=)
 
297
ifeq ($(findstring debug,$(DEB_BUILD_OPTIONS)),debug)
 
298
        ${MAKE} TYPE=$(TYPE) FLAVOR=smp GEN_OPT_FLGS="$(GEN_OPT_FLGS)" emulator
 
299
        ${MAKE} TYPE=$(TYPE) FLAVOR=plain GEN_OPT_FLGS="$(GEN_OPT_FLGS)" emulator
 
300
endif
 
301
        ${MAKE} TYPE=$(TYPE) GEN_OPT_FLGS="$(GEN_OPT_FLGS)" CC_R_FLAG= LD_R_FLAG= CC_R_OPT=
285
302
        touch build-stnd-stamp
286
303
 
287
304
install-hipe: install-hipe-stamp
306
323
build-stamp: $(INSTALL_RULE)
307
324
        dh_testdir
308
325
        #
309
 
        sh debian/analyse.sh $(TMPINSTALL_DIR)
310
326
        for i in debian/*.in ; do \
311
327
            sed -e's/@VERSION@/$(VSN)/g' \
312
328
                -e's/@SOURCE_VERSION@/$(SOURCE_VERSION)/g' \
317
333
                -e's/@WEBTOOL_VSN@/$(WEBTOOL_VSN)/g' \
318
334
                -e's/@TOOLS_VSN@/$(TOOLS_VSN)/g' <$$i >$${i%%.in} ; \
319
335
        done
320
 
        pod2man -c 'Erlang packages for Debian GNU/Linux' \
321
 
                debian/erlang-depends >debian/erlang-depends.1
 
336
        sh debian/analyse.sh $(TMPINSTALL_DIR)
322
337
        #
323
338
        # Add all author lists to debian/AUTHORS
324
339
        f=1 ; \
325
 
        for i in `find $(BUILD_DIR) -name AUTHORS | sort` ; do \
 
340
        for i in `find $(ROOT_DIR) -name AUTHORS | sort` ; do \
326
341
            echo $$i ; \
327
342
            if [ $$f = 1 ] ; then \
328
343
                f=0 ; \
470
485
 
471
486
binary: binary-indep binary-arch
472
487
 
473
 
REL=R13B
474
 
DEB_REL=13.b-dfsg1
 
488
REL=R13B01
 
489
DEB_REL=13.b.1-dfsg
475
490
 
476
491
get-orig-source:
477
492
        CURDIR=`pwd` && TMPDIR=`mktemp -d /tmp/erlang.XXXXXX` && \