[patch][parted] debian/rules: Enable device-mapper only on Linux
Hello, Otavio.
Please consider applying this patch to Debian parted.
Feel free to change variable name.
I tested this on GNU/kFreeBSD with success.
This could affect GNU/Linux (but it shouldn't).
Cheers,
Luca Favatella
From 50216d2c337a4e02649479058978ff0010d68583 Mon Sep 17 00:00:00 2001
From: Luca Favatella <slackydeb@gmail.com>
Date: Wed, 29 Jul 2009 19:31:53 +0200
Subject: [PATCH] debian/rules: Enable device-mapper only on Linux.
Signed-off-by: Luca Favatella <slackydeb@gmail.com>
---
debian/changelog | 1 +
debian/rules | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d1d975e..eb03481 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ parted (1.8.8.git.2009.07.19-3) UNRELEASED; urgency=low
[ Luca Favatella ]
* control.in: Remove libdevmapper-dev as build-dependency on GNU/kFreeBSD.
+ * debian/rules: Enable device-mapper only on Linux.
-- Otavio Salvador <otavio@ossystems.com.br> Fri, 24 Jul 2009 13:35:48 -0300
diff --git a/debian/rules b/debian/rules
index 5a0b853..76e60ed 100755
--- a/debian/rules
+++ b/debian/rules
@@ -73,6 +73,10 @@ ifeq (, $(DEB_BUILD_ARCH))
DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
endif
+ifeq (, $(DEB_BUILD_ARCH_OS))
+DEB_BUILD_ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
+endif
+
ifeq (, $(DEB_BUILD_GNU_TYPE))
DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
endif
@@ -118,6 +122,13 @@ endif
CFLAGS += -fgnu89-inline
UDEB_CFLAGS += -fgnu89-inline
+# Enable device-mapper only on Linux
+ifeq (linux, $(DEB_BUILD_ARCH_OS))
+ CONFDEVMAPPER = --enable-device-mapper
+else
+ CONFDEVMAPPER = --disable-device-mapper
+endif
+
# This builds a substitution list for sed based on the SUBSTS variable
# and the variables whose names SUBSTS contains ...
SUBSTLIST = $(foreach subst, $(SUBSTS), s/@$(subst)@/$($(subst))/g;)
@@ -169,7 +180,7 @@ endif
--sbindir=/sbin --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --enable-shared \
--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
- --enable-device-mapper \
+ $(CONFDEVMAPPER) \
$(CONFFLAGS)
build-udeb/config.status: patch-stamp
@@ -180,7 +191,7 @@ build-udeb/config.status: patch-stamp
--sbindir=/sbin --libdir=/lib --mandir=\$${prefix}/share/man \
--infodir=\$${prefix}/share/info --enable-shared --disable-static \
--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
- --without-readline --enable-device-mapper \
+ --without-readline $(CONFDEVMAPPER) \
$(CONFFLAGS)
build-dbg/config.status: patch-stamp
@@ -190,7 +201,8 @@ build-dbg/config.status: patch-stamp
# Add here commands to configure the package.
cd build-dbg && CFLAGS="-g $(CFLAGS)" ../configure --prefix=/usr \
--enable-mtrace --disable-shared $(CONFFLAGS) \
- --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+ --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
+ $(CONFDEVMAPPER)
touch $@
--
1.6.3.1
Reply to: