--- /dev/null
+ SMOCK - Simpler Mock
+ ====================
+
+Smock is a thin wrapper around mock to let you build up a whole
+set of dependant RPMs against an external distro.
+
+ - Copy smock.httpd.conf to /etc/httpd/conf.d/smock.conf, changing the
+ /home/[USERNAME]/ to your user
+ - Start httpd
+ - Add smock.mock.conf to all your repos in /etc/mock/ changing the
+ arch and distro name to match
+ - Create $HOME/smock
+
+ - Edit smock.sh to set which arch(es) you want to build on
+
+Now you can run
+
+ ./smock.sh fedora-9 /path/to/srpm
+
+And it'll build the RPM against the fedora-9-XXX distro for each 'XXX'
+arch you listed.
+
+The resulting src RPMs, binary RPMs and build logs wil be put into
+$HOME/smock, and a YUM repo created. Further RPMs you build using
+smock will resolve the BuildRequires against this local repo
--- /dev/null
+
+
+Alias /smock /home/USERNAME/smock
+
+<Directory /home/USERNAME/smock>
+ Allow from all
+ Options +Indexes
+</Directory>
--- /dev/null
+[smock]
+name=smock
+baseurl=http://127.0.0.1/smock/yum/fedora-9/i386
+enabled=1
+
--- /dev/null
+#!/bin/sh
+
+
+LOCALREPO=$HOME/smock/yum
+#ARCHES="i386 x86_64"
+ARCHES=i386
+
+help() {
+ echo "syntax: $0 DIST SRPM"
+}
+
+if [ -z "$1" ]; then
+ help
+ exit
+fi
+
+
+if [ -z "$2" ]; then
+ help
+ exit
+fi
+
+DIST=$1
+SRPM=$2
+
+createrepos() {
+
+ (
+ mkdir -p $LOCALREPO/$DIST/src/SRPMS
+ cd $LOCALREPO/$DIST/src
+ rm -rf repodata
+ createrepo .
+ )
+
+ for ARCH in $ARCHES
+ do
+ (
+ mkdir -p $LOCALREPO/$DIST/$ARCH/RPMS
+ mkdir -p $LOCALREPO/$DIST/$ARCH/logs
+ cd $LOCALREPO/$DIST/$ARCH
+ rm -rf repodata
+ createrepo --exclude "logs/*rpm" .
+ )
+ done
+}
+
+createrepos
+
+mkdir -p $LOCALREPO/scratch
+rm -f $LOCALREPO/scratch/*
+
+for ARCH in $ARCHES
+do
+ mkdir -p $LOCALREPO/$DIST/$ARCH/logs/$SRPM
+
+ mock -r $DIST-$ARCH --resultdir $LOCALREPO/scratch $SRPM
+
+ mv $LOCALREPO/scratch/*.src.rpm $LOCALREPO/$DIST/src/SRPMS
+ mv $LOCALREPO/scratch/*.rpm $LOCALREPO/$DIST/$ARCH/RPMS
+ mv $LOCALREPO/scratch/*.log $LOCALREPO/$DIST/$ARCH/logs/$SRPM/
+done
+
+createrepos