Re: rpmbuild oddity on F21 (but not F20)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux