Ask Your Question
1

How to remove references to %{buildroot} from binary files in a build root?

asked 2017-01-11 02:46:26 -0500

updated 2017-01-14 11:41:22 -0500

mattdm gravatar image

I know how to remove references of %{buildroot} in my package's text files, namely using a find command like:

find %{buildroot}%{_libexecdir} \
  -name "*.pc" -exec sed -i -e 's|%{buildroot}||g' '{}' \; \
  -or -name "*.py" -exec sed -i -e 's|%{buildroot}||g' '{}' \; \
  -or -name "*.py.orig" -exec sed -i -e 's|%{buildroot}||g' '{}' \; \
  -or -name "python-config" -exec sed -i -e 's|%{buildroot}||g' '{}' \; \
  -or -name "Makefile" -exec sed -i -e 's|%{buildroot}||g' '{}' \;

but the problem is that what one does when binary files contain references to %{buildroot}? I suspect if an answer (besides it's impossible) exists it will involve binutils. If it is impossible please give me a method of turning off the %{buildroot} reference check, preferably in a way I can use in the Open Build Service (OBS).

edit retag flag offensive close merge delete

Comments

Can you share the spec file? I can help you...

davidva gravatar imagedavidva ( 2017-01-13 00:46:42 -0500 )edit

Its source files (including the spec file and patch) can be found here.

Brenton Horne gravatar imageBrenton Horne ( 2017-01-13 03:07:47 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-13 19:16:00 -0500

davidva gravatar image

updated 2017-01-14 01:50:20 -0500

But It includes a bundle python 2.7! why? and symlink with the official python maybe works. Here some changes in the spec file

edit flag offensive delete link more

Comments

Thanks, but how do I get it to build for both x86 and x86_64?

Brenton Horne gravatar imageBrenton Horne ( 2017-01-14 09:23:54 -0500 )edit

A conditional task ;)

%ifarch x86_64
Source:foox86_64
%else
Source:foo_i386
%endif
davidva gravatar imagedavidva ( 2017-01-14 10:42:51 -0500 )edit

I had tried something similar to that and it failed. Then I tried that (with another similar conditional in the %prep section as the source directory is dependent on architecture too) exactly and it failed. As you can see here it only seems to download the x86 tarball for some reason...

Brenton Horne gravatar imageBrenton Horne ( 2017-01-14 11:26:02 -0500 )edit
1

Nvm I corrected it by editing my _service file.

Brenton Horne gravatar imageBrenton Horne ( 2017-01-14 11:57:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-11 02:46:26 -0500

Seen: 116 times

Last updated: Jan 14 '17