%define pkg_name POE-Component-LaDBI %define pkg_version 1.2.1 %define rpm_pkg_version 1.2.1 %define rpm_pkg_release 1.n0i.1 %define __perl_requires %{_tmppath}/%{name}-%{version}-%{release}.requires Summary: POE Component offering non-blocking access to the DBI API Name: perl-%{pkg_name} Version: %{rpm_pkg_version} %if "%{pkg_version}" == "%{rpm_pkg_version}" Release: %{rpm_pkg_release} %else Release: %{rpm_pkg_release}.%(echo %{pkg_version} | tr - _) %endif Group: Development/Libraries License: GPL or Artistic URL: http://search.cpan.org/dist/%{pkg_name}/ Source0: ftp://ftp.cpan.org/authors/id/R/RD/RDB/%{pkg_name}-%{pkg_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: perl(:MODULE_COMPAT_%(%{__perl} -le 'printf "%%vd", $^V')) Requires: perl(DBI) >= 1.20 Requires: perl(POE) >= 0.18 %{!?_without_test:BuildRequires: perl(DBI) >= 1.20} %{!?_without_test:BuildRequires: perl(POE) >= 0.18} %description POE::Component::LaDBI is a POE Component to allow for non-blocking access to most of the DBI API. Each LaDBI component session started spawns a sub-process which it communicates with via POE::Wheel::Run. Multiple DBI database handles can be created in the sub-process, but within the sub-process DBI calls will still block. %prep %setup -n %{pkg_name}-%{pkg_version} # better disable tests rather than hacking around the ugly Makefile.PL :( %{__perl} -pi -e 's{if \(read_answer_yes}{if (0 && read_answer_yes}' Makefile.PL find . -type f | xargs -r chmod 0644 %build PERL_MM_USE_DEFAULT=1 %{__perl} Makefile.PL INSTALLDIRS=vendor %{__make} # no DBMS available (yet)? %{!?_without_test:%{__make} test || :} %install %{__rm} -rf $RPM_BUILD_ROOT %{__make} pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorlib}/POE/Component/example.pl %{__rm} -f $RPM_BUILD_ROOT%{perl_vendorlib}/POE/Component/ladbi_config.pl find $RPM_BUILD_ROOT -name .packlist -delete || : find $RPM_BUILD_ROOT -type f -name '*.bs' -a -empty -delete || : find $RPM_BUILD_ROOT -depth -type d -a -empty -delete || : %{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' example.pl %{__chmod} -R u+w $RPM_BUILD_ROOT/* find $RPM_BUILD_ROOT | xargs -r touch # custom requires script %{__cat} < %{__perl_requires} #!%{_buildshell} %{__cat} | %{__grep} -v $RPM_BUILD_ROOT%{_docdir} | /usr/lib/rpm/perl.req $* \ | %{__grep} -v 'perl(v5' EOF %{__chmod} 700 %{__perl_requires} %clean %{__rm} -rf $RPM_BUILD_ROOT %{__rm} -f %{__perl_requires} %files %defattr(-,root,root,-) %doc ChangeLog Changes example.pl README %{perl_vendorlib}/* %{_mandir}/man*/* %changelog * Sat Jul 30 2005 Marius Feraru 1.2.1-1.n0i.1 - spec file (re)created using N0i::CPAN::RPMizer/1.01 - rebuild on perl 5.8.7