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

Re: how to specify a different file target than its source?




On Oct 26, 2006, at 11:11 AM, Fulko Hew sita aero wrote:


Is there any way to specify a target filespec that is independent
of the file's location on the build machine.

ie.  on the build machine the source file is in
/home/me/myproject/src/myfile
but when installed, I want it to be in /bin/myfile on the target machine.

I can't find anything in the Maximum RPM book to point me in a direction to
go.
I would have thought it would be something in the %files list.


The %files list should include the install, not the build, path.

RPM_BUILD_ROOT (or the equivalently valued macro %{buildroot}) is
where a mapping between build path and install path is achieved, basically by copying from the build path to the buildroot, something like the following

    BuildRoot: %{_tmppath}/%{name}
    ...

     %install
    rm -rf %{buildroot}
    mkdir -p %{buildroot}/bin
    ...
     cp /home/me/myproject/src/myfile %{buildroot}/bin
    ...

    %files
     %defattr(-,root,root)
     /bin/myfile

It sounds like you are not using a BuildRoot: directive at all however, but
that's just my guess.

73 de Jeff


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