Bug 962837

Summary: Export CONFIG_SITE=NONE during building rpms
Product: [Fedora] Fedora Reporter: Pavel Raiskup <praiskup>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: eblake, ffesti, jakub, jzeleny, novyjindrich, packaging-team-maint, pknirsch, pmatilai
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-03 02:50:31 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 772999    

Description Pavel Raiskup 2013-05-14 10:38:33 EDT
Hi, would there be possible to apply something like this patch?

diff --git a/macros.in b/macros.in
index 9ca1b5e..0cc97dc 100644
--- a/macros.in
+++ b/macros.in
@@ -649,6 +649,8 @@ package or when debugging this package.\
   export CLASSPATH}\
   PKG_CONFIG_PATH=\"%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
   export PKG_CONFIG_PATH\
+  CONFIG_SITE=NONE\
+  export CONFIG_SITE\
   \
   %{verbose:set -x}%{!verbose:exec > /dev/null}\
   umask 022\

--------

This would enable me to install '/usr/share/config.site' file in autoconf (as
described in bug #772999) and all Fedora's builds would stay untouched by this
change.  The config.site file is useful for hand-builds - many things that are
solved by %configure macro can be handled for hand builds using the config.site
file.

Pavel
Comment 1 Panu Matilainen 2013-06-11 08:27:38 EDT
Added in rpm-4.11.1-0.rc1.3.fc20. At least for now, rawhide-only.
Comment 2 Pavel Raiskup 2013-11-20 03:45:03 EST
I'd like to request one slight improvement - to not redefine CONFIG_SITE in
case it is already defined.

Consider that you want to let your compiler know if it is run from
./configure script during rpmbuild (compiler may be run from multiple places
in spec otherwise, especially by make command).  The config.site would be very
useful place to export some variable for that.

diff --git a/macros.in b/macros.in
index e073048..b0c6d6f 100644
--- a/macros.in
+++ b/macros.in
@@ -654,7 +654,7 @@ package or when debugging this package.\
   export CLASSPATH}\
   PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
   export PKG_CONFIG_PATH\
-  CONFIG_SITE=NONE\
+  : ${CONFIG_SITE:=NONE}\
   export CONFIG_SITE\
   \
   %{verbose:set -x}%{!verbose:exec > /dev/null}\
Comment 3 Panu Matilainen 2013-11-27 02:27:07 EST
Seems reasonable.

I had to look up the meaning of ": ${FOO:=BAR}" syntax though :) I'd rather go with the "CONFIG_SITE=${CONFIG_SITE:-NONE}" syntax if only for consistency with what is used elsewhere in macros.
Comment 4 Pavel Raiskup 2013-11-27 06:55:31 EST
(In reply to Panu Matilainen from comment #3)
> I had to look up the meaning of ": ${FOO:=BAR}" syntax though :) I'd rather
> go with the "CONFIG_SITE=${CONFIG_SITE:-NONE}" syntax if only for
> consistency with what is used elsewhere in macros.

Yes, it does not matter.  Thanks.
Comment 5 Panu Matilainen 2013-12-03 02:50:31 EST
Changed to not override CONFIG_SITE if already set in rpm-4.11.1-11.fc21