|
|
@@ -10,7 +10,15 @@ TMP_DPKG_DOC := $(TMP)-dpkg-doc
|
|
|
DIR := $(shell pwd)
|
|
|
|
|
|
# We should really get this in a different way...
|
|
|
-arch = $(shell dpkg --print-architecture)
|
|
|
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE 2> /dev/null || true)
|
|
|
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2> /dev/null || true)
|
|
|
+arch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
|
|
+
|
|
|
+ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
|
|
|
+ config_arg := --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
|
|
|
+else
|
|
|
+ config_arg :=
|
|
|
+endif
|
|
|
|
|
|
# Setup the buildlocation
|
|
|
$(BUILD)/config.status:
|
|
|
@@ -24,12 +32,13 @@ $(BUILD)/config.status:
|
|
|
--sysconfdir=/etc \
|
|
|
--sharedstatedir=/var/lib \
|
|
|
--localstatedir=/var/lib \
|
|
|
- --with-admindir=/var/lib/dpkg
|
|
|
+ --with-admindir=/var/lib/dpkg \
|
|
|
+ $(config_arg)
|
|
|
|
|
|
clean:
|
|
|
$(checkdir)
|
|
|
rm -f debian/files debian/substvars
|
|
|
- rm -f debian/dpkg,substvars
|
|
|
+ rm -f debian/dpkg.substvars
|
|
|
rm -fr $(BUILD) $(TMP) $(TMP_DPKG) $(TMP_DPKG_DEV) $(TMP_DPKG_DOC)
|
|
|
rm -f stamp-build stamp-binary
|
|
|
|
|
|
@@ -114,7 +123,8 @@ binary-dpkg: stamp-binary
|
|
|
install -p -m 755 -o root -g root debian/dpkg.postinst $(TMP_DPKG)/DEBIAN/postinst
|
|
|
|
|
|
dpkg-shlibdeps -dPre-Depends -Tdebian/dpkg.substvars \
|
|
|
- $(TMP_DPKG)/usr/bin/dpkg $(TMP_DPKG)/usr/bin/dselect
|
|
|
+ $(TMP_DPKG)/usr/bin/dpkg $(TMP_DPKG)/usr/bin/dselect \
|
|
|
+ $(TMP_DPKG)/sbin/start-stop-daemon
|
|
|
dpkg-gencontrol -Tdebian/dpkg.substvars -pdpkg -P$(TMP_DPKG)
|
|
|
dpkg --build $(TMP_DPKG) ..
|
|
|
|