Bug 13625

Summary: Bugs in spec file from samba-3.6.15-1.mga3
Product: Mageia Reporter: Gilles Allard <gilles.allard21>
Component: RPM PackagesAssignee: Buchan Milne <bgmilne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: luigiwalser
Version: 3   
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Source RPM: samba-3.6.15-1.mga3 CVE:
Status comment:
Attachments: Proposal for a fix to bug #13625

Description Gilles Allard 2014-06-30 14:53:04 CEST
Description of problem:
1) If this package is built without system libtdb (i.e. if local libtdb is built during global build process) the setup of .pc file (spec file sequence "for i in \...done"; lines 1436 to 1449) fails : after pushing to "lib/$i ./autogen.sh is called. But there is no "autogen" script and no "configure.ac" in new current directory; the configure scripts that can be found in "tdb" & "talloc" directories  are launchers for "waf" build system that can be found in source top directory. As a consequence, the .pc file is not generated and install fails. This is true also for local "talloc" library

Proposal for a fix :
- on line 1445 remove "./autogen.sh -V && "
- insert the 2 following lines after "./configure ..."
    make   # To setup .pc file
    WAF_MAKE=1 PATH=buildtools/bin:../../buildtools/bin:$PATH waf install --destdir=%{buildroot} --targets=`basename bin/PKGCONFIG_$D.pc`

N.B. : the previous cmd is taken from the generated Makefile; it installs .pc file & man pages as well

2) Spec file sequences "%ifarch alpha ... %endif" (on lines 1479 to 1482) and " %if !%build_system ... %endif (on lines 1484 to 1491) are faulty : each path must be prefixed by "%{buildroot}" (i.e. "rm -rf %{buildroot}%{_bindir} instead of rm -f %{_bindir} etc.)

Version-Release number of selected component (if applicable):
samba-3.6.15-1.mga3

How reproducible:
1) Each time this package is built without system tdb library
2) When built using "--without system" in rpmbuild cmd.

Steps to Reproduce:
1. Build & install this pkg.
2. Check error messages printed during install of local libtdb sub-package
3.


Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2014-07-01 00:08:51 CEST
Could you produce a patch from your suggestions?

CC: (none) => luigiwalser
Assignee: bugsquad => bgmilne

Comment 2 Gilles Allard 2014-07-01 09:28:37 CEST
Created attachment 5230 [details]
Proposal for a fix to bug #13625

Here "samba.spec~" is the original spec file from samba-36.15-1.mga3.src.rpm"
and "samba.spec" the spec file with patch applied
Comment 3 Gilles Allard 2014-07-01 09:32:28 CEST
(In reply to David Walser from comment #1)
> Could you produce a patch from your suggestions?

The patch file added as an attachment (samba.spec.patch) is my proposal to fix that bug
Comment 4 Gilles Allard 2014-07-01 09:44:38 CEST
(In reply to David Walser from comment #1)
> Could you produce a patch from your suggestions?

As an addendum to comment #3 I have to say that the "waf install" command installs .pc file & manpages. I'm not familiar enough with the waf build system to tell if it's possible to modify this command to install only .pc
Comment 5 David Walser 2014-07-01 21:40:57 CEST
Looks reasonable enough.  I checked your patch into SVN.  Thanks for the report.

PS - you might want to think about becoming an official Mageia packager.  See the wiki if you're interested:
https://wiki.mageia.org/en/Becoming_a_Mageia_Packager

Status: NEW => RESOLVED
Resolution: (none) => FIXED