diff options
-rw-r--r-- | build/Makefile | 37 | ||||
-rwxr-xr-x | build/build.sh | 23 | ||||
-rwxr-xr-x | build/buildone.sh | 9 | ||||
-rwxr-xr-x | build/buildweb.sh | 23 | ||||
-rwxr-xr-x | build/clear.sh | 12 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rwxr-xr-x | debian/rules | 12 |
7 files changed, 69 insertions, 48 deletions
diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 000000000..998fe8e5e --- /dev/null +++ b/build/Makefile @@ -0,0 +1,37 @@ +TARGETS=$(foreach language,$(languages),$(addprefix $(language).,$(architectures))) + +.PHONY: $(TARGETS) + +all: $(TARGETS) + +$(TARGETS): %: + target=$@ ; \ + lang=$${target%.*} ; \ + arch=$${target#*.} ; \ + echo "Architecture: $$arch" ; \ + if [ -n "$$noarchdir" ]; then \ + destsuffix="$$lang" ; \ + else \ + if [ -n "$$web" ] ; then \ + destsuffix="$$arch" ; \ + else \ + destsuffix="$$lang.$$arch" ; \ + fi ; \ + fi ; \ + export destdir=build.out.$$lang.$$arch ; \ + export tempdir=build.tmp.$$lang.$$arch ; \ + ./buildone.sh "$$arch" "$$lang" "$$formats" ; \ + mkdir -p "$$destination/$$destsuffix" ; \ + for format in $$formats; do \ + if [ "$$format" = html ]; then \ + mv ./$$destdir/html/* "$$destination/$$destsuffix" ; \ + else \ + # Do not fail because of missing PDF support for some languages \ + if [ -n "$$web" ] ; then \ + mv ./$$destdir/install.$$lang.$$format "$$destination/$$destsuffix/install.$$format.$$lang" 2>/dev/null || true ; \ + else \ + mv ./$$destdir/install.$$lang.$$format "$$destination/$$destsuffix" 2>/dev/null || true ; \ + fi ; \ + fi ; \ + done ; \ + ./clear.sh diff --git a/build/build.sh b/build/build.sh index 910e9eeb6..b621c705a 100755 --- a/build/build.sh +++ b/build/build.sh @@ -48,28 +48,9 @@ for lang in $languages; do if [ ! -d ../$lang ] && uses_po; then generate_xml fi - - for arch in $architectures; do - echo "Architecture: $arch" - if [ -n "$noarchdir" ]; then - destsuffix="$lang" - else - destsuffix="${lang}.${arch}" - fi - ./buildone.sh "$arch" "$lang" "$formats" - mkdir -p "$destination/$destsuffix" - for format in $formats; do - if [ "$format" = html ]; then - mv ./build.out/html/* "$destination/$destsuffix" - else - # Do not fail because of missing PDF support for some languages - mv ./build.out/install.$lang.$format "$destination/$destsuffix" 2>/dev/null || true - fi - done - - ./clear.sh - done done + +make languages="$languages" architectures="$architectures" destination="$destination" formats="$formats" PRESEED="../en/appendix/preseed.xml" if [ -f $PRESEED ] && [ -f preseed.pl ] ; then diff --git a/build/buildone.sh b/build/buildone.sh index 388b1cbec..f0437c08b 100755 --- a/build/buildone.sh +++ b/build/buildone.sh @@ -36,7 +36,10 @@ if [ -z "$destdir" ]; then destdir="build.out" fi -tempdir="build.tmp" +if [ -z "$tempdir" ]; then + tempdir="build.tmp" +fi + dynamic="${tempdir}/dynamic.ent" create_profiled () { @@ -227,9 +230,9 @@ create_pdf() { echo "Info: creating .pdf file..." - dvipdf $tempdir/install.${language}.dvi + ( cd $tempdir ; dvipdf install.${language}.dvi ) RET=$?; [ $RET -ne 0 ] && return $RET - mv install.${language}.pdf $destdir/ + mv $tempdir/install.${language}.pdf $destdir/ return 0 } diff --git a/build/buildweb.sh b/build/buildweb.sh index da02a2ee5..1ac40e3e8 100755 --- a/build/buildweb.sh +++ b/build/buildweb.sh @@ -46,28 +46,9 @@ for lang in $languages; do if [ ! -d ../$lang ] && uses_po; then generate_xml fi - - for arch in $architectures; do - echo "Architecture: $arch" - if [ -n "$noarchdir" ]; then - destsuffix="$lang" - else - destsuffix="${arch}" - fi - ./buildone.sh "$arch" "$lang" "$formats" - mkdir -p "$destination/$destsuffix" - for format in $formats; do - if [ "$format" = html ]; then - mv -f ./build.out/html/* "$destination/$destsuffix" - else - # Do not fail because of missing PDF support for some languages - mv -f ./build.out/install.$lang.$format "$destination/$destsuffix/install.$format.$lang" || true - fi - done - - ./clear.sh - done done + +make languages="$languages" architectures="$architectures" destination="$destination" formats="$formats" web=1 PRESEED="../en/appendix/preseed.xml" if [ -f $PRESEED ] && [ -f preseed.pl ] ; then diff --git a/build/clear.sh b/build/clear.sh index 35178fe86..25acba0ad 100755 --- a/build/clear.sh +++ b/build/clear.sh @@ -5,5 +5,13 @@ manual_path="$(echo $basedir | sed "s:/build$::")" build_path="$manual_path/build" cd $build_path -rm -rf build.out -rm -rf build.tmp +if [ -z "$destdir" ]; then + destdir="build.out" +fi + +if [ -z "$tempdir" ]; then + tempdir="build.tmp" +fi + +rm -rf "$destdir" +rm -rf "$tempdir" diff --git a/debian/changelog b/debian/changelog index 2d7c8e735..1e09549b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ installation-guide (20120827) UNRELEASED; urgency=low for the patch. Closes: #684629. * official-cdrom: Add link to CD FaQ. Thanks Holger Wansing and Richard Owlett for the heads-up. Closes: #280348, #309568. + * Add language-parallel build support. -- Samuel Thibault <sthibault@debian.org> Sun, 26 Aug 2012 16:47:22 +0200 diff --git a/debian/rules b/debian/rules index e3ecb7847..2809b9d0e 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,15 @@ ifeq (${SUITE},unstable) SUITE=wheezy endif +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +DEB_PARALLEL_JOBS ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) +endif + +ifneq (,$(DEB_PARALLEL_JOBS)) +PARALLEL=-j$(DEB_PARALLEL_JOBS) +endif + + MANTMP=$(shell pwd)/debian/manual clean: @@ -18,7 +27,7 @@ clean: rm -rf $(MANTMP) dh_clean doc-base-stamp rm -rf debian/installation-guide-*.doc-base.* - rm -rf build/build.out build/build.tmp build/build.po + rm -rf build/build.out* build/build.tmp* build/build.po doc-base: doc-base-stamp doc-base-stamp: @@ -48,6 +57,7 @@ build-stamp: -rm -rf $(MANTMP) set -e && cd build && \ for arch in $(ARCHS) ; do \ + MAKEFLAGS="$(PARALLEL)" \ official_build=1 manual_release=$(SUITE) \ architectures="$$arch" languages="$(LANGS)" \ destination=$(MANTMP)/$$arch noarchdir=1 \ |