+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+#
+%include /usr/lib/rpm/macros.perl
Summary: Create RPMS from CPAN modules
Summary(pl): Narzêdzie tworz±ce pakiety RPM z modu³ów CPAN
Name: cpan2rpm
-Version: 1.2
+Version: 2.021
Release: 1
-License: GPL/Artistic
+License: GPL
Group: Development/Languages/Perl
-Source0: %{name}-%{version}.tar.gz
-# Source0-md5: 70cc987bc884aa911dcf3bea7596f42e
+Source0: http://www.cpan.org/authors/id/E/EC/ECALDER/%{name}-%{version}.tar.gz
+# Source0-md5: 414bb20ad9c0b413e750f2382b4fdbad
+BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%setup -q
%build
+%{__perl} Makefile.PL \
+ INSTALLDIRS=vendor
+
+# avoid running cpan2rpm and using network
+touch cpan2rpm.spec
+
%{__make}
+%{?with_tests:%{__make} test}
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
-install cpan2rpm $RPM_BUILD_ROOT%{_bindir}/
-install cpan2rpm.1 $RPM_BUILD_ROOT%{_mandir}/man1/
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
+%doc Changes README
%attr(755,root,root) %{_bindir}/*
%{_mandir}/man1/*