# This hack (taken from rpmdb-redhat) is needed for building alternative 
# platform databases on a single arch using rpm's --target flag
%define compsversion 47
%define site Fermi
%define treedir /mnt/src/lts4rolling
#Should not have to change anything below this line
%define rpmmarketingversion "Scientific Linux (%{site})" 
%define default SL 
%define _arch %{_target_cpu}
%define basedir %{treedir}/%{_arch}/sites/%{site}/base
Summary: Comps file and header lists for the %{rpmmarketingversion} distribution
Name: comps
Version: %{site}.%{compsversion}
Release: 0.%(date +"%%Y%m%d")
License: GPL
Group: Development/System
BuildRoot: %{_tmppath}/%{name}-%{_arch}-root

%description

%prep
[ -d %{basedir} ] || {
   echo "This specfile needs access to %{basedir}"
   exit 1
}

[ -f %{basedir}/comps.xml ] && [ -f %{basedir}/hdlist ] && [ -f %{basedir}/hdlist2 ]  ||  {
   echo "This specfile needs access to the comps file and header lists"
   exit 1
}

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share/comps/%{_arch}
install -m 644 %{basedir}/comps.xml $RPM_BUILD_ROOT/usr/share/comps/%{_arch}/
install -m 644 %{basedir}/hdlist $RPM_BUILD_ROOT/usr/share/comps/%{_arch}/
install -m 644 %{basedir}/hdlist2 $RPM_BUILD_ROOT/usr/share/comps/%{_arch}/

# this is kind of ugly...
install -m 644 %{basedir}/../../../.discinfo $RPM_BUILD_ROOT/usr/share/comps/%{_arch}/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
/usr/share/comps

%changelog
* Wed Apr 7 2004 Connie Sieh <csieh@fnal.gov>
- SLize it.

* Tue Jul 23 2002 Jeremy Katz <katzj@redhat.com>
- Initial build.