3 %bcond_without tests # Do not perform "make test"
5 %include /usr/lib/rpm/macros.perl
7 %define pnam BLOB-Handle
8 Summary: DBIx::BLOB::Handle - read database large object binaries from file handles
9 Summary(pl.UTF-8): DBIx::BLOB::Handle - czytanie obiektów BLOB z uchwytów plików
10 Name: perl-DBIx-BLOB-Handle
14 Group: Development/Languages/Perl
15 Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz
16 # Source0-md5: e23fbc1e9ca23295847cb94780262757
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: perl-DBI
19 BuildRequires: rpm-perlprov >= 4.1-13
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 DBI has a blob_copy_to_file method which takes a file handle argument
25 and copies a database large object binary (LOB) to this file handle.
26 However, the method is undocumented and faulty. Constructing a similar
27 method yourself is pretty simple but what if you wished to read the
28 data and perform operations on it? You could use the DBI's blob_read
29 method yourself to process chunks of data from the LOB or even dump
30 its contents into a scalar, but maybe it would be nice to read the
31 data line by line or piece by piece from a familiar old filehandle?!
33 %description -l pl.UTF-8
34 DBI ma metodę blob_copy_to_file, która przyjmuje parametr będący
35 uchwytem pliku i kopiuje duże obiekty bazodanowe (LOB) do tego
36 uchwytu. Mimo to, ta metoda jest nieudokumentowana i zawiera błędy.
37 Stworzenie podobnej metody jest proste, ale co jeśli trzeba czytać
38 dane i przeprowadzać na nich operacje? Można użyć metody blob_read z
39 DBI do przetwarzania fragmentów danych z obiektu LOB albo nawet
40 zrzucać zawartość do zmiennej, ale może przyjemniej jest czytać dane
41 linia po linii lub kawałek po kawałku z normalnego uchwytu pliku?
44 %setup -q -n %{pdir}-%{pnam}-%{version}
47 %{__perl} Makefile.PL \
51 %{?with_tests:%{__make} test}
54 rm -rf $RPM_BUILD_ROOT
57 DESTDIR=$RPM_BUILD_ROOT
60 rm -rf $RPM_BUILD_ROOT
63 %defattr(644,root,root,755)
64 %dir %{perl_vendorlib}/DBIx/BLOB
65 %{perl_vendorlib}/DBIx/BLOB/*.pm