2015-04-17 18:55:55 +00:00
|
|
|
#
|
|
|
|
# spec file for package perl-File-Flock
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-03-03 20:27:33 +00:00
|
|
|
|
|
|
|
Name: perl-File-Flock
|
2015-04-17 18:55:55 +00:00
|
|
|
Version: 2014.01
|
2011-03-03 20:27:33 +00:00
|
|
|
Release: 0
|
2015-04-17 18:55:55 +00:00
|
|
|
#Upstream: same terms as Perl itself.
|
|
|
|
%define cpan_name File-Flock
|
|
|
|
Summary: File Locking with Flock
|
|
|
|
License: Artistic-1.0 or GPL-1.0+
|
2011-03-03 20:27:33 +00:00
|
|
|
Group: Development/Libraries/Perl
|
2015-04-17 18:55:55 +00:00
|
|
|
Url: http://search.cpan.org/dist/File-Flock/
|
|
|
|
Source0: http://www.cpan.org/authors/id/M/MU/MUIR/modules/%{cpan_name}-%{version}.tar.gz
|
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:14:05 +02:00
|
|
|
Source100: README.md
|
2011-03-03 20:27:33 +00:00
|
|
|
BuildArch: noarch
|
2015-04-17 18:55:55 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
BuildRequires: perl(AnyEvent)
|
|
|
|
BuildRequires: perl(Data::Structure::Util)
|
|
|
|
BuildRequires: perl(File::Slurp)
|
|
|
|
BuildRequires: perl(IO::Event) >= 0.812
|
|
|
|
BuildRequires: perl(Module::Build)
|
|
|
|
BuildRequires: perl(Test::SharedFork)
|
|
|
|
Requires: perl(AnyEvent)
|
|
|
|
Requires: perl(Data::Structure::Util)
|
|
|
|
Requires: perl(File::Slurp)
|
|
|
|
Requires: perl(IO::Event) >= 0.812
|
|
|
|
Requires: perl(Test::SharedFork)
|
|
|
|
%{perl_requires}
|
2011-03-03 20:27:33 +00:00
|
|
|
|
|
|
|
%description
|
2015-04-17 18:55:55 +00:00
|
|
|
Lock files using the flock() call. If the file to be locked does not exist,
|
|
|
|
then the file is created. If the file was created then it will be removed
|
|
|
|
when it is unlocked assuming it's still an empty file.
|
|
|
|
|
|
|
|
Locks can be created by new'ing a *File::Flock* object. Such locks are
|
|
|
|
automatically removed when the object goes out of scope. The *unlock()*
|
2011-03-03 20:27:33 +00:00
|
|
|
method may also be used.
|
2015-04-17 18:55:55 +00:00
|
|
|
|
|
|
|
*lock_rename()* is used to tell File::Flock when a file has been renamed
|
2011-03-03 20:27:33 +00:00
|
|
|
(and thus the internal locking data that is stored based on the filename
|
2015-04-17 18:55:55 +00:00
|
|
|
should be moved to a new name). *unlock()* the new name rather than the
|
2011-03-03 20:27:33 +00:00
|
|
|
original name.
|
|
|
|
|
2015-04-17 18:55:55 +00:00
|
|
|
Locks are released on process exit when the process that created the lock
|
|
|
|
exits. Subprocesses that exit do not remove locks. Use forget_locks() or
|
|
|
|
POSIX::_exit() to prevent unlocking on process exit.
|
|
|
|
|
2011-03-03 20:27:33 +00:00
|
|
|
%prep
|
2015-04-17 18:55:55 +00:00
|
|
|
%setup -q -n %{cpan_name}-%{version}
|
|
|
|
find . -type f -print0 | xargs -0 chmod 644
|
2011-03-03 20:27:33 +00:00
|
|
|
|
|
|
|
%build
|
2015-04-17 18:55:55 +00:00
|
|
|
%{__perl} Build.PL installdirs=vendor
|
|
|
|
./Build build flags=%{?_smp_mflags}
|
2011-03-03 20:27:33 +00:00
|
|
|
|
|
|
|
%check
|
2015-04-17 18:55:55 +00:00
|
|
|
./Build test
|
2011-03-03 20:27:33 +00:00
|
|
|
|
2015-04-17 18:55:55 +00:00
|
|
|
%install
|
|
|
|
./Build install destdir=%{buildroot} create_packlist=0
|
|
|
|
%perl_gen_filelist
|
2011-03-03 20:27:33 +00:00
|
|
|
|
2015-04-17 18:55:55 +00:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
|
|
|
%doc Changes README
|
2011-03-03 20:27:33 +00:00
|
|
|
|
2015-04-17 18:55:55 +00:00
|
|
|
%changelog
|