4 include /usr
/share
/dpkg
/pkg-info.mk
5 include /usr
/share
/dpkg
/vendor.mk
6 include /usr
/share
/dpkg
/architecture.mk
7 SED_VERSION_SHORT
:= sed
-re
's/([^.]+)\.([^.]+)\..*/\1.\2/'
8 RUST_VERSION
:= $(shell echo
'$(DEB_VERSION_UPSTREAM)' |
$(SED_VERSION_SHORT
))
9 RUST_LONG_VERSION
:= $(shell echo
'$(DEB_VERSION_UPSTREAM)' | sed
-re
's/([^+]+).*/\1/')
10 LIBSTD_PKG
:= libstd-rust-
$(RUST_VERSION
)
11 # Sed expression that matches the "rustc" we have in our Build-Depends field
12 SED_RUSTC_BUILDDEP
:= sed
-ne
"/^Build-Depends:/,/^[^[:space:]\#]/{/^ *rustc:native .*,/p}" debian
/control
13 # Version of /usr/bin/rustc
14 LOCAL_RUST_VERSION
:= $(shell rustc
--version
--verbose | sed
-ne
's/^release: //p')
16 include /usr
/share
/dpkg
/buildflags.mk
17 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
18 export CARGO_HOME
= $(CURDIR
)/debian
/cargo
20 # Defines DEB_*_RUST_TYPE triples
21 include debian
/architecture.mk
22 export DEB_HOST_RUST_TYPE
24 # Uncomment this to turn on verbose mode.
27 DEB_DESTDIR
:= $(CURDIR
)/debian
/tmp
29 # Use system LLVM (comment out to use vendored LLVM)
32 # Make it easier to test against a custom LLVM
33 ifneq (,$(LLVM_DESTDIR
))
34 LLVM_LIBRARY_PATH
:= $(LLVM_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
):$(LLVM_DESTDIR
)/usr
/lib
35 LD_LIBRARY_PATH
:= $(if
$(LD_LIBRARY_PATH
),$(LD_LIBRARY_PATH
):$(LLVM_LIBRARY_PATH
),$(LLVM_LIBRARY_PATH
))
36 export LD_LIBRARY_PATH
39 RUSTBUILD
= RUST_BACKTRACE
=1 python3 src
/bootstrap
/bootstrap.py
40 RUSTBUILD_FLAGS
= --stage
2 --config debian
/config.toml
-vvv
--on-fail env
41 RUSTBUILD_TEST
= $(RUSTBUILD
) test --no-fail-fast
42 # To run a specific test, run something like:
43 # $ debian/rules override_dh_auto_test-arch \
44 # RUSTBUILD_TEST_FLAGS="src/test/run-make --test-args extern-fn-struct"
45 # See src/bootstrap/README.md for more options.
46 RUSTBUILD_TEST_FLAGS
=
49 oldver
=$(shell $(SED_RUSTC_BUILDDEP
) | sed
-ne
's/.*(<= \(.*\)).*/\1/gp' |
$(SED_VERSION_SHORT
)); \
50 newver
=$(RUST_VERSION
); \
51 debian
/update-version.sh
$$oldver $$newver $(RUST_LONG_VERSION
) $(CARGO_NEW
)
53 # Below we detect how we're supposed to bootstrap the stage0 compiler. See
54 # README.Debian for more details of the cases described below.
56 PRECONFIGURE_CHECK
= :
57 HAVE_BINARY_TARBALL
:= $(shell ls
-1 stage0
/*/*$(DEB_HOST_RUST_TYPE
)* 2>/dev
/null | wc
-l
)
58 DOWNLOAD_BOOTSTRAP
:= false
59 # allow not using the binary tarball although it exists
60 #ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386 powerpc ppc64el s390x))
61 # HAVE_BINARY_TARBALL := 0
63 ifeq (0,$(HAVE_BINARY_TARBALL
))
64 # Case A (Building from source): the extracted source tree does not include
65 # a bootstrapping tarball for the current architecture e.g. because the
66 # distro already has a rustc for this arch, or the uploader expects that
67 # this requirement be fulfilled in some other way.
69 # Case A-1: the builder did not select the "pkg.rustc.dlstage0" build profile.
70 # In this case, we use the distro's rustc - either the previous or current version.
71 ifeq (,$(findstring pkg.rustc.dlstage0
,$(DEB_BUILD_PROFILES
)))
72 # Make it easier to test against a custom rustc
73 ifneq (,$(RUST_DESTDIR
))
74 RUST_LIBRARY_PATH
:= $(RUST_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
):$(RUST_DESTDIR
)/usr
/lib
75 LD_LIBRARY_PATH
:= $(if
$(LD_LIBRARY_PATH
),$(LD_LIBRARY_PATH
):$(RUST_LIBRARY_PATH
),$(RUST_LIBRARY_PATH
))
76 export LD_LIBRARY_PATH
79 # Case A-2: the builder selected the "dlstage0" build profile.
80 # In this case, the rust build scripts will download a stage0 into stage0/ and use that.
81 # We don't need to do anything specific in this build file, so this case is empty.
83 DOWNLOAD_BOOTSTRAP
:= true
86 # Case B (Bootstrapping a new distro): the extracted source tree does
87 # include a bootstrapping tarball for the current architecture; see the
88 # `source_orig-stage0` target below on how to build this.
90 # In this case, we'll bootstrap from the stage0 given in that tarball.
91 # To ensure the uploader of the .dsc didn't make a mistake, we first check
92 # that rustc isn't a Build-Depends for the current architecture.
93 ifneq (,$(shell $(SED_RUSTC_BUILDDEP
)))
94 ifeq (,$(shell $(SED_RUSTC_BUILDDEP
) | grep
'!$(DEB_HOST_ARCH)'))
95 PRECONFIGURE_CHECK
= $(error found matches for stage0
/*/*$(DEB_HOST_RUST_TYPE
)*, \
96 but rustc might be a Build-Depends for
$(DEB_HOST_ARCH
))
102 ifneq (,$(findstring nodoc
,$(DEB_BUILD_PROFILES
)))
105 ifneq (,$(findstring nodoc
,$(DEB_BUILD_OPTIONS
)))
110 ifneq (,$(findstring nowasm
,$(DEB_BUILD_PROFILES
)))
114 WINDOWS_SUPPORT
:= amd64 i386
115 BUILD_WINDOWS
:= true
116 ifneq (,$(findstring nowindows
,$(DEB_BUILD_PROFILES
)))
117 BUILD_WINDOWS
:= false
119 ifeq (,$(filter $(DEB_HOST_ARCH
), $(WINDOWS_SUPPORT
)))
120 BUILD_WINDOWS
:= false
122 ifeq (,$(filter $(DEB_BUILD_ARCH
), $(WINDOWS_SUPPORT
)))
123 ifeq (true
,$(BUILD_WINDOWS
))
124 $(error cannot cross-compile from
$(DEB_BUILD_ARCH
) to
$(DEB_HOST_ARCH
), unless
"nowindows" is in DEB_BUILD_PROFILES
)
127 ifeq (i386
,$(DEB_HOST_ARCH
))
130 WINDOWS_ARCH
:= x86_64
134 MAKE_OPTIMISATIONS
:= true
135 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
136 MAKE_OPTIMISATIONS
:= false
139 # Build products or non-source files in src/, that shouldn't go in rust-src
140 SRC_CLEAN
= src
/bootstrap
/bootstrap.pyc \
143 # Try to work around #933045
144 ifneq (,$(filter $(DEB_BUILD_ARCH
), mips mipsel
))
145 SYSTEM_WORKAROUNDS
+= export MALLOC_ARENA_MAX
=1;
149 $(SYSTEM_WORKAROUNDS
) dh
$@
--parallel
153 @echo host
=$(DEB_BUILD_ARCH
) target
=$(DEB_HOST_ARCH
) BUILD_WINDOWS
=$(BUILD_WINDOWS
) WINDOWS_ARCH
=$(WINDOWS_ARCH
)
157 $(SYSTEM_WORKAROUNDS
) dh
$@
--parallel
160 # Upstream contains a lot of these
161 dh_clean
-XCargo.toml.orig
163 debian
/config.toml
: debian
/config.toml.in debian
/rules
164 u
="$(DEB_VERSION_UPSTREAM)"; \
165 if
[ "$$u" != "$${u%~beta.*+dfsg*}" ]; then channel
="beta"; \
166 else channel
="stable"; fi
; echo
$$channel; \
167 m4
-DRELEASE_CHANNEL
="$$channel" \
168 -DDEB_BUILD_RUST_TYPE
="$(DEB_BUILD_RUST_TYPE)" \
169 -DDEB_HOST_RUST_TYPE
="$(DEB_HOST_RUST_TYPE)" \
170 -DDEB_TARGET_RUST_TYPE
="$(DEB_TARGET_RUST_TYPE)" \
171 -DDEB_BUILD_GNU_TYPE
="$(DEB_BUILD_GNU_TYPE)" \
172 -DDEB_HOST_GNU_TYPE
="$(DEB_HOST_GNU_TYPE)" \
173 -DDEB_TARGET_GNU_TYPE
="$(DEB_TARGET_GNU_TYPE)" \
174 -DMAKE_OPTIMISATIONS
="$(MAKE_OPTIMISATIONS)" \
175 -DLLVM_DESTDIR
="$(LLVM_DESTDIR)" \
176 -DLLVM_VERSION
="$(LLVM_VERSION)" \
177 -DRUST_DESTDIR
="$(RUST_DESTDIR)" \
179 if
$(DOWNLOAD_BOOTSTRAP
) ||
[ $(HAVE_BINARY_TARBALL
) != 0 ]; \
180 then sed
-i
-e
'/^rustc = /d' -e
'/^cargo = /d' "$@"; fi
181 # Work around low-memory (32-bit) architectures: https://github.com/rust-lang/rust/issues/45854
182 ifneq (,$(filter $(DEB_BUILD_ARCH
), armhf armel mips mipsel powerpc powerpcspe
))
183 sed
-i
-e
's/^debuginfo-level = .*/debuginfo-level = 0/g' "$@"
186 debian
/rust-src.
%: debian
/rust-src.
%.in
187 m4
-DRUST_LONG_VERSION
="$(RUST_LONG_VERSION)" \
190 debian
/dh_auto_configure.stamp
: debian
/config.toml
191 # fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog
192 ! grep
--color
=always
-i
'\(clang\|ll\(..\|d\)\)-\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude
=changelog
--exclude
=copyright
--exclude
='*.patch' --exclude-dir
='.debhelper' -R debian
193 # fail the build if we accidentally vendored openssl, indicates we pulled in unnecessary dependencies
194 test ! -e vendor
/openssl
195 # fail the build if our version contains ~exp and we are not releasing to experimental
196 v
="$(DEB_VERSION)"; test "$$v" = "$${v%~exp*}" -o
"$(DEB_DISTRIBUTION)" = "experimental" -o
"$(DEB_DISTRIBUTION)" = "UNRELEASED"
197 $(PRECONFIGURE_CHECK
)
198 if
[ -d stage0
]; then mkdir
-p build
&& ln
-sfT ..
/stage0 build
/cache
; fi
199 # work around #842634
200 if
test $$(grep
"127.0.0.1\s*localhost" /etc
/hosts | wc
-l
) -gt
1; then \
201 debian
/ensure-patch
-N debian
/patches
/d-host-duplicates.patch
; fi
203 sed
-i
-e
's/dev: 1/#dev: 1/g' src
/stage0.txt
204 # don't care about lock changes
206 # We patched some crates so have to rm the checksums
207 find vendor
-name .cargo-checksum.json
-execdir
"$(CURDIR)/debian/prune-checksums" "{}" +
208 # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16
209 echo
'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > vendor
/lzma-sys
/build.rs
210 # We don't run ./configure because we use debian/config.toml directly
211 ln
-sf debian
/config.toml config.toml
214 override_dh_auto_configure-arch
: debian
/dh_auto_configure.stamp
215 override_dh_auto_configure-indep
: debian
/dh_auto_configure.stamp
216 ifeq (true
,$(BUILD_DOCS
))
217 # Change config.toml now and not later, since that might trigger a rebuild
218 sed
-i
-e
's/^docs = false/docs = true/' debian
/config.toml
221 override_dh_auto_clean
:
222 $(RM
) -rf build tmp .cargo debian
/cargo_home config.stamp config.mk Makefile
223 $(RM
) -rf
$(TEST_LOG
) debian
/config.toml debian
/rust-src.
install debian
/rust-src.links debian
/*.stamp
224 $(RM
) -rf
$(SRC_CLEAN
) config.toml
226 debian
/dh_auto_build.stamp
:
227 $(RUSTBUILD
) build
$(RUSTBUILD_FLAGS
)
229 override_dh_auto_build-arch
: debian
/dh_auto_build.stamp
230 ifeq (true
,$(BUILD_WINDOWS
))
231 $(RUSTBUILD
) build
$(RUSTBUILD_FLAGS
) \
232 --host
$(DEB_BUILD_RUST_TYPE
) \
233 --target
$(WINDOWS_ARCH
)-pc-windows-gnu \
237 override_dh_auto_build-indep
: debian
/dh_auto_build.stamp
238 ifeq (true
,$(BUILD_WASM
))
239 $(RUSTBUILD
) build
$(RUSTBUILD_FLAGS
) \
240 --host
$(DEB_BUILD_RUST_TYPE
) \
241 --target wasm32-unknown-unknown
,wasm32-wasi \
244 ifeq (true
,$(BUILD_DOCS
))
245 $(RUSTBUILD
) doc
$(RUSTBUILD_FLAGS
)
248 TEST_LOG
= debian
/rustc-tests.log
249 # This is advertised as "5 tests failed" in README.Debian because our counting
250 # method is imprecise and in practise we count some failures twice.
252 ifneq (,$(filter $(DEB_BUILD_ARCH
), ppc64 arm64 mips64el i386
))
253 FAILURES_ALLOWED
= 12
255 ifneq (,$(filter $(DEB_BUILD_ARCH
), mips mipsel s390x powerpc
))
256 FAILURES_ALLOWED
= 24
258 ifneq (,$(filter $(DEB_BUILD_ARCH
), powerpcspe riscv64 sparc64 x32
))
259 FAILURES_ALLOWED
= 180
261 FAILED_TESTS
= grep
"FAILED\|^command did not execute successfully" $(TEST_LOG
) | grep
-v
'^test result: FAILED' | grep
-v
'FAILED (allowed)'
262 override_dh_auto_test-arch
:
263 # ensure that rustc_llvm is actually dynamically linked to libLLVM
264 set
-e
; find build
/*/stage2
/lib
/rustlib
/* -name
'*rustc_llvm*.so' | \
266 stat
-c
'%s %n' "$$x"; \
267 objdump
-p
"$$x" | grep
-q
"NEEDED.*LLVM"; \
268 test "$$(stat -c %s "$$x")" -lt
6000000; \
270 ifeq (, $(filter nocheck
,$(DEB_BUILD_PROFILES
)))
271 ifeq (, $(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
272 { $(RUSTBUILD_TEST
) $(RUSTBUILD_FLAGS
) $(RUSTBUILD_TEST_FLAGS
); echo
$$?
; } | tee
-a
$(TEST_LOG
)
273 # test that the log has at least 1 pass, to prevent e.g. #57709
274 grep
-l
"^test .* \.\.\. ok$$" $(TEST_LOG
)
275 echo
"==== Debian rustc test report ===="; \
276 echo
"Specific test failures:"; \
278 num_failures
=$$($(FAILED_TESTS
) | wc
-l
); \
279 exit_code
=$$(tail
-n1
$(TEST_LOG
)); \
280 echo
"Summary: exit code $$exit_code, counted $$num_failures tests failed."; \
281 echo
-n
"$(FAILURES_ALLOWED) maximum allowed. "; \
282 if
test "$$num_failures" -eq
0 -a
"$$exit_code" -ne
0; then \
283 echo
"Aborting just in case, because we missed counting some test failures."; \
284 echo
"This could happen if we failed to build the tests, or if the testsuite runner is buggy."; \
286 elif
test "$$num_failures" -le
$(FAILURES_ALLOWED
); then \
287 echo
"Continuing..."; \
289 echo
"Aborting the build."; \
290 echo
"Check the logs further above for details."; \
293 # don't continue if RUSTBUILD_TEST_FLAGS is non-empty
294 test -z
"$(RUSTBUILD_TEST_FLAGS)"
295 # don't run windows tests yet
299 override_dh_auto_test-indep
:
300 ifeq (, $(filter nocheck
,$(DEB_BUILD_PROFILES
)))
301 ifeq (, $(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
302 ifeq (true
,$(BUILD_WASM
))
303 # Ignore failures in these tests, but run them so we see what it's like
304 -PATH
=$(CURDIR
)/debian
/bin
:$(PATH
) $(RUSTBUILD_TEST
) $(RUSTBUILD_FLAGS
) $(RUSTBUILD_TEST_FLAGS
) \
305 --host
$(DEB_BUILD_RUST_TYPE
) \
306 --target wasm32-unknown-unknown
,wasm32-wasi \
309 ifeq (true
,$(BUILD_DOCS
))
310 # Run all rules that test the docs, i.e. that depend on default:doc
311 $(RUSTBUILD_TEST
) $(RUSTBUILD_FLAGS
) src
/tools
/linkchecker
313 test -z
"$(RUSTBUILD_TEST_FLAGS)"
318 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) $(X_CMD
) $(RUSTBUILD_FLAGS
) $(X_FLAGS
)
320 debian
/dh_auto_install.stamp
:
321 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) install $(RUSTBUILD_FLAGS
)
323 mkdir
-p
$(DEB_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/
324 mv
$(DEB_DESTDIR
)/usr
/lib
/lib
*.so
$(DEB_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/
326 # Replace duplicated compile-time/run-time dylibs with symlinks
328 for f in
$(DEB_DESTDIR
)/usr
/lib
/rustlib
/$(DEB_HOST_RUST_TYPE
)/lib
/lib
*.so
; do \
330 if
[ -f
"$(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/$$name" ]; then \
331 echo
"ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f"; \
332 ln
-sf ..
/..
/..
/$(DEB_HOST_MULTIARCH
)/$$name $$f; \
338 override_dh_auto_install-arch
: debian
/dh_auto_install.stamp
339 ifeq (true
,$(BUILD_WINDOWS
))
340 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) install $(RUSTBUILD_FLAGS
) \
341 --host
$(DEB_BUILD_RUST_TYPE
) \
342 --target
$(WINDOWS_ARCH
)-pc-windows-gnu \
346 override_dh_auto_install-indep
: debian
/dh_auto_install.stamp
347 ifeq (true
,$(BUILD_WASM
))
348 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) install $(RUSTBUILD_FLAGS
) \
349 --host
$(DEB_BUILD_RUST_TYPE
) \
350 --target wasm32-unknown-unknown
,wasm32-wasi \
353 ifeq (true
,$(BUILD_DOCS
))
354 # Brute force to remove privacy-breach-logo lintian warning.
355 # We could have updated the upstream sources but it would complexify
358 find
$(DEB_DESTDIR
)/usr
/share
/doc
/*/html
-iname
'*.html' | \
359 while read file
; do \
360 topdir
=$$(echo
"$$file" | sed
's,^$(DEB_DESTDIR)/usr/share/doc/rust/html/,,; s,/[^/]*$$,/,; s,^[^/]*$$,,; s,[^/]\+/,../,g'); \
362 -e
"s,https://\(doc\|www\).rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," \
363 -e
's,<img src="https://img.shields.io/[^"]*" alt="\([^"]*\)" />,<span class="deb-privacy-replace--shields-io">\1</span>,g' "$$file"; \
365 find
$(DEB_DESTDIR
) \
( -iname
'*.html' -empty
-o
-name .lock
-o
-name
'*.inc' \
) -delete
;
368 override_dh_install-arch
:
370 dh_install
-p
$(LIBSTD_PKG
) usr
/lib
/$(DEB_HOST_MULTIARCH
)/
371 dh_install
-plibstd-rust-dev usr
/lib
/rustlib
/$(DEB_HOST_RUST_TYPE
)/lib
/
372 ifeq (true
,$(BUILD_WINDOWS
))
373 dh_install
-plibstd-rust-dev-windows usr
/lib
/rustlib
/*-pc-windows-gnu
/lib
/
376 override_dh_install-indep
: debian
/rust-src.
install debian
/rust-src.links
378 ifeq (true
,$(BUILD_WASM
))
379 dh_install
-plibstd-rust-dev-wasm32 usr
/lib
/rustlib
/wasm32-
*/lib
/
381 $(RM
) -rf
$(SRC_CLEAN
:%=debian
/rust-src
/usr
/src
/rustc-
$(RUST_LONG_VERSION
)/%)
382 # Get rid of lintian warnings
383 find debian
/rust-src
/usr
/src
/rustc-
$(RUST_LONG_VERSION
) \
384 \
( -name .gitignore \
385 -o
-name
'LICENSE*' \
388 -o
-name
'COPYING*' \
390 # Remove files that autoload remote resources, caught by lintian
391 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/cssparser
/docs
/*.html
392 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/kuchiki
/docs
/*.html
393 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/url
/docs
/*.html
394 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/xz2
/.gitmodules
396 override_dh_installchangelogs
:
397 dh_installchangelogs RELEASES.md
399 override_dh_installdocs
:
400 dh_installdocs
-X.
tex -X.aux
-X.log
-X.out
-X.toc
403 dh_missing
--list-missing
405 override_dh_compress
:
408 # The below override is disabled on advice from #debian-devel, because:
409 # - only shared libs get the "split dbgsym package" treatment by dh_strip;
410 # static libs simply get their debuginfo discarded
411 # - strip(1) sometimes breaks wasm libs
414 # # Work around #35733, #468333
415 # find debian/libstd-rust-dev*/ -name '*.rlib' -execdir mv '{}' '{}.a' \;
416 # # This is expected to print out lots of "File format unrecognized" warnings about
417 # # rust.metadata.bin and *.deflate but the .o files inside the rlibs should be stripped
418 # # Some files are still omitted because of #875780 however.
420 # find debian/libstd-rust-dev*/ -name '*.rlib.a' -execdir sh -c 'mv "$$1" "$${1%.a}"' - '{}' \;
423 # otherwise rustc gets an empty multifile which lintian errors on, causing
424 # FTP auto-reject. this is a work-around, the lintian bug is #955752
425 dh_dwz
--no-dwz-multifile
427 override_dh_makeshlibs
:
430 # dh_makeshlibs doesn't support our "libfoo-version.so" naming
431 # structure, so we have to do this ourselves.
432 mkdir
-p debian
/$(LIBSTD_PKG
)/DEBIAN
433 LC_ALL
=C ls debian
/$(LIBSTD_PKG
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/lib
*.so | \
434 sed
-n
's,^.*/\(lib.*\)-\(.\+\)\.so$$,\1 \2,p' | \
435 while read name version
; do \
436 echo
"$$name $$version $(LIBSTD_PKG) (>= $(DEB_VERSION_UPSTREAM))"; \
437 done
> debian
/$(LIBSTD_PKG
)/DEBIAN
/shlibs
439 override_dh_shlibdeps
:
440 dh_shlibdeps
-- -x
$(LIBSTD_PKG
)
442 QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
= x
=$$?
; if
[ $$x = 2 ]; then exit
0; else exit
$$x; fi
444 QUILT_PATCHES
=debian
/patches quilt push
-aq
; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
)
445 $(MAKE
) -f debian
/rules
clean
446 debian
/make_orig-stage0_tarball.sh
447 QUILT_PATCHES
=debian
/patches quilt pop
-aq
; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
)
451 u
="$(DEB_VERSION_UPSTREAM)"; \
452 if
[ "$$u" != "$${u%~beta.*+dfsg*}" ]; then \
453 newver
=$(shell echo
$(RUST_VERSION
) | perl
-lpe
's/(\d+)\.(\d+)/$$1 . "." . ($$2)/e'); \
455 newver
=$(shell echo
$(RUST_VERSION
) | perl
-lpe
's/(\d+)\.(\d+)/$$1 . "." . ($$2+1)/e'); \
458 debian
/watch-beta
: debian
/watch-beta.in debian
/rules
459 set
-e
; $(get_beta_version
); \
460 m4
-DOLDVER
="$$oldver" -DNEWVER
="$$newver.0" "$<" > "$@"
462 source_orig-beta
: debian
/watch-beta
463 uscan
$(USCAN_OPTS
) $(if
$(USCAN_DESTDIR
),--destdir
=$(USCAN_DESTDIR
),) --verbose
--watchfile
"$<"
464 set
-e
; $(get_beta_version
); \
465 bd
="$(if $(USCAN_DESTDIR),$(USCAN_DESTDIR),..)"; \
466 tar xf
$$bd/rustc-
$$newver.0-beta
.999-src.
tar.xz rustc-beta-src
/version
; \
467 bv
="$$(sed -re 's/[0-9]+.[0-9]+.[0-9]+-beta.([0-9]+) \(.*\)/\1/g' rustc-beta-src/version)"; \
468 bash
-c
'shopt -s nullglob; for i in '"$$bd"'/rustc*beta.999*; do mv $$i $${i/beta.999/beta.'"$$bv"'}; done'; \
469 rm -f rustc-beta-src
/version
; \
470 rmdir
-p rustc-beta-src
; \
471 echo
"prepared rustc $$newver.0~beta.$$bv in $$bd"