#!/bin/sh set -e -x mock_args="-r epel-4-i386 --uniqueext=ladvd_build" # Initialize the chroot mock ${mock_args} --init # Install some more dependencies mock ${mock_args} --install libevent-devel # Find out the homedir of the mockbuild user mock_home=$(mock ${mock_args} -q --shell "runuser - mockbuild -c pwd") build_dir="${mock_home}/ladvd" # Copy the sources into the mediatomb build dir mock ${mock_args} --copyin \ . \ ${build_dir} # Change ownership information mock ${mock_args} --chroot "chown -R mockbuild.mockbuild ${build_dir}" # Build the stuff mock ${mock_args} --chroot "runuser - mockbuild -c 'cd ${build_dir}; ./build.sh'" # Build the release itself mock ${mock_args} --chroot "runuser - mockbuild -c 'cd ${build_dir}; ./release.sh'" # Find the finished builds files=$(mock ${mock_args} -q --shell "runuser - mockbuild -c \"cd ${build_dir}; ls *.mod *-src.tar.gz\"") # Retrieve module and sources for file in $files; do mock ${mock_args} --copyout \ ${build_dir}/${file} \ . done exit 1 # Clean out mock ${mock_args} --clean