LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-06-2004, 06:37 PM   #1
doris
Member
 
Registered: May 2001
Location: New York, USA
Distribution: RH 7.3, 8.0
Posts: 64

Rep: Reputation: 15
Add precompiled binary to a rpm file


Hi everyone,

I've tried two methods to build binary rpm files:
-- from source tarball, and
-- from precompiled executables.
In both cases, the rpm file I built can be installed properly.

In the second case, I compiled "~/hello/src/helloworld" from source, then I copied it to the rpm in the "install" section of the spec file. Therefore, I expect to see exactly the same binary if I install this rpm. Yet the binary installed thru the rpm (/usr/bin/helloworld) and ~/hello/src/helloworld are different in file size, althrough they both run properly.

Below is the workhorse part of my spec file.

Code:
%prep
%setup -q

%install
rm -rf $RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT%{_bindir}
cp /home/doris/hello/src/helloworld  $RPM_BUILD_ROOT
chmod 755 $RPM_BUILD_ROOT/helloworld
cp $RPM_BUILD_ROOT/helloworld $RPM_BUILD_ROOT%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_bindir}/*
%doc README ChangeLog AUTHORS INSTALL
Below is the size info of my two binaries.

Code:
[doris@cheetah src]$ ls -l /usr/bin/helloworld     
-rwxr-xr-x    1 root     root         4127 Aug  6 18:22 /usr/bin/helloworld   
[doris@cheetah src]$ ls -l helloworld     
-rwxrwxr-x    1 doris   doris      16264 Aug  6 18:15 helloworld
Thank you for looking at my question. Any help is very much appreciated.

doris
 
Old 08-06-2004, 07:00 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Hard to say, really, it depends on the compiler options,
whether one is stripped or not, what kind of optimisation
was turned on for which ....

I don't think it has anything to do with rpm :)


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how do I make a binary rpm from a source rpm darkone66669 Linux - Software 3 01-11-2005 10:42 AM
Question on Add/Remove apps, rpm file equivalents? Arodef Fedora 7 01-09-2005 11:56 AM
How to add a file to an existing rpm package SharpyWarpy Linux - Software 3 06-20-2004 05:59 AM
binary vs source RPM (and other RPM questions) calimer Linux - Software 4 06-22-2003 12:33 AM
rpm: cannot execute binary file aqoliveira Linux - General 1 12-26-2001 02:38 AM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration