aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--NEWS10
-rwxr-xr-xbrp-mangle-shebangs7
-rw-r--r--configure.ac2
-rw-r--r--macros.in11
-rwxr-xr-xperl.recommends-from-meta57
-rw-r--r--perl_from_meta.attr1
7 files changed, 87 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 12e24a3..ddfdd73 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,6 +31,7 @@ pkg_scripts = \
perl.prov \
perl.req \
perl.req-from-meta \
+ perl.recommends-from-meta \
php.prov \
php.req
diff --git a/NEWS b/NEWS
index f8c9e2f..4062785 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,16 @@
+Version 2.83 - 24 January 2025, by Jani Välimaa
+- generate Recommends from perl META (mga#33945)
+
+Version 2.82 - 28 December 2024, by Jani Välimaa
+- macros: automatically use %set_build_flags macro for build, check, and install phases
+- brp-mangle-shebangs: restore handling of %__brp_mangle_shebangs_exclude
+
+Version 2.81 - 11 November 2024, by Jani Välimaa
- macros: add redhat-hardened-clang-ld.cfg (from Fedora) to pass -pie when linking with clang
- macros: add %dist_vendor (Mageia) and %dist_name (Mageia Linux) macros
Version 2.80 - 5 July 2024, by Jani Välimaa
-- macros: make %install override compatible with rpm 4.20.0
+- macros: Drop the now obsolete %install debuginfo hack (needs rpm-4.20)
Version 2.79.1 - 21 April 2024, by Jani Välimaa
- Makefile: add hardening configs to source tarball
diff --git a/brp-mangle-shebangs b/brp-mangle-shebangs
index f27ad73..bd60d4a 100755
--- a/brp-mangle-shebangs
+++ b/brp-mangle-shebangs
@@ -136,6 +136,13 @@ while IFS= read -r line; do
continue
fi
+ if [ -n "$exclude_shebangs" ]; then
+ echo "$shebang" | grep -q -E "$exclude_shebangs" && continue
+ fi
+ if [ -n "$exclude_shebangs_from" ]; then
+ echo "$shebang" | grep -q -E -f "$exclude_shebangs_from" && continue
+ fi
+
# Replace "special" env shebang:
# /whatsoever/env -whatever /whatever/foo → /whatever/foo
shebang=$(echo "$shebang" | sed -r -e 's@^(.+)/env( -[^ ]+)* /(.+)$@/\3@')
diff --git a/configure.ac b/configure.ac
index 8873c87..a25160b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
-AC_INIT([rpm-mageia-setup],[2.80],[https://bugs.mageia.org/])
+AC_INIT([rpm-mageia-setup],[2.83],[https://bugs.mageia.org/])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.9 -Wno-portability foreign no-dist-gzip dist-xz)
AC_CONFIG_SRCDIR
diff --git a/macros.in b/macros.in
index 35168fa..1020af0 100644
--- a/macros.in
+++ b/macros.in
@@ -293,6 +293,16 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} -
%{warn:%%setup_compile_flags is deprecated, use %%set_build_flags instead} \
%set_build_flags
+# Automatically use set_build_flags macro for build, check, and
+# install phases.
+# Use "%undefine _auto_set_build_flags" to disable"
+%_auto_set_build_flags 1
+%__spec_build_pre %{___build_pre} \
+ %{?_auto_set_build_flags:%{set_build_flags}}
+
+%__spec_check_pre %{___build_pre} \
+ %{?_auto_set_build_flags:%{set_build_flags}}
+
%debugcflags %{?_enable_debug_packages:-g}
%_fortify_level 3
@@ -518,6 +528,7 @@ if [ %{_with install} -eq 1 ]; then\
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "${RPM_BUILD_ROOT}"\
mkdir -p `dirname "$RPM_BUILD_ROOT"`\
mkdir "$RPM_BUILD_ROOT"\
+ %{?_auto_set_build_flags:%{set_build_flags}}\
fi
#---------------------------------------------------------------------
diff --git a/perl.recommends-from-meta b/perl.recommends-from-meta
new file mode 100755
index 0000000..c0c7521
--- /dev/null
+++ b/perl.recommends-from-meta
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use JSON qw{ from_json };
+use YAML qw{ Load };
+
+# slurp the file
+my $path = <>;
+chomp($path);
+open my $fh, '<', $path or die "can't open $path: $!";
+my $data = do { local $/; <$fh> };
+close $fh;
+
+# parse meta - either yaml or json
+my $meta = $path =~ /\.yml$/
+ ? Load( $data )
+ : from_json( $data );
+
+# dump the recommends with their version
+my $recommends = $meta->{"meta-spec"}{version} >= 2
+ ? $meta->{prereqs}{runtime}{recommends}
+ : $meta->{recommends};
+foreach my $module ( sort keys %$recommends ) {
+ next if $module eq 'perl'; # minimum perl version
+ my $version = $recommends->{$module};
+ if ( $version == 0 ) {
+ print "perl($module)\n";
+ } else {
+ my $v = qx{ rpm --eval '%perl_convert_version $version' };
+ print "perl($module) >= $v";
+ }
+}
+
+exit;
+
+=head1 NAME
+
+perl.recommends-from-meta - extract recommends from meta file
+
+=head1 SYNOPSIS
+
+ $ perl.recommends-from-meta /path/to/META.yml
+ $ perl.recommends-from-meta /path/to/META.json
+
+=head1 DESCRIPTION
+
+This script will extract Perl recommends from the distribution meta
+file. For each such recommends, it'll convert the minimum version to
+follow Mageia perl versioning (using C<%perl_convert_version>), and
+print them as:
+
+ perl(Foo::Bar)
+ perl(App::Frobnizer) >= 1.23.456
+
+Minimum perl version are skipped.
diff --git a/perl_from_meta.attr b/perl_from_meta.attr
index cabf1b0..4a44c19 100644
--- a/perl_from_meta.attr
+++ b/perl_from_meta.attr
@@ -1,2 +1,3 @@
+%__perl_from_meta_recommends %{_rpmconfigdir}/mageia/perl.recommends-from-meta
%__perl_from_meta_requires %{_rpmconfigdir}/mageia/perl.req-from-meta
%__perl_from_meta_path /(META.json|(MY|)META.yml)$