jquelin/cpanplus-dist-mageia — pull request #2 by bgmilne (2012-06-19 11:31:47+00:00)
Title: Use RPM macros for all dirs, instead of assuming the layout under %_topdir

Before this change, CPANPLUS::Dist::Mageia assumes there will be a
layout %{_topdir}/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}, but rpm allows and
supports customisation of all of these locations via the macros:
- %{_builddir}
- %{_rpmdir}
- %{_sourcesdir}
- %{_specdir
- %{_srpmsdir}
- %{_tmppath}

If the directory layout CPANPLUS::Dist::Mageia expects does not exist,
the error:
[ERROR] Format 'CPANPLUS::Dist::Mageia' is not available
even though the subsequent rpmbuild commands would work.

This patch corrects that, by using the locations for _builddir, _rpmdir,
_sourcesdir, _specdir, and _srpmsdir. _tmppath is not strictly required,
since the %buildroot macro is created from _builddir.

It is debateable whether _builddir should be added or not, as the module
itself does not write or read any files from the location built from
this macro (as it does for rpm,source,spec,srcrpm).