LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 05-07-2007, 09:52 PM   #1
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Rep: Reputation: 30
Wrote spec file, installed RPM, binary gives relocation error and refers to build dir


I finally decided to get around to learning how to properly build an RPM. The RPM builds and puts everything where I want it to put things, but I get an error after I install it and run the app. The spec file and error are below.


armagetronad.spec:
Code:
Name: armagetronad
Version: 0.2.8.2.1
Release: 1.fc6
Summary: 3D Tron lightcycle game
Group: Amusement/Games
License: GPL
URL: http://www.armagetronad.net

Source: %{name}-%{version}.src.tar.bz2
Patch0: armagetronad-0.2.8.2-uninstall.patch
Buildroot: %{_tmproot}/%{name}-%{version}-root
BuildRequires: libstdc++-devel, zlib-devel, libpng-devel, libjpeg-devel
BuildRequires: SDL_image-devel, SDL_mixer-devel, SDL-devel, libxml2-devel
BuildRequires: libXt-devel, mesa-libGLU-devel

%description
A 3D Tron lightcycle game with an advanced AI and network play.

%prep
%setup
%patch0 -p1 -b .uninstall

%build
./configure \
    --enable-music \
    --disable-sysinstall \
    --disable-uninstall \
    --disable-games
%makeinstall
%{__install} -D -p -m 0644 desktop/%{name}.desktop \
    %{buildroot}/%{_datadir}/applications/%{name}.desktop
%{__install} -D -p -m 0644 desktop/icons/large/%{name}.png \
    %{buildroot}/%{_datadir}/pixmaps/%{name}.png
%{__mv} %{buildroot}/%{_datadir}/doc/%{name} \
    %{buildroot}/%{_datadir}/doc/%{name}-%{version}
    
%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%config /etc/%{name}/*
%doc %{_datadir}/doc/%{name}-%{version}/*
%{_bindir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png


%changelog
(omitted)

the error:
Code:
$ armagetronad 
Error: Error in tString GeneratePrefix() in tools/tDirectories.cpp:1332 : 
        Relocation error. The binary was supposed to be installed into /home/hollywoodb/rpmbuild/BUILD/armagetronad-0.2.8.2.1-root/usr/bin and found itself in /usr/bin and could not find out what this means for the prefix /usr/local.
 
Old 05-18-2007, 08:15 AM   #2
the_scourge
LQ Newbie
 
Registered: Feb 2006
Posts: 9

Rep: Reputation: 0
Maybe I missed it, but I didn't see where you installed the binary under %makeinstall. Try adding:

Code:
%{__install} -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
under %makeinstall and see if that helps. You might have to tweak a thing or two in the example above, though, as I don't have the source to check it out.
 
Old 05-19-2007, 10:27 AM   #3
hollywoodb
Member
 
Registered: Aug 2003
Location: Minnesota, U.S.A.
Distribution: Debian, openSUSE
Posts: 400

Original Poster
Rep: Reputation: 30
Yeah, the issue was my misunderstanding of how %install and %makeinstall differ.

I've got it working now, the spec file is at http://rpm.offbeatlounge.com
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RPM Spec file adddy Linux - Software 8 11-07-2006 05:02 AM
RPM relocation error ertmann|CPH Fedora 3 11-20-2003 12:25 PM
where to get a recent spec file to build rpms for kde3.1.4? mmodem Mandriva 0 11-15-2003 09:09 PM
rpm error only says"rpm: relocation error: rpm: undefined symbol: poptAliasOptions" dlrsims Linux - Newbie 2 11-14-2003 09:22 PM
RPM relocation error smaisnie Linux - Software 2 08-29-2003 01:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration