LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Add precompiled binary to a rpm file (http://www.linuxquestions.org/questions/linux-software-2/add-precompiled-binary-to-a-rpm-file-214440/)

doris 08-06-2004 07:37 PM

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

Tinkster 08-06-2004 08:00 PM

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


All times are GMT -5. The time now is 12:24 PM.