]>
Commit | Line | Data |
---|---|---|
91da37eb | 1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
a03f5484 | 4 | |
91da37eb | 5 | %define pdir File |
6 | %define pnam FcntlLock | |
91da37eb | 7 | Summary: File::FcntlLock - File locking with fcntl(2) |
91da37eb | 8 | Name: perl-File-FcntlLock |
9 | Version: 0.14 | |
ef7cbed9 | 10 | Release: 13 |
91da37eb | 11 | License: unknown |
12 | Group: Development/Languages/Perl | |
13 | Source0: http://www.cpan.org/modules/by-module/File/%{pdir}-%{pnam}-%{version}.tar.gz | |
14 | # Source0-md5: 261aa44a9806181ae8fdf49bead7f828 | |
a03f5484 | 15 | URL: http://search.cpan.org/dist/File-FcntlLock/ |
91da37eb | 16 | BuildRequires: perl-devel >= 1:5.8.0 |
17 | BuildRequires: rpm-perlprov >= 4.1-13 | |
91da37eb | 18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
19 | ||
20 | %description | |
21 | File locking in Perl is usually done using the flock() function. | |
22 | Unfortunately, this only allows locks on whole files and is often | |
23 | implemented in terms of flock(2), which has some shortcomings. | |
24 | ||
25 | Using this module file locking via fcntl(2) can be done (obviously, | |
26 | this restricts the use of the module to systems that have a fcntl(2) | |
27 | system call). Before a file (or parts of a file) can be locked, an | |
28 | object simulating a flock structure must be created and its properties | |
29 | set. Afterwards, by calling the lock() method a lock can be set or it | |
30 | can be determined if and which process currently holds the lock. | |
31 | ||
32 | To create a new object representing a flock structure call new(): | |
33 | ||
34 | $fs = new File::FcntlLock; | |
35 | ||
36 | You also can pass the new() method a set of key-value pairs to | |
37 | initialize the objects properties, e.g. use | |
38 | ||
91da37eb | 39 | %prep |
40 | %setup -q -n %{pdir}-%{pnam}-%{version} | |
41 | ||
42 | %build | |
43 | %{__perl} Makefile.PL \ | |
44 | INSTALLDIRS=vendor | |
45 | %{__make} \ | |
46 | CC="%{__cc}" \ | |
47 | OPTIMIZE="%{rpmcflags}" | |
48 | ||
49 | %{?with_tests:%{__make} test} | |
50 | ||
51 | %install | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | ||
54 | %{__make} pure_install \ | |
55 | DESTDIR=$RPM_BUILD_ROOT | |
56 | ||
57 | %clean | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | ||
60 | %files | |
61 | %defattr(644,root,root,755) | |
62 | %doc Changes README | |
63 | %{perl_vendorarch}/File/*.pm | |
64 | %dir %{perl_vendorarch}/auto/File/FcntlLock | |
91da37eb | 65 | %attr(755,root,root) %{perl_vendorarch}/auto/File/FcntlLock/*.so |
66 | %{_mandir}/man3/* |