On Wed, Apr 15, 2015 at 01:08:25PM -0500, Ranjan Maitra wrote: > On Wed, 15 Apr 2015 18:56:29 +0100 James Hogarth <james.hogarth@xxxxxxxxx> wrote: > > > What is the behaviour using mock instead so that you have a nice clean > > build environment? > > I am sorry but how does one use mock? I have never used it before, sorry. You can start by adapting the attached script. I used this to maintain a local yum repo before Fedora copr came along. Hope this helps, -- Suvayu Open source is the future. It sets us free.
#!/bin/bash # set -o xtrace if [[ $# -lt 1 ]]; then echo "Insufficient arguments" echo "Usage: $ ${0##*/} <package-to-build> [mock options]" exit 1 fi declare package="$1" rpmbuildroot=~/rpmbuild outdir declare tmpdir=$(mktemp -d --tmpdir=/tmp mock_rpms_${UID}_XXXX) declare mockargs="${@:2}" # open log file exec > >(tee $tmpdir/$package.log) exec 2>&1 # Create directory tree echo "Creating mock output dir tree" declare outdir=/opt/local-repo mkdir -p $outdir/{SRPMS,RPMS} touch $tmpdir/timestamp # SRPM echo "Building SRPM" mock -v $mockargs --resultdir=$outdir/SRPMS --buildsrpm \ --spec $rpmbuildroot/SPECS/$package.spec \ --source $rpmbuildroot/SOURCES declare srpm=$(find $outdir -newer $tmpdir/timestamp -name "*\.src\.rpm") # RPM echo "Building RPM" mock -v $mockargs --resultdir=$outdir/RPMS --rebuild $srpm rm -vrf $outdir/RPMS/*src.rpm echo "Done" # --resultdir accepts python options from config # e.g.: =~/mock/"%(dist)s"/"%(target_arch)s"/
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org