[sheepdog] [PATCH v2] debian: speedup 'make deb'

MORITA Kazutaka morita.kazutaka at gmail.com
Tue Aug 13 08:53:27 CEST 2013


At Tue, 13 Aug 2013 14:17:58 +0800,
Liu Yuan wrote:
> 
> On Tue, Aug 13, 2013 at 03:12:49PM +0900, MORITA Kazutaka wrote:
> > At Tue, 13 Aug 2013 13:52:43 +0800,
> > Liu Yuan wrote:
> > > 
> > > Use 'timesize' instead of md5 will speed up the packaging a lot.
> > > And pass "-j" for make.
> > > 
> > > Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> > > ---
> > >  debian/rules |    6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/debian/rules b/debian/rules
> > > index b3ca769..d1b11b5 100755
> > > --- a/debian/rules
> > > +++ b/debian/rules
> > > @@ -14,6 +14,12 @@ GIT_TAG         ?= $(shell echo v'$(VERSION)' | sed -e 's/~/_/')
> > >  override_dh_builddeb:
> > >  	dh_builddeb --destdir=. -- -Zxz -z9
> > >  
> > > +override_dh_autoreconf:
> > > +	dh_autoreconf --mode=timesize
> > > +
> > > +override_dh_auto_build:
> > > +	dh_auto_build -- "-j"
> > > +
> > 
> > I think the correct way is using a parallel parameter in
> > DEB_BUILD_OPTIONS.
> > 
> > See "4.9.1 debian/rules and DEB_BUILD_OPTIONS" in
> > http://www.debian.org/doc/debian-policy/ch-source.html.
> 
> I tried 
> $ DEB_BUILD_OPTIONS="-j" make deb
> and it doesn't work at all. From the documentation, this need makefile to
> interprit the DEB_BUILD_OPTIONS itself. Seems not work with autoconfig.
> 
> I am not familiar with deb package, if we don't pass "-j" manually, can you
> point me to how exactly I can achieve the same effect?

I tried the below patch and could build in parallel with

  $ DEB_BUILD_OPTIONS=parallel=8 make deb  # 8 means the concurrency number

I'm not familiar with a deb package and I'm not quite sure this is the
best way, though.

diff --git a/debian/rules b/debian/rules
index b3ca769..74cc81d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ UPSTREAM_GIT    ?= git://github.com/collie/sheepdog.git
 GIT_TAG         ?= $(shell echo v'$(VERSION)' | sed -e 's/~/_/')
 
 %:
-	dh $@ --with autoreconf
+	dh $@ --with autoreconf --parallel
 
 override_dh_builddeb:
 	dh_builddeb --destdir=. -- -Zxz -z9



More information about the sheepdog mailing list