Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-03-2013, 09:37 PM   #1
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 I want to build librpm.a, but I can't seem to figure it out.

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

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
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 01:02 AM.
2 members found this post helpful.
Old 12-04-2013, 08:49 PM   #3
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.


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

All times are GMT -5. The time now is 05:41 AM.

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