From 85cbafeee8587e016f6cc0795c39b5310e62676c Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Tue, 10 Jan 2023 16:09:40 +0100 Subject: [PATCH] Initial import --- .gitignore | 0 perl-generators-epel.spec | 40 +++++++++++++++++++++++++++++++++++++++ perlcompat.attr.epel8 | 2 ++ perlcompat.attr.epel9 | 10 ++++++++++ perlcompat.req | 7 +++++++ sources | 0 6 files changed, 59 insertions(+) create mode 100644 .gitignore create mode 100644 perl-generators-epel.spec create mode 100644 perlcompat.attr.epel8 create mode 100644 perlcompat.attr.epel9 create mode 100644 perlcompat.req create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/perl-generators-epel.spec b/perl-generators-epel.spec new file mode 100644 index 0000000..77cb092 --- /dev/null +++ b/perl-generators-epel.spec @@ -0,0 +1,40 @@ +Name: perl-generators-epel +Version: 1 +Release: 1%{?dist} +Summary: RPM Perl dependencies generators for EPEL +URL: https://src.fedoraproject.org/rpms/perl-generators-epel +License: GPL-1.0-or-later +Source0: perlcompat.attr.epel9 +Source1: perlcompat.attr.epel8 +Source2: perlcompat.req +BuildArch: noarch +Requires: coreutils +Requires: perl-macros +Requires: rpm + +%description +This package provides RPM Perl dependency generator which is used for +getting run-time requirements perl(:MODULE_COMPAT_XXX) and perl-libs based +on files which are in the package on EPEL. + +%install +%if 0%{?rhel} == 9 +install -pm 0644 -D "%{SOURCE0}" \ + '%{buildroot}%{_rpmconfigdir}/fileattrs/perlcompat.attr' +%endif +%if 0%{?rhel} && 0%{?rhel} <= 8 +install -pm 0644 -D "%{SOURCE1}" \ + '%{buildroot}%{_rpmconfigdir}/fileattrs/perlcompat.attr' +install -pm 0755 -D "%{SOURCE2}" \ + '%{buildroot}%{_rpmconfigdir}/perlcompat.req' +%endif + +%files +%{_rpmconfigdir}/fileattrs/perlcompat.attr +%if 0%{?rhel} && 0%{?rhel} <= 8 +%{_rpmconfigdir}/perlcompat.req +%endif + +%changelog +* Mon Jan 09 2023 Jitka Plesnikova - 1-1 +- Initial version of the package diff --git a/perlcompat.attr.epel8 b/perlcompat.attr.epel8 new file mode 100644 index 0000000..73cae0c --- /dev/null +++ b/perlcompat.attr.epel8 @@ -0,0 +1,2 @@ +%__perlcompat_requires %{_rpmconfigdir}/perlcompat.req %{perl_version} +%__perlcompat_path ^(%{perl_vendorarch}|%{perl_vendorlib}|%{perl_privlib}|%{perl_archlib})/.+ diff --git a/perlcompat.attr.epel9 b/perlcompat.attr.epel9 new file mode 100644 index 0000000..951d51b --- /dev/null +++ b/perlcompat.attr.epel9 @@ -0,0 +1,10 @@ +%__perlcompat_requires() %{lua: + local path = rpm.expand('%1') + local perl_ver = rpm.expand('%{perl_version}') + if path:match('.+%.so$') and perl_ver ~= "" then + print('perl(:MODULE_COMPAT_' .. perl_ver .. ')') + else + print('perl-libs') + end +} +%__perlcompat_path ^(%{perl_vendorarch}|%{perl_vendorlib}|%{perl_privlib}|%{perl_archlib})/.+ diff --git a/perlcompat.req b/perlcompat.req new file mode 100644 index 0000000..3d1e102 --- /dev/null +++ b/perlcompat.req @@ -0,0 +1,7 @@ +#!/bin/bash +PERL_VERSION=$1 +if [ -n "$PERL_VERSION" ]; then + echo "perl(:MODULE_COMPAT_$PERL_VERSION)" +else + echo "perl-libs" +fi diff --git a/sources b/sources new file mode 100644 index 0000000..e69de29