From: Bruce A. <ba...@gr...> - 2003-01-21 14:51:00
|
Hi Tim, Thanks very much for your suggestions. Here is my latest attempt at a non-root make release target, based on what you said. > If you don't want that lot as your rpm default, it's possible to call > .rpmrc something else and invoke it in the "make release" bit by rpm > --rcfile <somercfile> --restofstuff As I said, the goal is to keep whatever RPM macros and rpmrc settings the user has, and to ONLY replace the working directories with ones below the current sm5/ directory. I'm still trying to implement this -- and still having trouble. Here's what I tried (and how it failed): In the Makefile, I have added: smb=`pwd`/rpmbuildroot and here is the relevant part of the make release target: mkdir -p $(smb)/BUILD $(smb)/RPMS/i386 $(smb)/SOURCES $(smb)/SPECS $(smb)/SRPMS mv -f $(pkgname).tar.gz $(smb)/SOURCES/ echo "macrofiles: temprpmmacros" > temprpmrc echo "%_topdir $(smb)" > temprpmmacros echo "%_rpmdir %{_topdir}/RPMS" >> temprpmmacros echo "%_sourcedir %{_topdir}/SOURCES" >> temprpmmacros echo "%_specdir %{_topdir}/SPECS" >> temprpmmacros echo "%_srcrpmdir %{_topdir}/SRPMS" >> temprpmmacros echo "%_buildir %{_topdir}/BUILD" >> temprpmmacros rpmbuild --rcfile temprpmrc:/usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc -ba smartmontools.spec So when I run this, the contents of the two temprpm* files are: :::::::::::::: temprpmrc :::::::::::::: macrofiles: temprpmmacros :::::::::::::: temprpmmacros :::::::::::::: %_topdir /home/ballen/projects/SF/sm5/rpmbuildroot %_rpmdir %{_topdir}/RPMS %_sourcedir %{_topdir}/SOURCES %_specdir %{_topdir}/SPECS %_srcrpmdir %{_topdir}/SRPMS %_buildir %{_topdir}/BUILD The argument to --rcfile is based on the following from the rpm man page: --rcfile FILELIST Each of the files in the colon sepa- rated FILELIST is read sequentially by rpm for configuration informa- tion. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc. The idea is to keep exactly whatever the user's default macros and rpmrc settings are, and to just tweak the working directory but nothing else. Here is how "make release" fails: <deleted output> rpmbuild --rcfile temprpmrc:/usr/lib/rpm/rpmrc:/etc/rpmrc:~/.rpmrc -ba smartmontools.spec error: Unable to open /etc/rpmrc for reading: No such file or directory. make: *** [release] Error 1 Note that this CONTRADICTS the man page which explicitly says that only the first file in the list must exist. Sigh. Any suggestions? Bruce |