LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2013, 08:37 PM   #1
jacko
LQ Newbie
 
Registered: Dec 2013
Posts: 2

Rep: Reputation: Disabled
Generate static files from a source RPM


I'm still new to Linux, so I apologize if this is actually straightforward, but I can't seem to find the answer. Given a .src.rpm file, how can I generate .a (static) files from it? The .src file only has instructions (as far as I can tell in the .spec file) to generate .so files, but I need the .a files.


Reason: Specifically, I need librpm.a from rpm-4.8.0-12.el6.src.rpm (that's the version of rpm that's installed on my system). I'm compiling with gcc -static so it will pack all the necessary libraries without relying on other systems to already have the library available. However, it is failing because I don't have librpm.a; I only have librpm.so. I want to build librpm.a, but I can't seem to figure it out.

Thanks.
 
Old 12-04-2013, 12:00 AM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you really dont

you can but it depends on just what you need

the src rpm should have the programs sorce zipped and a bunch of patches
unzip the source package and apply the patches

then have a look at the "./configure --help" output
then something like the below will be needed
--with-noshared or --with-static option will be needed

using the offical source and not a src.rpm might be easier
unless you MUST have a matching .a's and .so's

then add the --with-static option to the src spec file and build both

but rpm-build will need to be installed to rebuild the src.rpm to build BOTH shared AND static

Last edited by John VV; 12-04-2013 at 12:02 AM.
 
2 members found this post helpful.
Old 12-04-2013, 07:49 PM   #3
jacko
LQ Newbie
 
Registered: Dec 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks John! This really helped. I'm encountering other issues, but I think for the purpose of this thread, you've answered my question perfectly. I'll come back to this forum if I get stuck.
 
  


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
How can I generate / build and RPM from *.src.rpm file sreekumartg Red Hat 3 02-23-2007 05:23 PM
Difference Between "Source RPM" "Static RPM" Mic Q SUSE / openSUSE 2 03-30-2005 06:51 PM
How to generate an rpm from source? Fredy71 Linux - General 1 03-04-2004 08:27 AM
Can I use RPM to download and update all core source files? minorgod Linux - Software 1 02-06-2004 04:59 PM
Difference between src.rpm files and source.rpm files ja_nch Red Hat 2 09-06-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:47 AM.

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