#6 Don't require unneeded dependencies like gcc and *-devel for runtime perl module use
Opened 5 months ago by cmadams. Modified 2 months ago
rpms/ cmadams/net-snmp rawhide  into  rawhide

file modified
+33 -12
@@ -10,7 +10,7 @@ 

  Summary:    A collection of SNMP protocol tools and libraries

  Name:       net-snmp

  Version:    5.9.3

- Release:    2%{?dist}

+ Release:    3%{?dist}

  Epoch:      1

  

  License:    BSD
@@ -136,8 +136,20 @@ 

  tools. You'll also need to have the net-snmp and net-snmp-utils

  packages installed.

  

+ %package perl-module

+ Summary:       The perl NET-SNMP module

+ Requires:      %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter

+ BuildRequires: perl-interpreter

+ BuildRequires: perl-generators

+ 

+ %description perl-module

+ The net-snmp-perl package contains the perl files to use SNMP from within

+ Perl.

+ 

+ Install the net-snmp-perl package, if you want to use SNMP with perl.

+ 

  %package perl

- Summary:       The perl NET-SNMP module and the mib2c tool

+ Summary:       The perl-based utilities and the mib2c tool

  Requires:      %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter

  Requires:      %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release}

  Requires:      %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
@@ -145,15 +157,17 @@ 

  BuildRequires: perl-generators

  

  %description perl

- The net-snmp-perl package contains the perl files to use SNMP from within

- Perl.

+ The net-snmp-perl package contains the utilities written in perl.

  

- Install the net-snmp-perl package, if you want to use mib2c or SNMP 

- with perl.

+ Install the net-snmp-perl package, if you want to use mib2c or other

+ perl utilities. Use the net-snmp-perl-module package instead to get the

+ SNMP perl module.

  

  %package gui

  Summary:  An interactive graphical MIB browser for SNMP

- Requires: perl-Tk, net-snmp-perl%{?_isa} = %{epoch}:%{version}-%{release}

+ Requires: perl-Tk, %{name}-perl-module%{?_isa} = %{epoch}:%{version}-%{release}

+ BuildRequires: perl-interpreter

+ BuildRequires: perl-generators

  

  %description gui

  The net-snmp-gui package contains tkmib utility, which is a graphical user 
@@ -336,6 +350,7 @@ 

  rm -f %{buildroot}/%{_bindir}/ipf-mod.pl

  rm -f %{buildroot}/%{_libdir}/*.la

  rm -f %{buildroot}/%{_libdir}/libsnmp*

+ rm -f %{buildroot}/%{_libdir}/perl5/vendor_perl/Bundle/MakefileSubs.pm

  

  # remove special perl files

  find %{buildroot} -name perllocal.pod \
@@ -445,6 +460,12 @@ 

  %attr(0755,root,root) %{_bindir}/net-snmp-config*

  %attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.*

  

+ %files perl-module

+ %attr(0644,root,root) %{_mandir}/man3/*.3pm.*

+ %{perl_vendorarch}/*SNMP*

+ %{perl_vendorarch}/auto/*SNMP*

+ %{perl_vendorarch}/auto/Bundle/*SNMP*

+ 

  %files perl

  %{_bindir}/mib2c-update

  %{_bindir}/mib2c
@@ -456,13 +477,8 @@ 

  %{_datadir}/snmp/*.pl

  %{_bindir}/traptoemail

  %attr(0644,root,root) %{_mandir}/man[15]/mib2c*

- %attr(0644,root,root) %{_mandir}/man3/*.3pm.*

  %attr(0644,root,root) %{_mandir}/man1/traptoemail*.1*

  %attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1*

- %{perl_vendorarch}/*SNMP*

- %{perl_vendorarch}/auto/*SNMP*

- %{perl_vendorarch}/auto/Bundle/*SNMP*

- %{perl_vendorarch}/Bundle/MakefileSubs.pm

  

  %files -n python3-net-snmp

  %doc README
@@ -490,6 +506,11 @@ 

  %{_libdir}/libnetsnmptrapd*.so.%{soname}*

  

  %changelog

+ * Mon Mar 13 2023 Chris Adams <linux@cmadams.net> - 1:5.9.3-2

+ - split perl module into separate package that doesn't pull in gcc and

+   other build dependencies

+ - don't install MakefileSubs.pm - it's just needed at module build time

+ 

  * Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.9.3-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

  

This changes the perl/MakefileSubs.pm module from getting build flags at runtime to configure time, and splits off the perl module itself into a separate package, so that runtime use of the perl SNMP module doesn't pull in net-snmp-config (and dependencies for building things, like gcc and a bunch of -devel packages).

Good idea. Have you tried to propose this patch to net-snmp upstream as well? If so, do you have link to PR?

I had not... but that's a good idea.

I just jumped into perl/MakefileSubs.pm to drop the net-snmp-config calls without really looking at the bigger picture - it's really that, as far as I can tell, that file is only used for build (called from the various perl Makefile.PL files) and shouldn't be installed at all. I'm not familiar enough with perl's Extutils::MakeMaker to see how to exclude a .pm file from getting installed... would a spec file patch that just deletes it after install be acceptable?

2 new commits added

  • Drop MakefileSubs.pm from perl-module
  • Revert "Make perl/MakefileSubs.pm get build flags at configure time, rather than runtime"
5 months ago

Any thoughts on doing it this way?

Is there any interest in this?

Metadata