# # The macro rpmdbname should be # "redhat" for the distribution cdrom (note: not the vendor!) # "powertools" for the powertools cdrom # etc # You'll need to check the other macros too. # # %define rpmdbname redhat %define rpmdbversion 7.1 %define rpmdbtree /root/rh # This hack is needed for building alternative platform databases # on a single architecture using rpm's --target flag %define _arch %{_target_cpu} %define rpmdbdistribution Red Hat %{rpmdbname}-%{rpmdbversion} %define rpmdbplatform %{_arch}-%{_vendor}-%{_os} %define rpmdbpath /usr/lib/rpmdb/%{rpmdbplatform}/%{rpmdbname} Summary: The entire rpm database for the %{rpmdbdistribution} distribution. Name: rpmdb-%{rpmdbname} Version: %{rpmdbversion} Release: 0.%(date +"%%Y%m%d")cz1 Group: Development/System Copyright: GPL BuildRoot: /%{_tmppath}/%{name}-%{version}-%{release}-root %description The %{name} package contains a copy of the rpm database for all packages from the %{rpmdbdistribution} distribution. %prep [ -d %{rpmdbtree} ] || { echo "This specfile needs access to %{rpmdbtree}/%{_arch}/Redhat/RPMS" exit 1 } %build %install rm -rf $RPM_BUILD_ROOT mkdir -p ${RPM_BUILD_ROOT}%{rpmdbpath} MYRPM="rpm --dbpath ${RPM_BUILD_ROOT}%{rpmdbpath}" %if %{_dbapi} MYRPM="$MYRPM --define \"_dbapi %{_dbapi}\"" %endif eval "$MYRPM --initdb" if [ -d %{rpmdbtree}/%{_arch}/RedHat/RPMS ]; then cd %{rpmdbtree}/%{_arch}/RedHat/RPMS elif [ -d %{rpmdbtree}/%{_arch} ]; then cd %{rpmdbtree}/%{_arch} else exit 1 fi eval "$MYRPM -i --justdb --nodeps --noorder --ignorearch --noscripts --notriggers --ignoresize --force *{%{_arch},noarch}.rpm" %clean rm -rf $RPM_BUILD_ROOT %files %defattr(0644,root,root,0755) %{rpmdbpath} %changelog * Tue May 15 2001 Milan Kerslager - rebuild for 7.1 CZ * Fri Sep 24 1999 Jeff Johnson - rpm db build needed --notriggers. * Wed Sep 22 1999 Jeff Johnson - Create.