Filtering requires/provides

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The current suggestion on the Packaging/Perl wiki page is (for Requires, Provides works the same) is:

----------------------------------------------------------------------
# Filter unwanted Requires:
cat << \EOF > %{name}-req
#!/bin/sh
%{__perl_requires} $* |\
  sed -e '/perl(unwanted_require)/d'
EOF

%define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
chmod +x %{__perl_requires}
----------------------------------------------------------------------

This won't work for the majority of perl modules because the build directory is %{_builddir}/MODULENAME-%{version} rather than %{_builddir}/%{name}-%{version}.

A simpler way that avoids generating script files at all might be:

%global filtered_requires sh -c '%{__perl_requires} "$@" | %{__sed} -e "/^perl(unwanted_require)$/d"'
%define __perl_requires %{filtered_requires}

Anyone see any problems with this?

P.S. I'm not an rpm macro expert and don't really know the significance of %global but using %define in its place results in a recursive macro definition, which doesn't work.

Paul.


[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux