]>
Commit | Line | Data |
---|---|---|
dffe3eff | 1 | # |
2 | # Conditional build: | |
79020ee1 | 3 | %bcond_without tests # Do not perform "make test" |
a4a5f643 | 4 | |
ad4a3462 | 5 | %define pdir DBIx |
6 | %define pnam BLOB-Handle | |
a4a5f643 | 7 | %include /usr/lib/rpm/macros.perl |
4e41dc2d | 8 | Summary: DBIx::BLOB::Handle - read database large object binaries from file handles |
e127222d | 9 | Summary(pl.UTF-8): DBIx::BLOB::Handle - czytanie obiektów BLOB z uchwytów plików |
dffe3eff | 10 | Name: perl-DBIx-BLOB-Handle |
11 | Version: 0.2 | |
8c19bd9f | 12 | Release: 6 |
dffe3eff | 13 | License: Artistic |
14 | Group: Development/Languages/Perl | |
7b61f776 | 15 | Source0: http://www.cpan.org/modules/by-module/%{pdir}/%{pdir}-%{pnam}-%{version}.tar.gz |
19c507e8 | 16 | # Source0-md5: e23fbc1e9ca23295847cb94780262757 |
a4a5f643 | 17 | URL: http://search.cpan.org/dist/DBIx-BLOB-Handle/ |
92ab2366 | 18 | BuildRequires: perl-DBI |
a4a5f643 | 19 | BuildRequires: perl-devel >= 1:5.8.0 |
f1f854c5 | 20 | BuildRequires: rpm-perlprov >= 4.1-13 |
dffe3eff | 21 | BuildArch: noarch |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
3b09b8eb JB |
25 | DBI has a blob_copy_to_file method which takes a file handle argument |
26 | and copies a database large object binary (LOB) to this file handle. | |
27 | However, the method is undocumented and faulty. Constructing a similar | |
28 | method yourself is pretty simple but what if you wished to read the | |
29 | data and perform operations on it? You could use the DBI's blob_read | |
30 | method yourself to process chunks of data from the LOB or even dump | |
31 | its contents into a scalar, but maybe it would be nice to read the | |
32 | data line by line or piece by piece from a familiar old filehandle?! | |
33 | ||
f3e9871c JR |
34 | %description -l pl.UTF-8 |
35 | DBI ma metodę blob_copy_to_file, która przyjmuje parametr będący | |
36 | uchwytem pliku i kopiuje duże obiekty bazodanowe (LOB) do tego | |
37 | uchwytu. Mimo to, ta metoda jest nieudokumentowana i zawiera błędy. | |
38 | Stworzenie podobnej metody jest proste, ale co jeśli trzeba czytać | |
39 | dane i przeprowadzać na nich operacje? Można użyć metody blob_read z | |
40 | DBI do przetwarzania fragmentów danych z obiektu LOB albo nawet | |
41 | zrzucać zawartość do zmiennej, ale może przyjemniej jest czytać dane | |
42 | linia po linii lub kawałek po kawałku z normalnego uchwytu pliku? | |
dffe3eff | 43 | |
44 | %prep | |
45 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
46 | ||
47 | %build | |
f1f854c5 | 48 | %{__perl} Makefile.PL \ |
d433d7ee | 49 | INSTALLDIRS=vendor |
dffe3eff | 50 | %{__make} |
3b09b8eb | 51 | |
79020ee1 | 52 | %{?with_tests:%{__make} test} |
dffe3eff | 53 | |
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | ||
2909a227 | 57 | %{__make} install \ |
58 | DESTDIR=$RPM_BUILD_ROOT | |
dffe3eff | 59 | |
60 | %clean | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %files | |
64 | %defattr(644,root,root,755) | |
f1f854c5 | 65 | %dir %{perl_vendorlib}/DBIx/BLOB |
66 | %{perl_vendorlib}/DBIx/BLOB/*.pm | |
dffe3eff | 67 | %{_mandir}/man3/* |