| 1 |
|
| 2 |
include /usr/share/dpkg/pkg-info.mk |
| 3 |
target != echo $(DEB_SOURCE) | sed s/binutils-// |
| 4 |
binutils_dir=/usr/src/binutils |
| 5 |
|
| 6 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 7 |
export DEB_CFLAGS_MAINT_APPEND=-Wno-error=discarded-qualifiers |
| 8 |
|
| 9 |
deb_upstream_version != dpkg-query -f'$${source:Upstream-Version}' -W binutils-source |
| 10 |
|
| 11 |
|
| 12 |
deb_version = $(deb_upstream_version)+$(DEB_VERSION) |
| 13 |
|
| 14 |
unpacked_dir=binutils |
| 15 |
%: |
| 16 |
mkdir -p $(unpacked_dir) |
| 17 |
dh $@ -D$(unpacked_dir) -Bbuild |
| 18 |
|
| 19 |
execute_before_dh_update_autotools_config: $(unpacked_dir)/binutils |
| 20 |
$(unpacked_dir)/binutils: |
| 21 |
cd $(unpacked_dir) && tar --strip-components=1 -xf $(binutils_dir)/binutils-*.tar.* |
| 22 |
rm -rf $(unpacked_dir)/zlib |
| 23 |
|
| 24 |
override_dh_autoreconf: |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
if ! echo $(DEB_BUILD_OPTIONS) | grep -q terse; \ |
| 30 |
then AUTORECONF_OPTS='-v'; \ |
| 31 |
fi; \ |
| 32 |
AUTORECONF_DIRS=`cd $(unpacked_dir) && find . -name configure.ac -o -name configure.in`; \ |
| 33 |
dh_autoreconf autoreconf2.69 -- -f $$AUTORECONF_OPTS -I `pwd`/$(unpacked_dir)/config $$AUTORECONF_DIRS |
| 34 |
|
| 35 |
override_dh_auto_configure: |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
DH_COMPAT=10 dh_auto_configure -- \ |
| 43 |
--target=$(target) \ |
| 44 |
--with-bugurl="https://www.debian.org/Bugs/" \ |
| 45 |
--libdir=/usr/lib/$(target) \ |
| 46 |
--infodir=/nulldir \ |
| 47 |
--htmldir=/nulldir \ |
| 48 |
--pdfdir=/nulldir \ |
| 49 |
--mandir=/usr/share/man \ |
| 50 |
--with-system-zlib \ |
| 51 |
--with-pkgversion="$(deb_version)" \ |
| 52 |
--enable-deterministic-archives \ |
| 53 |
|
| 54 |
execute_before_dh_installdocs: debian/$(DEB_SOURCE).copyright |
| 55 |
debian/$(DEB_SOURCE).copyright: debian/copyright /usr/share/doc/binutils-source/copyright |
| 56 |
cp debian/copyright $@ |
| 57 |
printf -- "\n-----BEGIN BINUTILS COPYRIGHT INFORMATION-----\n" >> $@ |
| 58 |
cat /usr/share/doc/binutils-source/copyright >> $@ |
| 59 |
printf -- "-----END BINUTILS COPYRIGHT INFORMATION-----\n" >> $@ |
| 60 |
|
| 61 |
BUILT_USING != dpkg-query -f '$${source:Package} (= $${source:Version})' -W binutils-source |
| 62 |
override_dh_gencontrol: |
| 63 |
dh_gencontrol -- -v$(deb_version) -VBuilt-Using="$(BUILT_USING)" |
| 64 |
|
| 65 |
execute_after_dh_auto_install: |
| 66 |
|
| 67 |
cd debian/$(DEB_SOURCE)/usr/$(target)/bin && \ |
| 68 |
for i in *; \ |
| 69 |
do rm "$$i" && \ |
| 70 |
ln -s ../../bin/$(target)-"$$i" "$$i"; \ |
| 71 |
done |
| 72 |
|
| 73 |
rm -rf debian/$(DEB_SOURCE)/usr/share/locale debian/$(DEB_SOURCE)/nulldir |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
override_dh_auto_test: |