69 lines
2.5 KiB
RPMSpec
69 lines
2.5 KiB
RPMSpec
|
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
|
||
|
|
||
|
Name: perl-XML-Filter-BufferText
|
||
|
Version: 1.01
|
||
|
Release: 3mamba
|
||
|
Summary: XML::Filter::BufferText - Filter to put all characters() in one event
|
||
|
Group: System/Libraries/Perl
|
||
|
Vendor: openmamba
|
||
|
Distribution: openmamba
|
||
|
Packager: Automatic Build System <autodist@mambasoft.it>
|
||
|
URL: http://www.cpan.org
|
||
|
Source: http://search.cpan.org/CPAN/authors/id/R/RB/RBERJON/XML-Filter-BufferText-%{version}.tar.gz
|
||
|
License: Artistic
|
||
|
Requires: perl >= %perl_major_ver
|
||
|
## AUTOBUILDREQ-BEGIN
|
||
|
BuildRequires: perl-devel >= %perl_major_ver
|
||
|
## AUTOBUILDREQ-END
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||
|
|
||
|
%description
|
||
|
This is a very simple filter. One common cause of grief (and programmer error) is that XML parsers aren't required to provide character events in one chunk. They can, but are not forced to, and most don't. This filter does the trivial but oft-repeated task of putting all characters into a single event.
|
||
|
|
||
|
Note that this won't help you cases such as:
|
||
|
|
||
|
<foo> blah <!-- comment --> phubar </foo>
|
||
|
|
||
|
In the above case, given the interleaving comment, there will be two character() events. This may be worked around in the future if there is demand for it.
|
||
|
|
||
|
An interesting way to use this filter, instead of telling users to use it, is to return it from your handler's constructor, already configured and all. That'll make the buffering totally transparent to them (XML::SAX::Writer does that).
|
||
|
|
||
|
%prep
|
||
|
|
||
|
%setup -q -n XML-Filter-BufferText-%{version}
|
||
|
|
||
|
%build
|
||
|
perl Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor
|
||
|
%make
|
||
|
%make test
|
||
|
|
||
|
%install
|
||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
|
%makeinstall_perl
|
||
|
packlist=`find %{buildroot} -name .packlist`
|
||
|
[ -z "$packlist" ] && exit 1 || cat $packlist | \
|
||
|
sed "s,%buildroot,,g;s,.*/man/.*,&.gz,g" | \
|
||
|
sort -u > .packlist && rm $packlist
|
||
|
|
||
|
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
|
||
|
for dir in `find %{buildroot} -type d | grep $strid`; do
|
||
|
echo "%dir ${dir#%buildroot}" >> .packlist
|
||
|
done
|
||
|
|
||
|
%clean
|
||
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
|
rm -f .packlist
|
||
|
|
||
|
%files -f .packlist
|
||
|
%defattr(-,root,root)
|
||
|
|
||
|
%changelog
|
||
|
* Tue Nov 13 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.01-3mamba
|
||
|
- perl 5.16 mass rebuild
|
||
|
|
||
|
* Wed Nov 05 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 1.01-2mamba
|
||
|
- automatic rebuild by autodist
|
||
|
|
||
|
* Mon Sep 15 2008 gil <puntogil@libero.it> 1.01-1mamba
|
||
|
- package created by autospec
|