#!/bin/sh -e # A helper script for build_in_chroot. It is run in the chroot # environment, and does the actual building or rpm and deb files. It # takes the input (build) .tar.gz filename on stdin, builds rpm and # deb files, and puts those results into a tar file that it emits to # stdout (so the output of this helper file should be passed in to # tar!). # # Note the -e arg above, which means 'die if any command here fails'. # (Alas, it's not perfect, since 'rpmbuild' likes to die with an # exit code of 0 where there's a problem.) # # We're also careful to direct output from all commands to stderr, so # the tarfile is the only stdout output from this script. if [ -n "$1" ]; then echo "USAGE: $0 < <.tar.gz file> > <.tar file containing .debs and .rpms>" exit 1 fi { rm -rf /var/tmp/build mkdir /var/tmp/build cd /var/tmp/build tar xfz - cd "`find . -maxdepth 1 -mindepth 1 -type d`" # cd to the only directory ./configure make distcheck make rpm make deb } 1>&2 find . '(' -name '*.deb' -o -name '*.rpm' ')' -print0 | xargs -0 tar cf -