RPM Community Forums

Mailing List Message of <rpm-users>

RE: Attempting to compile rpm5 for RH Linux EL5

From: Saravanan Shanmugham (sarvi) <sarvi@cisco.com>
Date: Fri 18 Sep 2009 - 08:04:28 CEST
Message-ID: <C6A1C20DB743364EB446E923B2229FEF097C2895@xmb-sjc-229.amer.cisco.com>
Thanks. I was able to get it compiled and installed. 

I am proposing the use of RPM5 for package management internally. One
point of interest to me in RPM5 is the use of XAR format, and more
specifically the option of being able to extract specific files from
within the XAR archive without having to untar/extracting everything.
Atleast that's what the xar wiki page claims.

We need a way to be able to extract specific executables and libraries
from a specific version of the build, from its archived RPMs, on demand,
to help decode a crash or traceback. 

So far, I haven't been able to figure out the RPM5 option or XAR option
that allows me to do extract a specific file or list of files.

Is there such an option. If not how easy do you think it is to implement
such an option, if we can help.

Sarvi

-----Original Message-----
From: rpm-users-owner@rpm5.org [mailto:rpm-users-owner@rpm5.org] On
Behalf Of Jeff Johnson
Sent: Thursday, September 17, 2009 5:48 PM
To: rpm-users@rpm5.org
Subject: Re: Attempting to compile rpm5 for RH Linux EL5


On Sep 17, 2009, at 8:12 PM, Saravanan Shanmugham (sarvi) wrote:

>
> I got popt 1.15 from
> http://www.sfr-fresh.com/linux/misc/popt-1.15.tar.gz
> Compiled and installed it.
> Now I get the following error during compilation
>
> o -lm /usr/lib/libmagic.so -lbeecrypt -lz /usr/lib/libpopt.so - 
> lpthread -lrt -Wl,-rpath -Wl,/usr/local/lib
> ../lib/.libs/librpm.so: undefined reference to `poptReadConfigFiles'
> ../lib/.libs/librpm.so: undefined reference to `poptReadFile'
> collect2: ld returned 1 exit status
> make[3]: *** [rpm2cpio] Error 1
> make[3]: Leaving directory `/operator/rpm-5.1.9/tools'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/operator/rpm-5.1.9/tools'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/operator/rpm-5.1.9'
> make: *** [all] Error 2
>

The "official" popt-1.15.tar.gz is at
	http://rpm5.org/files/popt/popt-1.15.tar.gz

I just download'd, unpackaged, ran configure, and looked for the
symbols:
     [jbj@fedora10 popt-1.15]$ nm .libs/libpopt.so
     ...
     00004fa0 T poptReadConfigFile
     000059c0 T poptReadConfigFiles
     00005660 T poptReadDefaultConfig
     00004dd0 T poptReadFile
so the symbols are there.

>
> Is there a list of components/versions and where to get them, I need  
> so
> that I can install them and make sure compile install goes fine? I
> notice that all the components like popt, xar all have copies in the
> RPM5 CVS. Is this where we should pulling stuff from?
>

See the INSTALL file in the rpm tarball.

But yes, there's a slew of possible options for ./configure, many
more than most programs have.

Here's the options I use daily on Fedorable 11. For RPM development, I  
configure *everything*,
you likely want to pare this set down to something smaller and saner:

     %configure \
         --verbose \
         --prefix=/usr \
         --with-db=internal \
         --with-db-tools-integrated \
         --with-zlib=external \
         --with-bzip2=external \
         --with-xz=internal \
         --with-file=internal \
         --with-lua=internal \
         --with-tcl=external \
         --with-sqlite=external \
         --with-syck=internal \
         --with-readline=external \
         --with-augeas=external \
         --with-beecrypt=external \
         --with-openssl=external \
         --with-nss=external \
         --with-gcrypt=external \
         --with-expat=external \
         --with-libtasn1=external \
         --with-pakchois=external \
         --with-gnutls=external \
         --with-neon=external \
         --with-pcre=internal \
         --with-uuid=system \
         --with-xar=internal \
         --with-popt=external \
         --with-keyutils=external \
         --with-pthreads \
         --with-libelf \
         --with-selinux \
         --with-sepol \
         --with-semanage \
         --with-squirrel=/usr/lib:/usr/include/squirrel \
         --with-ficl=/usr/lib:/usr/include/ficl \
         --with-js=internal \
         --with-python \
         --with-pythonembed=/usr/lib:/usr/include/python2.6 \
         --with-perl \
         --with-ruby=/usr/lib/ruby/1.8/i386-linux \
         --with-build-extlibdep \
         --with-build-maxextlibdep \
         --with-valgrind \
         --enable-build-pic \
         --enable-build-versionscript \
         --enable-build-warnings \
         --enable-build-debug \
         --enable-maintainer-mode


> Also I am trying to compile RPM5 with XAR support. Additionally I want
> the RPM tooling to be compiled and installed  at
> /my/own-nfs/tooling/dir. I want this central install to be usable by  
> all
> the machines on the network, to mostly build RPMS in private workspace
> and install those RPMs into private workspace. Installation of RPMs
> should not happen to root (/). Is this doable with RPM5?
>

Passing --prefix=/my/own-nfs/tooling/dir should change the path
where rpm is installed.

Note that the rpmdb (normally in /var/lib/rpm) should be on local
disk, not on NFS.

Check this macro (normally in /usr/lib/rpm/macros)

#       The location of the rpm database file(s).
%_dbpath                %{_var}/lib/rpm

You likely want to check all paths in the macros file.

But yes, all the rest is doable.

73 de Jeff

> Sarvi
>
>
> -----Original Message-----
> From: rpm-users-owner@rpm5.org [mailto:rpm-users-owner@rpm5.org] On
> Behalf Of Jeff Johnson
> Sent: Thursday, September 17, 2009 11:13 AM
> To: rpm-users@rpm5.org
> Subject: Re: Attempting to compile rpm5 for RH Linux EL5
>
>
> On Sep 17, 2009, at 1:50 PM, Saravanan Shanmugham (sarvi) wrote:
>
>> I am trying to compile and install RPM 5.1.9.tar.gz And am running
>> into the following errors. Is there any configure option I should be
>> trying.
>> Has this been fixed in a later release?
>>
>> gcc -DHAVE_CONFIG_H -I. -I..  -I. -I.. -I../build -I../lib -I../lib
>> -I../rpmdb -I../rpmio -I../misc -I../db3 -I../db3 -I../pcre -I../pcre
>> -DRPM_OS_LINUX=020609  -g -O2 -D_GNU_SOURCE -D_REENTRANT -MT
>> rpmdigest.o -MD -MP -MF .deps/rpmdigest.Tpo -c -o rpmdigest.o
>> rpmdigest.c
>> rpmdigest.c:265: error: optionsTable[1].argInfo')
>> rpmdigest.c:267: error: initializer element is not constant
>> rpmdigest.c:267: error: (near initialization for POPT_ARG_ARGV'
>> undeclared here (not in a
>> function)<BR>rpmdigest.c:265: error: initializer element is not
>> constant<BR>rpmdigest.c:265: error: (near initialization for
>> optionsTable[1]')<BR>rpmdigest.c:270: error: initializer element is
>> not constant<BR></FONT></DIV> <DIV><FONT face=Arial
>> size=2></FONT>&nbsp;</DIV> <DIV><FONT face=Arial
>> size=2></FONT>&nbsp;</DIV> <DIV><SPAN class=156564317-17092009><FONT
>> face=Arial size=2>Sarvi</FONT></SPAN></DIV></BODY></HTML>
>
>
> You need popt-1.15 (or you need to patch out POPT_ARG_ARGV,
> which should be in slightly older versions of RPM, POPT_ARG_ARGV was
> added
> to popt like a year ago or so).
>
> I'll attach a copy of a rpmdigest.c that has the necessary
> retrofit, rpmdigest.c is rather small.
>
> Look for the
>
> 	#if !defined(POPT_ARG_ARGV)
> 	...
> 	#endif
>
> sections.
>
> Installing popt-1.15 is the preferred solution.
>
> You can also easily live without building rpmdigest.c, nothing
> in RPM itself needs rpmdigest, which is mostly included in RPM
> so that the same code paths used by RPM internally can also be
> exercised externally in a standalone executable.
>
> 73 de Jeff
>
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
User Communication List                             rpm-users@rpm5.org
Received on Fri Sep 18 08:07:09 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.