This question is related to: https://bugzilla.redhat.com/show_bug.cgi?id=3D505589
When I remove the strip line, then the build process fails with the complaint:
Found '/home/mcpierce/Packaging/rpms/BUILDROOT/rubygem-RedCloth-4.1.9-5.fc12.x86_= 64' in installed files; aborting
I'm not sure what's wrong here. The %install portion of my spec file is as follows:
---8<[snip]--- rm -rf %{buildroot}
install -d -m0755 %{buildroot}%{gemdir} install -d -m0755 %{buildroot}%{ruby_sitelib} install -d -m0755 %{buildroot}%{ruby_sitearch} install -d -m0755 %{buildroot}%{_bindir}
gem install --local --install-dir %{buildroot}%{gemdir} \ --force -V --rdoc %{SOURCE0}
cp -a %{buildroot}%{gemdir}/bin/* %{buildroot}%{_bindir} mv %{extensionddir}%{gemlibname} %{buildroot}%{ruby_sitearch}/%{gemlibname} rm -rf %{extensionddir} # strip %{buildroot}%{ruby_sitearch}/%{gemlibname} rm %{installroot}/lib/%{gemlibname} cp %{installroot}/lib/redcloth.rb %{buildroot}%{ruby_sitelib}/redcloth.rb rm -rf %{buildroot}%{gemdir}/bin find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x find %{buildroot}%{geminstdir} -name "*.rb" | xargs chmod a+x
find %{buildroot}%{geminstdir} -type f -name *.rb | xargs chmod 0644
find %{buildroot}%{geminstdir} -type f -name *.rb | \ xargs grep -l "^#!%{_bindir}/env" $file | xargs chmod 0755
rm %{installroot}/.require_paths ---8<[snip]---
Any ideas?
Darryl L. Pierce wrote, at 07/15/2009 12:23 AM +9:00:
This question is related to: https://bugzilla.redhat.com/show_bug.cgi?id=505589
When I remove the strip line, then the build process fails with the complaint:
Found '/home/mcpierce/Packaging/rpms/BUILDROOT/rubygem-RedCloth-4.1.9-5.fc12.x86_= 64' in installed files; aborting
I'm not sure what's wrong here. The %install portion of my spec file is as follows:
---8<[snip]--- rm -rf %{buildroot}
install -d -m0755 %{buildroot}%{gemdir} install -d -m0755 %{buildroot}%{ruby_sitelib} install -d -m0755 %{buildroot}%{ruby_sitearch} install -d -m0755 %{buildroot}%{_bindir}
gem install --local --install-dir %{buildroot}%{gemdir} \ --force -V --rdoc %{SOURCE0}
cp -a %{buildroot}%{gemdir}/bin/* %{buildroot}%{_bindir} mv %{extensionddir}%{gemlibname} %{buildroot}%{ruby_sitearch}/%{gemlibname} rm -rf %{extensionddir} # strip %{buildroot}%{ruby_sitearch}/%{gemlibname} rm %{installroot}/lib/%{gemlibname} cp %{installroot}/lib/redcloth.rb %{buildroot}%{ruby_sitelib}/redcloth.rb rm -rf %{buildroot}%{gemdir}/bin find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x find %{buildroot}%{geminstdir} -name "*.rb" | xargs chmod a+x
find %{buildroot}%{geminstdir} -type f -name *.rb | xargs chmod 0644
find %{buildroot}%{geminstdir} -type f -name *.rb | \ xargs grep -l "^#!%{_bindir}/env" $file | xargs chmod 0755
rm %{installroot}/.require_paths ---8<[snip]---
Any ideas?
This is because with your spec file gem is directly installed under %buildroot. So some C codes in the gem (usually under ext/ directory) are compiled under %buildroot and the string "%buildroot" is embedded in the built binary (with "gcc -g"). This will make /usr/lib/rpm/check-buildroot complain.
The correct way is to expand (install) gem file once under %_builddir (at %prep or %build) and and copy all (under %_builddir) under %buildroot at %install like:
------------------------------------------------------------------- %prep %setup -q -c -T mkdir -p ./%{gemdir} export CONFIGURE_ARGS="--with-cflags='%{optflags}'" gem install --local --install-dir .%{gemdir} \ --force -V --rdoc %{SOURCE0}
%build
%install rm -rf %{buildroot} mkdir -p %{buildroot}%{gemdir} cp -a .%{gemdir}/* %{buildroot}%{gemdir} .... .... -------------------------------------------------------------------
With this debuginfo rpm will also be created correctly.
Regards, Mamoru
On Wed, Jul 15, 2009 at 01:44:59AM +0900, Mamoru Tasaka wrote:
This is because with your spec file gem is directly installed under %buildroot. So some C codes in the gem (usually under ext/ directory) are compiled under %buildroot and the string "%buildroot" is embedded in the built binary (with "gcc -g"). This will make /usr/lib/rpm/check-buildroot complain.
The correct way is to expand (install) gem file once under %_builddir (at %prep or %build) and and copy all (under %_builddir) under %buildroot at %install like:
%prep %setup -q -c -T mkdir -p ./%{gemdir} export CONFIGURE_ARGS="--with-cflags='%{optflags}'" gem install --local --install-dir .%{gemdir} \ --force -V --rdoc %{SOURCE0}
%build
%install rm -rf %{buildroot} mkdir -p %{buildroot}%{gemdir} cp -a .%{gemdir}/* %{buildroot}%{gemdir} .... ....
With this debuginfo rpm will also be created correctly.
Awesome, that appears to have worked nicely. Thanks for the input. :)
On Tue, Jul 14, 2009 at 01:28:51PM -0400, Darryl L. Pierce wrote:
With this debuginfo rpm will also be created correctly.
Awesome, that appears to have worked nicely. Thanks for the input. :)
Shoot, spoke way too soon. I had reset the spec file to remove where I had been experimenting with some fixes, and didn't remove the strip line. So I ran it with the changes you posted and with the strip line there and it worked. I removed the strip line and a different error came up now. The problem is now with pathing and not finding the .so file.
On Tue, Jul 14, 2009 at 02:14:20PM -0400, Darryl L. Pierce wrote:
Shoot, spoke way too soon. I had reset the spec file to remove where I had been experimenting with some fixes, and didn't remove the strip line. So I ran it with the changes you posted and with the strip line there and it worked. I removed the strip line and a different error came up now. The problem is now with pathing and not finding the .so file.
Okay, the pathing problem is fixed. Doing the following fixed the problem:
---8<[snip]--- %global workdir %(mktemp -d) ... gem install --local --install-dir %{workdir} \ --force -V --rdoc %{SOURCE0}
cp -ra %{workdir}/* %{buildroot}%{gemdir} ---8<[snip]---
Things are now working fine with the non-stripped binaries.