withlock/withlock.spec
Ismail Dönmez fe9d84134b Accepting request 244786 from home:mcaj:branches:Base:System
- I wrote a patch got-lock.patch to fix the trouble with the got-lock variable.I was testing the withlock and still had there the lock file after a  program already end with exit code 0. I have look on the code together with our Python expert mvidner@suse.cz and we found the got-lock variable  isn't marked ad global variable. We have tested it and with the patch the program is working very well. I send this patch also to upstream (poeml@cmdline.net)

OBS-URL: https://build.opensuse.org/request/show/244786
OBS-URL: https://build.opensuse.org/package/show/Base:System/withlock?expand=0&rev=8
2014-08-15 11:48:58 +00:00

64 lines
2.0 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
# fixed trouble with not removed lock file bacuse got-lock was not global variable.
Patch0: got-lock.patch
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
%patch0 -p1
%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