use strict; use warnings; use IPC::Run3; use Fedora::VSP; sub expand { my $input = shift; $input = '%{perl_macros 1}' . $input; my $output; eval { # rpm --macros overrides the default macro file run3(['rpm', '--macros=/usr/lib/rpm/macros:src/macros.perl2', '--eval=' . $input], \undef, \$output, \undef); }; if ($@) { diag("Could not execute command: $@\n"); return undef; } if ($?) { diag ("Command failed with wait status $?\n"); return undef; } return $output; } =head1 version Convert Perl version string into RPM-compatible. Or return the same string. =cut sub version { #Fedora::VSP::vsp(shift, 1) // ''; shift; } 1;