Enable parallel building, including specifying the number of threads for the foomatic compilation.
Didier Raboud
12 years ago
1 | 1 | |
2 | 2 | derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no") |
3 | 3 | |
4 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
5 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
6 | else | |
7 | # Faster when testing on modern desktops, 1 task takes less than a full CPU | |
8 | NUMJOBS = 4 | |
9 | endif | |
10 | ||
4 | 11 | %: |
5 | dh $@ --with autoreconf --with pyppd | |
12 | dh $@ --with autoreconf --with pyppd --parallel | |
6 | 13 | |
7 | 14 | override_dh_auto_clean: |
8 | 15 | dh_auto_clean |
19 | 26 | cp -r $(CURDIR)/debian/ptouch-driver/usr/share/foomatic/* $(CURDIR)/foomatic-db/ |
20 | 27 | rm -rf $(CURDIR)/debian/ptouch-driver/usr/share/foomatic |
21 | 28 | mkdir -p $(CURDIR)/debian/ptouch-driver/usr/share/ppd |
22 | FOOMATICDB=$(CURDIR)/foomatic-db foomatic-compiledb -j 16 -t ppd -d $(CURDIR)/debian/ptouch-driver/usr/share/ppd/ptouch-driver `ls -1 $(CURDIR)/foomatic-db/db/source/driver/*ptouch*.xml | perl -p -e 's:^.*db/source/driver/(\S*)\.xml\s*$$:\1\n:'` | |
29 | FOOMATICDB=$(CURDIR)/foomatic-db foomatic-compiledb -j $(NUMJOBS) -t ppd -d $(CURDIR)/debian/ptouch-driver/usr/share/ppd/ptouch-driver `ls -1 $(CURDIR)/foomatic-db/db/source/driver/*ptouch*.xml | perl -p -e 's:^.*db/source/driver/(\S*)\.xml\s*$$:\1\n:'` | |
23 | 30 | |
24 | 31 | # Install the ppd updater data file so that CUPS can update the |
25 | 32 | # PPDs of the already existing queues after each update of the |