I need libbz2.a to compile something statically. I was able to hunt down the static packages for other libraries I need (dw,dl,elf,z,c) but I cannot find a static package for bz2. Doing "yum provides "*libbz2.a" reports no matches found. Does anyone know where I can find it? Or can I grab the source and compile my own libbz2.a? How would I go about doing that? Any help is much appreciated.
CentOS Linux release 7.0.1406 (Core)
Packages Installed (none provide libbz2.a):
bzip2-1.0.6-12.el7.x86_64
bzip2-devel-1.0.6-12.el7.x86_64
bzip2-libs-1.0.6-12.el7.x86_64
[SOLVED] No bzip2-static package?
[SOLVED] No bzip2-static package?
Last edited by jake1138 on 2015/04/23 22:16:57, edited 2 times in total.
Re: No bzip2-static package?
I haven't looked with CentOS-7, but are you familiar with yum provides? It can let you know what package would included the needed library
http://srobb.net/yumprovides.html
Anyway, the command would be
yum provides */libbz2.a
And see if you get a result.
http://srobb.net/yumprovides.html
Anyway, the command would be
yum provides */libbz2.a
And see if you get a result.
New users should check the FAQ and Read Me First pages
Re: No bzip2-static package?
I already did that (as mentioned in my post). In fact, taking it a step further, I grabbed the RPM source and saw this in the spec file's changelog:
* Tue Mar 17 2009 Ivana Varekova <varekova@redhat.com> 1.0.5-5
- remove static library
Why they removed it is beyond me. It is necessary for a package that I want to compile statically. Like I said before, every other library that I need has the static library available except for bzip2. It seems like a pretty stupid decision to not at least provide a static version of the library. I also found a related bug report (Bug 530766) and they just flatly state "static libraries are removed". No explanation at all.
But that is just me complaining about a (seemingly) stupid decision someone at RedHat made. What is important to me right now is finding a way to create a libbz2.a that I can use to complete my goal. If anyone has some insights on how to do that, please let me know. I'll keep plugging at it in the meantime. Thanks.
* Tue Mar 17 2009 Ivana Varekova <varekova@redhat.com> 1.0.5-5
- remove static library
Why they removed it is beyond me. It is necessary for a package that I want to compile statically. Like I said before, every other library that I need has the static library available except for bzip2. It seems like a pretty stupid decision to not at least provide a static version of the library. I also found a related bug report (Bug 530766) and they just flatly state "static libraries are removed". No explanation at all.
But that is just me complaining about a (seemingly) stupid decision someone at RedHat made. What is important to me right now is finding a way to create a libbz2.a that I can use to complete my goal. If anyone has some insights on how to do that, please let me know. I'll keep plugging at it in the meantime. Thanks.
Re: No bzip2-static package?
Sorry you did mention you'd tried that, and I missed it. It doesn't seem to be available in CentOS-6.x either.
About all you can do is file a bugzilla request, which will probably be ignored by RedHat but only takes a few minutes to do.
About all you can do is file a bugzilla request, which will probably be ignored by RedHat but only takes a few minutes to do.
New users should check the FAQ and Read Me First pages
Re: No bzip2-static package?
That's easy because the Makefile still knows how to build the static library:jake1138 wrote: What is important to me right now is finding a way to create a libbz2.a that I can use to complete my goal. If anyone has some insights on how to do that, please let me know. I'll keep plugging at it in the meantime. Thanks.
Code: Select all
mkdir libbz2_TEMP && cd libbz2_TEMP
yumdownloader --source bzip2-devel
rpm2cpio bzip2-1.0.6-12.el7.src.rpm |cpio -idv
patch -p0 < bzip2-1.0.4-saneso.patch
patch -p0 < bzip2-1.0.4-cflags.patch
cd bzip2-1.0.6
patch -p1 < ../bzip2-1.0.4-bzip2recover.patch
make libbz2.a
You need to have Development Tools and yum-utils installed
Code: Select all
yum groupinstall "Development Tools"
yum install yum-utils
P.S. You may have a point in opening that bugzilla request, since the static library may be useful to package self-extracting software and such, but this is an exception.
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.
Re: No bzip2-static package?
Thanks for the reply. Before I read this, I ended up creating the .a manually from the .o files using the ar rcs libbz2.a *.o command in the /home/centos/rpmbuild/BUILD/bzip2-1.0.6 directory after having downloaded and installed the source RPM and built the spec file. Your method is a lot easier. Here is the full command order (you were missing the extraction of the tarball):
This static library works but I ran into an issue with another library but I'll make a new post for that.
Code: Select all
mkdir libbz2_TEMP && cd libbz2_TEMP
yumdownloader --source bzip2-devel
rpm2cpio bzip2-1.0.6-12.el7.src.rpm |cpio -idv
tar xf bzip2-1.0.6.tar.gz
patch -p0 < bzip2-1.0.4-saneso.patch
patch -p0 < bzip2-1.0.4-cflags.patch
cd bzip2-1.0.6
patch -p1 < ../bzip2-1.0.4-bzip2recover.patch
make libbz2.a