Bug 157894

Summary: rpm macro %_libexecdir has a bad value
Product: [openSUSE] SUSE Linux 10.1 Reporter: Stanislav Brabec <sbrabec>
Component: BasesystemAssignee: Michael Schröder <mls>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: kukuk
Version: Beta 7   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 304316    

Description Stanislav Brabec 2006-03-14 11:38:16 UTC
According to FHS, %_libexecdir should be set to something like /usr/lib/%name. It should not contain %_libdir nor %prefix/libexec.

It is not set correctly in current RPM:

grep _libexecdir $(rpm -ql rpm)

/usr/lib/rpm/macros:%_libexecdir                %{_exec_prefix}/libexec
/usr/lib/rpm/macros:    --libexecdir=%{_libexecdir} \\\
/usr/lib/rpm/macros:    libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
/usr/lib/rpm/macros:  %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
/usr/lib/rpm/noarch-linux/macros:%_libexecdir           %{_libdir}
/usr/lib/rpm/x86_64-linux/macros:%_libexecdir           %{_libdir}
/usr/share/doc/packages/rpm/manual/macros:    %_libexecdir      %{_exec_prefix}/libexec

Currently only package namazu uses this macro.

From: Thorsten Kukuk
Subject: Re: [packagers] libexecdir=/usr/%_lib and *-32bit packages
Date: Mon, 11 Oct 2004 13:55:42 +0200

...

The correct value for --libexecdir as defined by FHS is:

--libexecdir=/usr/lib/%{name}

and nothing else. There are some few exceptions because of 32bit/64bit
differences, but this should really be an exception.
Comment 1 Mike Fabian 2006-03-14 11:49:04 UTC
Stanislave Brabec> Currently only package namazu uses this macro

The "namazu" package redefines it to "/srv/www/cgi-bin" though:

    %define _libexecdir     /srv/www/cgi-bin
    [...]
    export CFLAGS="$RPM_OPT_FLAGS"
    ./configure --prefix=%{_prefix} \
    [...]
		--libexecdir=%{_libexecdir} \
 
Comment 2 Michael Schröder 2006-03-14 13:53:19 UTC
I doubt that FHS talks about rpm macros. You're supposed to use %_libexecdir/%name in your packages.
Comment 3 Stanislav Brabec 2006-03-14 14:49:36 UTC
If I will use %_libexecdir/%name, I will break FHS, because %_libexecdir is not /usr/lib (note that /usr/%_lib is not correct). I have either to redefine the _libexecdir or use my own path.
Comment 4 Michael Schröder 2006-03-14 14:59:58 UTC
/usr/lib doesn't work for multiarch binaries ("exec" == binaries stored here). rpm is now compatible to the other distributions, I will not change this.
Comment 5 Stanislav Brabec 2006-03-14 17:00:37 UTC
/usr/lib is the only path which works with works for libexec helpers.

Our baselibs never contain binaries and both 32 and 64 bit libraries must call the same helper.

For example of bug while using libexecdir=%_libdir see bug 62050.