Bug 19902 - The %configure macros (%configure, %configure2_5x) need to be unified into one %configure
Summary: The %configure macros (%configure, %configure2_5x) need to be unified into on...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: Mageia 7
Assignee: RPM stack maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-06 13:34 CET by Neal Gompa
Modified: 2020-01-21 16:02 CET (History)
2 users (show)

See Also:
Source RPM: rpm-mageia-setup
CVE:
Status comment:


Attachments
Git formatted patch to unify %configure macros in rpm-setup (2.40 KB, patch)
2016-12-06 13:44 CET, Neal Gompa
Details | Diff

Description Neal Gompa 2016-12-06 13:34:13 CET
Description of problem:
As of Mageia 6, we have two %configure macros: %configure (for legacy autotools) and %configure2_5x (for current autotools). The two macros have subtly different configurations, but are largely the same.

We should unify them and offer ways to flip the behaviors of a new, unifed %configure macro to behave like one for legacy autotoolized projects when needed, but otherwise behave like one for modern projects. This will also make it easier for people to target Mageia with cross-distro specs (common for third-party packagers).

Here's a proposed unified configure script, with legacy behaviors able to be switched on by simply adding "%global _legacy_autotools 1" to a spec:

%configure \
  %before_configure ; \
  %{?_legacy_autotools:%{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}}} \
  %{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}} \
  [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \
  CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \
  $CONFIGURE_TOP/configure %{!?_legacy_autotools:--build=}%{_target_platform} \\\
 	%{?_program_prefix:--program-prefix=%{_program_prefix}} \\\
 	--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} \\\
    $CONFIGURE_XPATH
Neal Gompa 2016-12-06 13:35:05 CET

Target Milestone: --- => Mageia 7

Comment 1 Neal Gompa 2016-12-06 13:37:41 CET
Eck, forgot to guard out the other libtoolize conditional.

It would be like this:

%configure \
  %before_configure ; \
  %{?_legacy_autotools:%{?!_disable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}}} \
  %{!?_legacy_autotools:%{?_enable_libtoolize:%{?__libtoolize_configure:%{__libtoolize_configure};}}} \
  [ -f $CONFIGURE_TOP/configure.in -o -f $CONFIGURE_TOP/configure.ac ] && \
  CONFIGURE_XPATH="--x-includes=%{_prefix}/include --x-libraries=%{_prefix}/%{_lib}" \
  $CONFIGURE_TOP/configure %{!?_legacy_autotools:--build=}%{_target_platform} \\\
 	%{?_program_prefix:--program-prefix=%{_program_prefix}} \\\
 	--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} \\\
    $CONFIGURE_XPATH
Comment 2 Neal Gompa 2016-12-06 13:44:13 CET
Created attachment 8729 [details]
Git formatted patch to unify %configure macros in rpm-setup

I've attached a proposed patch to implement this in rpm-setup.
Neal Gompa 2017-05-31 13:52:47 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=20994

Comment 3 Thierry Vignaud 2017-07-30 23:46:40 CEST
This need for someone to successfully rebuild all packages with the above change after adjusting the needed packages.
I seriously doubt that this has been done.
Anything else will likely break the building of quite a lot packages

Btw this has already been discussed and what has been suggested instead:
- rename %configure -> %old_configure
  AND adjust all affected spec files
- rename %configure2_5x -> %configure
  AND adjust all affected spec files

This is quite a lot less likely to induce breakages....

CC: (none) => thierry.vignaud

Comment 4 Neal Gompa 2017-07-30 23:54:08 CEST
My patch does not preclude that.

%old_configure could be defined as %configure with legacy autotools flag on. Alternatively, if we can just inject to the top of spec files that use %configure today with the flag, then we're fine.

After that, %configure2_5x can be mass changed to %configure.

Note that while I have applied the patch, I have not made a release with it yet, since I don't know how we're going to make the mass change.
Lewis Smith 2020-01-13 21:43:14 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=26064

Comment 5 Jani Välimaa 2020-01-21 16:02:26 CET
This was fixed in rpm-mageia-setup 2.50.

Legacy autotools parts were removed completely and %configure is now the macro that one should use. %configure2_5x was kept for compatibility and is pointing to %configure with a deprecation warning.

Closing as FIXED.

CC: (none) => jani.valimaa
Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.