Colin Watson wrote:
> --- a/debian/rules
> +++ b/debian/rules
> @@ -80,6 +80,13 @@ install: check
>
> cd build-tree && $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install
>
> +ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
> + # Ubuntu's "i386" architecture is built for i686 (the Debian default
> + # is i486).
> + sed -ri 's/^(i386[[:space:]]+)[^[:space:]]+/\1i686/' \
> + $(CURDIR)/debian/tmp/usr/share/dpkg/cputable
> +endif
> +
> # Put together the dpkg and dselect packages
> binary-arch: install
> dh_testdir -a
All current uses of "$(shell" come after a "?=", which is presumably
good for bootstrapping a dpkg-less platform. In this case, it's
harmless --- if dpkg-vendor is missing, the only bad effect would be a
"command not found".
Maybe we can keep debian/rules clean by making this hack available to
other distros, too. :) Would something along these lines make sense?
I'm not sure --- I was considering using a ./configure flag that can
be overridden in the Makefile but then the patch seemed to be growing
too much...
Anyway, thanks for brining a single shared source package closer to
reality.
---
diff --git a/Makefile.am b/Makefile.am
index f1561ef..e142772 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,11 @@ ACLOCAL_AMFLAGS = -I m4
dist_pkgdata_DATA = cputable ostable triplettable
+install-data-hook:
+ ! test "$${I386_ARCH:+set}" || \
+ sed -i -e "^i386 s/i[^3]86/$${I386_ARCH}/" \
+ $(DESTDIR)$(pkgdatadir)/cputable; \
+
EXTRA_DIST = \
.mailmap \
ChangeLog.old \
diff --git a/debian/rules b/debian/rules
index b4b70b8..feb7a01 100755
--- a/debian/rules
+++ b/debian/rules
@@ -78,7 +78,12 @@ install: check
dh_clean -k
dh_installdirs
- cd build-tree && $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install
+ cd build-tree && \
+ if dpkg-vendor --derives-from Ubuntu 2>/dev/null; then \
+ $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" I386_ARCH=i686 install; \
+ else \
+ $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install; \
+ fi
# Put together the dpkg and dselect packages
binary-arch: install
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]