From 2b0889c92e8afa66f08391a7c2c9bacf666a3886 Mon Sep 17 00:00:00 2001
From: Aron Xu <aron@debian.org>
Date: Tue, 27 Aug 2013 01:48:45 +0800
Subject: [PATCH] Allow parallel building

---
 debian/rules |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index d53e7ee..25f410b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,6 +17,10 @@ CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
 CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
 LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
 
+ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+	NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+endif
+
 clean:
 	dh_testdir
 	dh_testroot
@@ -49,7 +53,7 @@ build-indep: build-stamp
 
 build-stamp: config.status
 	dh_testdir
-	$(MAKE)
+	$(MAKE) $(NJOBS)
 	touch $@
 
 install: build
-- 
1.7.10.4

