LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to get configure options from a rpm? (https://www.linuxquestions.org/questions/linux-software-2/how-to-get-configure-options-from-a-rpm-537638/)

edenCC 03-15-2007 03:55 AM

how to get configure options from a rpm?
 
Hi, guys
how can I get the configuration of a rpm?
for example, whatI have is bash-2.05b-20.i366.rpm only, no spec file, how can I get the compilation options for bash?

a common way will be highly preferred!
thanks for your detail,

budword 03-15-2007 04:23 AM

I think you want to download the source for the package you want, and compile from source. Then you can do whatever you want. RPM will limit your options a bit, in exchange for convenience.

Best of luck

David

edenCC 03-16-2007 03:52 AM

Quote:

Originally Posted by budword
I think you want to download the source for the package you want, and compile from source. Then you can do whatever you want. RPM will limit your options a bit, in exchange for convenience.

Best of luck

David

yes, the *.src.rpm has a spec file which has the detailed parameters,

if I don't have *.src.rpm, what can I do? :confused:

jay73 03-16-2007 05:19 AM

Maybe this could help:

rpm -qi package (for installed packages)
rpm -qp package (for packages that are not installed yet)

rpm -qd package will show all the documentation files that come in the package
and
rpm -qc package will list all its configuration files

budword 03-16-2007 07:27 AM

You can get the source code here, not the rpm or src.rpm, but the source code itself.

ftp://ftp.gnu.org/gnu/bash/

Here is an example on how to build it
2.3.10. Build BASH

Get the bash-2.05 source code package from ftp://ftp.gnu.org/gnu/bash/ and untar it into the /usr/src directory.

Note

BASH version 2.05b, the latest version at the time of this writing, will not build successfully when using the --enable-minimal-config option. This leaves two choices. We can either fix 2.05b by applying the patch posted on gnu.bash.bug under the subject, "Compile error in execute_cmd.c with --enable-minimal-config" or we can simply use the 2.05a version.

bash# cd /usr/src/bash-2.05a
bash# ./configure --enable-static-link \
--enable-minimal-config --host=i386-pc-linux-gnu
bash# make
bash# strip bash

I found that here, I think they are building boot floppys from scratch :)

http://www.faqs.org/docs/pocket_linux/x167.html

With any GNU program, like bash, you can always get the source, somewhere. A src.RPM is just a system to package the source code. The RPM is just a system to package the already built binary. Hope that makes sense.

David

shinepuppy 07-26-2007 11:16 AM

I noticed that nobody answered the original posters question: "how can I get the compilation options" from a binary installed from an RPM.

I am stuck with the same problem. I need to figure out which flags and configure options fedora used to compile a package because I need to mimic them in an different environment. Does anyone have a clue how to do this? It seems idiotic to not include the compile options within the package meta data :( Am I just missing it?

ugh!

lazlow 07-26-2007 11:26 AM

As was stated above it is in the srpm. If you used the standard Fedora repos they also carry the srpms for everything. Take a look at the files in /etc/yum.repos.d/ . If you edit those files you will see that there is also a srpm repo within them. They are shut off (enable=0) by default.

shinepuppy 07-26-2007 01:52 PM

Maybe I'm misunderstanding source RPMs. When I downloaded the src.rpm package for openssh I gain access to the 'spec' file which not only contains a list of the valid configuration parameters that fedora uses but also tons of branch statements which alters the configuration parameters used depending on the libraries installed on the system:
Code:

%if %{scard}
        --with-smartcard \
%endif
%if %{build6x}
        --with-ipv4-default \
%endif
%if %{rescue}
        --without-pam \
%else
        --with-pam \
%endif
%if %{WITH_SELINUX}
        --with-selinux \
%else
        --without-selinux \
%endif
%if %{kerberos5}
        --with-kerberos5${krb5_prefix:+=${krb5_prefix}}
%else
        --without-kerberos5
%endif

I'm not interested in compiling a custom binary of a package tailored to the exact development libraries I have installed on my machine (I can do that with source from the original developers). I specifically want to know what flags and parameters the fedora crew threw in when they prepared and compiled their binary. Do you see the difference? I'm trying to debug a problem and need to do some forensics on a current working implementation not run the fedora script which determines which flags it needs to set to compile a completely different binary on my machine.

The php binary is a fantastic example of what I'm looking for. If you run /usr/bin/php -i you'll be bombarded with all sorts of useful information including the configuration command used like so:

Code:

php -i | grep Configure
Configure Command =>  './configure' '--with-curl' '--with-mysql=/usr' '--with-apxs2=/usr/sbin/apxs' '--with-openssl' '--with-gd' '--with-jpeg' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib'

Again, the specific question posed remains unanswered. If the answer is "Nope, you can't get the configuration/compile parameters used from a pre-compiled binary RPM," that's OK with me. I just have to find another way around my problem.


All times are GMT -5. The time now is 01:49 PM.