%define perl_vendorlib %(eval "`%{_bindir}/perl -V:installvendorlib`"; echo $installvendorlib) Summary: XML-SAX Perl module Name: perl-XML-SAX Version: 0.99 Release: 1 Group: Development/Libraries License: GPL+ or Artistic URL: http://search.cpan.org/dist/XML-SAX/ Source0: http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch BuildRequires: perl-NamespaceSupport >= 0.03 BuildRequires: perl-XML-SAX-Base Requires: perl(:MODULE_COMPAT_%(eval "`%{_bindir}/perl -V:version`"; echo $version)) Requires: perl >= 5.8.8 Requires: perl-XML-LibXML, perl-XML-LibXML-Common %description XML::SAX consists of several framework classes for using and building Perl SAX2 XML parsers, filters, and drivers. It is designed around the need to be able to "plug in" different SAX parsers to an application without requiring programmer intervention. Those of you familiar with the DBI will be right at home. Some of the designs come from the Java JAXP specification (SAX part), only without the javaness. %prep %setup -q -n XML-SAX-%{version} %build %{_bindir}/perl Makefile.PL INSTALLDIRS=vendor make %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} make pure_install PERL_INSTALL_ROOT=${RPM_BUILD_ROOT} find ${RPM_BUILD_ROOT} -type f -name .packlist -exec rm -f {} ';' find ${RPM_BUILD_ROOT} -type d -depth -exec rmdir {} 2>/dev/null ';' chmod -R u+w ${RPM_BUILD_ROOT}/* touch ${RPM_BUILD_ROOT}%{perl_vendorlib}/XML/SAX/ParserDetails.ini %post if [ ! -f "%{perl_vendorlib}/XML/SAX/ParserDetails.ini" ] ; then %{_bindir}/perl -MXML::SAX -e \ 'XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()' 2>/dev/null || : else cp -p "%{perl_vendorlib}/XML/SAX/ParserDetails.ini" "%{perl_vendorlib}/XML/SAX/ParserDetails.ini.backup" fi %triggerun -- perl-XML-LibXML < 1.58-8 if [ -f "%{perl_vendorlib}/XML/SAX/ParserDetails.ini.backup" ] ; then mv "%{perl_vendorlib}/XML/SAX/ParserDetails.ini.backup" "%{perl_vendorlib}/XML/SAX/ParserDetails.ini" fi %preun # create backup of ParserDetails.ini, therefore user's configuration is used if [ $1 -eq 0 ] ; then %{_bindir}/perl -MXML::SAX -e \ 'XML::SAX->remove_parser(q(XML::SAX::PurePerl))->save_parsers()' || : fi [ -f "%{perl_vendorlib}/XML/SAX/ParserDetails.ini.backup" ] && \ rm -rf "%{perl_vendorlib}/XML/SAX/ParserDetails.ini.backup" || : %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc Changes LICENSE README %dir %{perl_vendorlib}/XML %{perl_vendorlib}/XML/SAX.pm %dir %{perl_vendorlib}/XML/SAX %{perl_vendorlib}/XML/SAX/*.pm %{perl_vendorlib}/XML/SAX/*.pod %{perl_vendorlib}/XML/SAX/PurePerl %{_mandir}/man3/* %ghost %{perl_vendorlib}/XML/SAX/ParserDetails.ini %changelog * Wed Nov 16 2011 Michael Perzl - 0.99-1 - first version for AIX V5.1 and higher