[CentOS] trouble building an rpm

Mon Sep 12 16:00:32 UTC 2011
Jon Detert <jdetert at infinityhealthcare.com>

i'm a newbie at building rpms.  I made a few rpms years ago, but can't now make one on Centos 5.

In /usr/local/rpmbuild, there are 5 subdirs: BUILD  RPMS  SOURCES  SPECS  SRPMS  tmp

When I type: rpmbuild -ba /usr/local/rpmbuild/SPECS/centos-release-cr-ihc.spec

I get 'file not found' errors, for paths in /usr/local/rpmbuild/tmp:
error: File not found: /usr/local/rpmbuild/tmp/centos-release-cr-ihc-buildroot/etc/yum.repos.d
error: File not found: /usr/local/rpmbuild/tmp/centos-release-cr-ihc-buildroot/etc/yum.repos.d/CentOS-cr.repo
RPM build errors:
    File not found: /usr/local/rpmbuild/tmp/centos-release-cr-ihc-buildroot/etc/yum.repos.d
    File not found: /usr/local/rpmbuild/tmp/centos-release-cr-ihc-buildroot/etc/yum.repos.d/CentOS-cr.repo

All i did was to:
1) put a tarball in SOURCES,
2) put a spec file in SPECS,
3) rpmbuild -ba my spec file

Did I miss a step?  If not, here's the contents of my tarball and spec file:

The tarball in SOURCES is named: centos-release-cr-ihc-1.tar.gz
the contents of which are:
drwxr-xr-x root/root         0 2011-09-09 15:40:01 centos-release-cr-ihc-1/
drwxr-xr-x root/root         0 2011-09-09 15:39:57 centos-release-cr-ihc-1/etc/
drwxr-xr-x root/root         0 2011-09-09 15:40:39 centos-release-cr-ihc-1/etc/yum.repos.d/
-rw-r--r-- root/root       523 2011-09-09 15:35:59 centos-release-cr-ihc-1/etc/yum.repos.d/CentOS-cr.repo

my spec file is /usr/local/rpmbuild/SPECS/centos-release-cr-ihc.spec
the contents of which are:
Summary: Package to set up IHC use of the centos-cr repository
Name: centos-release-cr-ihc
Version: 1
Release: 1
Source0: centos-release-cr-ihc-1.tar.gz
License: GPL
Group: IHC-config
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-buildroot
Package to set up IHC use of the centos-cr repository
%setup -q
install -m 0755 -d /etc/yum.repos.d
install -m 0755 etc/yum.repos.d/CentOS-cr.repo /etc/yum.repos.d/CentOS-cr.repo
echo " "
echo "Yay IHC IS Team!"
%dir /etc/yum.repos.d