Bug 74354

Summary: Sources: unwary 'make' call in .spec file
Product: [Retired] Red Hat Linux Reporter: Sysoltsev Slawa <vyatcheslav.sysoltsev>
Component: vncAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: low    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-18 17:36:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sysoltsev Slawa 2002-09-21 07:17:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
Here is %build and begin of %install section from vnc-3.3.3r2-28 spec file:
%build
xmkmf -a
make CDEBUGFLAGS="$RPM_OPT_FLAGS" World
cd Xvnc
make EXTRA_LIBRARIES="-lwrap -lnss_nis" CDEBUGFLAGS="$RPM_OPT_FLAGS" World

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{_bindir}
./vncinstall %{buildroot}%{_bindir}
cd Xvnc
make DESTDIR="%{buildroot}" install
cd ..

Installing with command `make DESTDIR="%{buildroot}" install` includes 
installing some files and also it includes `make install` in 
vnc_unixsrc/Xvnc/programs/Xserver directory. From here Xvnc and Xwrapper are 
installed but if at least one of their prerequisition (a lot of *.a and so on 
in subdirs) isn't up to date, their rebuild is happens. I have some problems 
with time (or maybe with something else) on my system and sometimes 'make' 
ridiculously considered that some *.a libs in subdirs is out of date. It tries 
to rebuild it and then also rebuild Xvnc. But it fails to build it because Xvnc 
requires linking with libwrap and libnss_nis:
hw/vnc/libvnc.a(sockets.o): In function `rfbCheckFds':
sockets.o(.text+0x438): undefined reference to `hosts_ctl'
hw/vnc/libvnc.a(httpd.o): In function `httpCheckFds':
httpd.o(.text+0x235): undefined reference to `hosts_ctl'
make: *** [Xvnc] Error 1

When Xvnc was built during '%build' stage, make was called with 
EXTRA_LIBRARIES="-lwrap -lnss_nis" parameter. In %install stage this parameter 
is missed and this caused above described error.

I added this parameter to 'make' call in %install stage and all has become OK.

So to be more acceptable on unstable systems, vnc .spec file should be:
%build
xmkmf -a
make CDEBUGFLAGS="$RPM_OPT_FLAGS" World
cd Xvnc
make EXTRA_LIBRARIES="-lwrap -lnss_nis" CDEBUGFLAGS="$RPM_OPT_FLAGS" World

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}%{_bindir}
./vncinstall %{buildroot}%{_bindir}
cd Xvnc
make EXTRA_LIBRARIES="-lwrap -lnss_nis" DESTDIR="%{buildroot}" install
cd ..


Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. Unpack source
2. Try `rpm -bb vnc.spec`

	

Actual Results:  Compilation error during %install.

Expected Results:  Freshly built binary packages.

Additional info:

Comment 1 Tim Waugh 2002-11-08 13:21:40 UTC
Fixed package is 3.3.3r2-40, which will show up in rawhide shortly. (But use NTP!)