withlock/withlock.spec
Ismail Dönmez e17cacdc00 Accepting request 131512 from home:lrupp
The openSUSE admins make heavy use of this tool since years now. 
So I think it's time to include it officially in the next release of openSUSE and Base:System should be the devel project.

OBS-URL: https://build.opensuse.org/request/show/131512
OBS-URL: https://build.opensuse.org/package/show/Base:System/withlock?expand=0&rev=1
2012-08-24 19:49:33 +00:00

58 lines
1.9 KiB
RPMSpec

#
# spec file for package withlock
#
# Copyright (c) 2009-2012 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.2
Release: 1
License: Apache License, Version 2.0
Summary: A locking wrapper script
Url: http://code.google.com/p/withlock/
Group: System/Management
Requires: python
Source0: %{name}
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
#
%build
#
%install
install -Dm755 %{SOURCE0} %{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