how to "rembuild --rebuild" a source rpm in the current directory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  as a followup to my previous post, here's what i'm effectively after -- 
i want a way to run "rpmbuild --rebuild" on a source RPM in the current 
directory, and i want all of the building to be done in a subdirectory of 
the current directory; that is, the rebuilding should do *nothing* 
outside of the current directory, whatever directory i happen to be in.

  currently, when i want to rebuild a source RPM for myself, i override
the build locations in my home .rpmmacros files, which contains (among
other things):

%_topdir	%(echo $HOME)/build/rpms
%_sourcedir     %{_topdir}/SOURCES/%{name}-%{version}
%_specdir       %{_sourcedir}

%_builddir	%{_topdir}/BUILD

%_tmppath	%{_topdir}/tmp
#
#  this next line shouldn't be necessary
#
%tmpdir		%{_topdir}/tmp
%_buildroot	%{_topdir}/%{_tmppath}/%{name}-%{version}-root

%_rpmdir	%{_topdir}/RPMS
%_srcrpmdir	%{_topdir}/SRPMS
%_rpmfilename	%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

and all this works fine.

  but i want to make this building part of a larger software structure, so
that others can do the build, and all of the building is still restricted
to the current directory and further subdirectores (./BUILD, ./SOURCES,
./SPECS and so on).  i can't count on anyone else having their own
.rpmmacros file so all customization has to be part of the software
structure.  in fact, i can't count on these other users to have done
*anything* in the way of customizing their own environments.  so, based on
the docs, here's what appears to be the solution.

  i can create a shareable macros file with all of the above, *except* for 
the _topdir macro, which will change from directory to directory.  so what 
i'd be looking at is something like:

  $ cd <directory with source RPM>
  $ rpmbuild --rebuild \
	--define '_topdir .' \
	--macros=<shareable macros file> \
	<source RPM file>

how close is this to a solution?  for each directory, i want _topdir to be 
defined to be that current working directory.  based on that, i want the 
remaining macros in that macros file to construct the working directories 
off of that, based on the value of _topdir they get from that --define 
value.

  am i close?  or am i making this far too difficult?  and what's the 
format for prepending a macros file to the default list, rather than 
overriding the whole list?

rday


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux