error in building a RPM file

Ranjan Maitra maitra at iastate.edu
Wed Mar 21 13:38:45 UTC 2012


Hi Richard,

Thanks very much for your help! 

On Wed, 21 Mar 2012 08:12:56 -0500 Richard Shaw <hobbes1069 at gmail.com>
wrote:

> On Wed, Mar 21, 2012 at 12:45 AM, Ranjan Maitra <maitra at iastate.edu> wrote:
> > Hi,
> >
> > I have been playing around building a RPM file. The file in question is
> > peksystray available from:
> >
> > http://downloads.sourceforge.net/project/peksystray/peksystray/0.4.0/peksystray-0.4.0.tar.bz2
> >
> > I am able to download it and compile it using:
> >
> > ./configure
> > make
> > sudo make install-strip
> >
> > No problems.
> >
> > Now to create a RPM. I have tried using rpmbuild on the attached spec
> > file (rpmlint -vi on it gives no errors and no warnings) in the
> > SPECS sub-directory within my rpmbuild directory using:
> >
> > rpmbuild -ba peksystray.spec
> >
> > but I get errors. Can someone please tell me what I am doing wrong?
> 
> I did a quick spec review but I didn't download the source. I've made
> some tweaks to your spec and added comments. Also note that while
> rpmdev-newspec and even vi will create default spec files that contain
> unnecessary sections and tags as long as you're not building for
> Fedora < 14 or EL < 6, such as:
> 
> BuildRoot:
> rm -rf $RPM_BUILD_ROOT in %install
> %clean entirely
> %defattr in %files sections.
> 
> http://dl.dropbox.com/u/34775202/peksystray.spec

So, I ran this, but I still continue to get the same error:

$ rpmbuild -bb peksystray.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.2qQ4iE
+ umask 022
+ cd /home/maitra/rpmbuild/BUILD
+ cd /home/maitra/rpmbuild/BUILD
+ rm -rf peksystray-0.4.0
+ /bin/tar -xf -
+ /usr/bin/bzip2
-dc /home/maitra/rpmbuild/SOURCES/peksystray-0.4.0.tar.bz2
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd peksystray-0.4.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.BCUTdT
+ umask 022
+ cd /home/maitra/rpmbuild/BUILD
+ cd peksystray-0.4.0
+ CFLAGS='-O2 -g'
+ export CFLAGS
+ CXXFLAGS='-O2 -g'
+ export CXXFLAGS
+ FFLAGS='-O2 -g'
+ export FFLAGS
+ ./configure --host=x86_64-unknown-linux-gnu
--build=x86_64-unknown-linux-gnu --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for gawk...gawk 
checking whether make sets $(MAKE)... yes 
checking for x86_64-unknown-linux-gnu-gcc... no 
checking for gcc...gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3 
checking how to run the C preprocessor... gcc -E 
checking for X... no 
configure: error: X development libraries not found 
error: Bad exit status from /var/tmp/rpm-tmp.BCUTdT (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.BCUTdT (%build)


I don't understand why the X development errors are not found, yet I am
able to compile just fine.....for comparison sake, I get, when I
do ./configure manually:

$./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

The above is on a 64-bit machine. On a 32-bit machine, with the above
spec (as well as the old one), I get:


$ rpmbuild -bb peksystray.spec 
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.BohwTI
+ umask 022
+ cd /home/maitra/rpmbuild/BUILD
+ cd /home/maitra/rpmbuild/BUILD
+ rm -rf peksystray-0.4.0
+ /usr/bin/bzip2
-dc /home/maitra/rpmbuild/SOURCES/peksystray-0.4.0.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd peksystray-0.4.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.2bm2uj
+ umask 022
+ cd /home/maitra/rpmbuild/BUILD
+ cd peksystray-0.4.0
+ CFLAGS='-O2 -g -march=i386 -mtune=i686'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -march=i386 -mtune=i686'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -march=i386 -mtune=i686'
+ export FFLAGS
+ ./configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec
--localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info checking for a BSD-compatible
install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for gawk... gawk 
checking whether make sets $(MAKE)... yes 
checking for i686-pc-linux-gnu-gcc... no 
checking for gcc... gcc 
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/lib, headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
+ make -j2
make  all-recursive
make[1]: Entering directory
`/home/maitra/rpmbuild/BUILD/peksystray-0.4.0' Making all in src
make[2]: Entering directory
`/home/maitra/rpmbuild/BUILD/peksystray-0.4.0/src' if gcc
-DHAVE_CONFIG_H -I. -I. -I..     -O2 -g -march=i386 -mtune=i686  -MT
peksystray.o -MD -MP -MF ".deps/peksystray.Tpo" -c -o peksystray.o
peksystray.c; \ then mv -f ".deps/peksystray.Tpo"
".deps/peksystray.Po"; else rm -f ".deps/peksystray.Tpo"; exit 1; fi
gcc  -O2 -g -march=i386 -mtune=i686   -L/usr/lib  -lSM -lICE -lX11  -o
peksystray  peksystray.o /usr/lib /usr/lib: file not recognized: Is a
directory collect2: ld returned 1 exit status make[2]: *** [peksystray]
Error 1 make[2]: Leaving directory
`/home/maitra/rpmbuild/BUILD/peksystray-0.4.0/src' make[1]: ***
[all-recursive] Error 1 make[1]: Leaving directory
`/home/maitra/rpmbuild/BUILD/peksystray-0.4.0' make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.2bm2uj (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.2bm2uj (%build)


The source compiles fine here also (without errors, that is) and is
usable.

Why the differences on two machines having essentially the same set of
packages installed (but for the 32-bit/64-bit)?

Many thanks again and best wishes,
Ranjan



More information about the users mailing list