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