#!/bin/sh
# Preparation :
# ===========
# This has to be done just ONCE: create an ~/.rpmmacros file with the following:
#    %_topdir /dev/shm/build
#    %debug_package %{nil}
#    %_signature gpg
#    %_gpg_name Convirture Corp (Key for package signing) <info@convirture.com>
#
# Where %_topdir is wherever you want your build tree to reside.
#
# Then, you'd do something like this:
#
# cd /usr/src/redhat
# find | cpio -pdm /dev/shm/build/
#
#
# build rpms : Assumes that initial setup mentioned above is done.
# 
# Usage : ./make_rpms <tar file generated by make_dist>
#
base=`dirname $0`
cd $base/../../

rpmbuild -tb --define "_vendor fedora" $1
rpmbuild -tb --define "_vendor suse" $1

## To make version specific rpms
## remove BuildArchitectures: noarch from the spec file and use the
## following commands

#rpmbuild -tb --target 'i386-fedora' $1
#rpmbuild -tb --target 'x86_64-fedora' $1
#rpmbuild -tb --target 'i386-suse' $1
#rpmbuild -tb --target 'x86_64-suse' $1

echo "WARNING : RPMS are not signed. Please use sign_rpms script in the same directory to do so."
