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

Re: rpm --define



I use the .rpmmacros file, and just set HOME=`pwd`  so that rpm finds the
macro definitions.

I create "build evironment" with the following script:
====begin: mk.rpm.env.sh
#!/bin/sh

# makes rpm build environment in current dir.

mkdir BUILD RPMS SRPMS SOURCES SPECS
mkdir RPMS/i386 RPMS/i586 RPMS/i686 RPMS/noarch

cat > .rpmmacros <<eof
#
%_builddir %(pwd)/BUILD
%_rpmdir %(pwd)/RPMS
%_sourcedir %(pwd)/SOURCES
%_specdir %(pwd)/SPECS
%_srcrpmdir %(pwd)/SRPMS
#
eof
====end: mk.rpm.env.sh

With that, you can then define your extra macro defines w/in that environment.
example:

mkdir tmp.$$
cd tmp.$$
mk.rpm.env.sh

rpm -ivh /some/path/some-package.src.rpm
rpm -bb SPECS/some-package.rpm


-allan



Thomas Vander Stichele <thomas@urgent.rug.ac.be> wrote:
>Hi,
>
>for an automatic build script I've written I want to generate rpm's in
>a custom rpm dir.
>
>For this I have the following shell bit :
>
>    DEFINE="'_topdir $BR'"
>    rpm --define=$DEFINE -ta $MODULE-$VERSION.tar.gz
>
>with the $BR evaluating to the base dir in which to put everything.
>I apparently needed to use a temp variable because the shell did not
>expand $BR otherwise and I didn't find a way to make it do that.
>
>In any case, this fails too :
>
>error: Macro % has illegal name (%define)
>error: Macro % has illegal name (%define)
>error: File /home/thomas/gst/build': No such file or directory
>sh: -c: line 1: unexpected EOF while looking for matching `''
>sh: -c: line 2: syntax error: unexpected end of file
>sh: -c: line 1: unexpected EOF while looking for matching `''
>sh: -c: line 2: syntax error: unexpected end of file
>error: Failed to read spec file from /home/thomas/gst/build'
>
>So my question is : how can I make this work ? How can I define the
>_topdir variable for RPM based on the value of the shell variable BR ?
>
>BTW, I've also tried doing this using the -rcfile option and reading from
>a generated file, but it seems the .rpmrc file in my home dir takes
>precedence over this one (which seems illogical to me, if this is the case
>maybe this should be changed).
>
>Anyway, if I'm doing something wrong here, as I suppose I am, let me know.
>I spent quite some time experimenting and going over the docs and nothing
>seems to help me further.
>
>Thanks,
>Thomas
>
>
>The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
><-*-                      -*->
>all I want is happiness
>happiness
>if you find it share it
>with the rest of us
><-*- thomas@apestaart.org -*->
>URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/
>
>
>
>_______________________________________________
>Rpm-list mailing list
>Rpm-list@redhat.com
>https://listman.redhat.com/mailman/listinfo/rpm-list
>
--
.allan.





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