3 %bcond_without tests # do not perform "make test"
7 %include /usr/lib/rpm/macros.perl
8 Summary: File::FcntlLock - File locking with fcntl(2)
10 Name: perl-File-FcntlLock
14 Group: Development/Languages/Perl
15 Source0: http://www.cpan.org/modules/by-module/File/%{pdir}-%{pnam}-%{version}.tar.gz
16 # Source0-md5: 261aa44a9806181ae8fdf49bead7f828
17 # generic URL, check or change before uncommenting
18 #URL: http://search.cpan.org/dist/File-FcntlLock/
19 BuildRequires: perl-devel >= 1:5.8.0
20 BuildRequires: rpm-perlprov >= 4.1-13
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 File locking in Perl is usually done using the flock() function.
27 Unfortunately, this only allows locks on whole files and is often
28 implemented in terms of flock(2), which has some shortcomings.
30 Using this module file locking via fcntl(2) can be done (obviously,
31 this restricts the use of the module to systems that have a fcntl(2)
32 system call). Before a file (or parts of a file) can be locked, an
33 object simulating a flock structure must be created and its properties
34 set. Afterwards, by calling the lock() method a lock can be set or it
35 can be determined if and which process currently holds the lock.
37 To create a new object representing a flock structure call new():
39 $fs = new File::FcntlLock;
41 You also can pass the new() method a set of key-value pairs to
42 initialize the objects properties, e.g. use
44 # %description -l pl.UTF-8
48 %setup -q -n %{pdir}-%{pnam}-%{version}
51 %{__perl} Makefile.PL \
55 OPTIMIZE="%{rpmcflags}"
57 %{?with_tests:%{__make} test}
60 rm -rf $RPM_BUILD_ROOT
62 %{__make} pure_install \
63 DESTDIR=$RPM_BUILD_ROOT
66 rm -rf $RPM_BUILD_ROOT
69 %defattr(644,root,root,755)
71 %{perl_vendorarch}/File/*.pm
72 %dir %{perl_vendorarch}/auto/File/FcntlLock
73 %attr(755,root,root) %{perl_vendorarch}/auto/File/FcntlLock/*.so