# # 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 6.1 %define rpmdbdistribution Red Hat %{rpmdbname}-%{rpmdbversion} %define rpmdbplatform %{_arch}-%{_vendor}-%{_os} %define rpmdbtree /mnt/redhat/test/lorax/%{_arch} %define rpmdbtree /mnt/master/rh61 %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") Release: 1 Group: Development/System Copyright: GPL BuildRoot: /var/tmp/%{name}-root ExclusiveArch: i386 %description This package contains a copy of the rpm database for all packages from the current distribution. %prep [ -d %{rpmdbtree} ] || { echo "This specfile needs access to %{rpmdbtree}/Redhat/RPMS" exit 1 } %build %install rm -rf $RPM_BUILD_ROOT mkdir -p ${RPM_BUILD_ROOT}%{rpmdbpath} MYRPM="rpm --dbpath ${RPM_BUILD_ROOT}%{rpmdbpath}" $MYRPM --initdb cd %{rpmdbtree}/RedHat/RPMS || exit 1 for pkg in *.rpm do $MYRPM -i --justdb --nodeps --noscripts --notriggers --force $pkg done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(0644,root,root,0755) %{rpmdbpath} %changelog * Fri Sep 24 1999 Jeff Johnson - rpm db build needed --notriggers. * Wed Sep 22 1999 Jeff Johnson - Create.