rpm %{?_smp_flags} macro for dpkg-buildpackage

I've watched openSUSE Conference video and been interested in RPM packaging workshop. Some features are nice, so I'd like to introduce one of those.

He says
Using %{?_smp_flags} can speed up your build a lot.
Above RPM macro enables SMP, use all CPU cores to build package and it looks good. We can easily buy multi core processor machine nowadays even if it is cheapest laptop.

In Debian, we can do parallel build by specifiying DEBBUILDOPT=-"j<job number>" in /etc/pbuilderrc and run pbuilder/cowbuilder, but this %{?_smp_flags} can automatically use multiple cores without any setting, good. However, add %{?_smp_flags} to each rpm spec file, it means that we need to modify each source package, is not handy.

Then back to Debian, I've made a quick hack to dpkg-buildpackage (disclaimer: I'm Perl beginner, you know :).

 - Automatically use all CPU cores to build package, faster build.

 - some package would be FTBFS (e.g. Bug#694726) but it should be fixed, right? ;)

It may break some builds but "enable multiple build by default, and specify single build exceptions to each problematic packages" is better, IMHO.

Any suggestions are welcome, of course.

Popular Posts