%define perl_vendorarch %(eval "`%{_bindir}/perl -V:installvendorarch`"; echo $installvendorarch) %define perl_vendorarch64 %(eval "`%{_bindir}/perl_64bit -V:installvendorarch`"; echo $installvendorarch) Name: perl-DBI Version: 1.607 Release: 1 Summary: A database access API for perl Group: Development/Libraries License: GPL+ or Artistic URL: http://dbi.perl.org/ Source0: http://www.cpan.org/authors/id/T/TI/TIMB/DBI-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: findutils Requires: perl(:MODULE_COMPAT_%(eval "`%{_bindir}/perl -V:version`"; echo $version)) Requires: perl >= 5.8.8 %description DBI is a database access Application Programming Interface (API) for the Perl Language. The DBI API Specification defines a set of functions, variables and conventions that provide a consistent database interface independent of the actual database being used. %prep %setup -q -n DBI-%{version} chmod 644 ex/* mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit/ %build cd 32bit %{_bindir}/perl Makefile.PL INSTALLDIRS="vendor" make cd ../64bit %{_bindir}/perl_64bit Makefile.PL INSTALLDIRS="vendor" make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd 32bit make pure_install PERL_INSTALL_ROOT=${RPM_BUILD_ROOT} cd ../64bit make pure_install PERL_INSTALL_ROOT=${RPM_BUILD_ROOT} /opt/freeware/bin/find ${RPM_BUILD_ROOT} -type f -name .packlist -exec rm -f {} ';' /opt/freeware/bin/find ${RPM_BUILD_ROOT} -type f -name '*.bs' -empty -exec rm -f {} ';' /opt/freeware/bin/find ${RPM_BUILD_ROOT} -type d -depth -exec rmdir {} 2>/dev/null ';' chmod -R u+w ${RPM_BUILD_ROOT}/* # Remove Win32 specific files and man pages to avoid unwanted dependencies rm -rf ${RPM_BUILD_ROOT}%{perl_vendorarch}/Win32 rm -rf ${RPM_BUILD_ROOT}%{perl_vendorarch64}/Win32 rm -rf ${RPM_BUILD_ROOT}%{perl_vendorarch}/DBI/W32ODBC.pm rm -rf ${RPM_BUILD_ROOT}%{perl_vendorarch64}/DBI/W32ODBC.pm rm -f ${RPM_BUILD_ROOT}%{_mandir}/man3/DBI::W32ODBC.3 rm -f ${RPM_BUILD_ROOT}%{_mandir}/man3/Win32::DBIODBC.3 %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/README 32bit/ex/ %{_bindir}/* %{perl_vendorarch}/* %{perl_vendorarch64}/* %{_mandir}/man1/*.1* %{_mandir}/man3/*.3* %changelog * Wed Oct 15 2008 Michael Perzl - 1.607-1 - first version for AIX V5.1 and higher