- update to 0.3 * At exit, unlink the lock file only if a lock was actually obtained. When waiting for a lock (using -w option) and timing out, the file was removed nevertheless. Thanks Bernhard Wiedemann for finding this bug and providing such a good test case, so the fix was easy. See https://bugzilla.novell.com/show_bug.cgi?id=864785 OBS-URL: https://build.opensuse.org/request/show/227498 OBS-URL: https://build.opensuse.org/package/show/Base:System/withlock?expand=0&rev=6
60 lines
1.9 KiB
RPMSpec
60 lines
1.9 KiB
RPMSpec
#
|
|
# spec file for package withlock
|
|
#
|
|
# Copyright (c) 2014 SUSE LINUX Products 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/
|
|
#
|
|
|
|
|
|
Name: withlock
|
|
Version: 0.3
|
|
Release: 0
|
|
Summary: A locking wrapper script
|
|
License: Apache-2.0
|
|
Group: System/Management
|
|
Url: http://code.google.com/p/withlock/
|
|
Requires: python
|
|
Source0: http://mirrorbrain.org/files/releases/%{name}-%{version}.tar.gz
|
|
Source1: %name-README.SuSE
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildArch: noarch
|
|
|
|
%description
|
|
withlock is a locking wrapper script to make sure that some program isn't run
|
|
more than once. It is ideal to prevent periodic jobs spawned by cron from
|
|
stacking up.
|
|
|
|
The locks created are valid only while the wrapper is running, and thus will
|
|
never require a cleanup, as after a reboot. Thus, the wrapper is safe and easy
|
|
to use, and much better than implementing half-hearted locking within scripts.
|
|
|
|
%prep
|
|
%setup
|
|
#
|
|
%build
|
|
#
|
|
%install
|
|
install -Dm755 withlock %{buildroot}%{_bindir}/%{name}
|
|
install -Dm644 %{SOURCE1} %{buildroot}%{_defaultdocdir}/%{name}/README.SuSE
|
|
sed -i "s|/usr/bin/env python|%{_bindir}/python|g" %{buildroot}%{_bindir}/%{name}
|
|
|
|
%clean
|
|
rm -rf %{buildroot}
|
|
|
|
%files
|
|
%defattr(-, root, root)
|
|
%doc %{_defaultdocdir}/%{name}
|
|
%{_bindir}/%{name}
|
|
|
|
%changelog
|