#!/bin/bash
if [ ! -d ~/rpm ] ; then
	mkdir ~/rpm
	mkdir ~/rpm/SOURCES
	mkdir ~/rpm/SPECS
	mkdir ~/rpm/BUILD
	mkdir ~/rpm/RPMS
	mkdir ~/rpm/RPMS/i386
	mkdir ~/rpm/SRPMS
fi

if [ ! -f ~/.rpmmacros ] ; then
	echo "%_topdir $HOME/rpm" >> ~/.rpmmacros
fi
make dist
cp dvd95*.tar.gz ~/rpm/SOURCES
rpmbuild -ba dvd95.spec
echo "RPMS build at $HOME/rpm/RPMS"
