%define scl rh-python36 %{?scl:%scl_package %{name}} %{!?scl:%global pkg_name %{name}} %define name lockfile %define version 0.12.2 %define unmangled_version 0.12.2 %define unmangled_version 0.12.2 %define release 1 Summary: Platform-independent file locking module %{?scl:Requires: %{scl}-runtime} %{?scl:BuildRequires: %{scl}-runtime} Name: %{?scl_prefix}lockfile Version: %{version} Release: %{release} Source0: lockfile-%{unmangled_version}.tar.gz License: UNKNOWN Group: Development/Libraries BuildRoot: %{_tmppath}/lockfile-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Vendor: OpenStack Packager: Martin Juhl Url: http://launchpad.net/pylockfile %description Note: This package is **deprecated**. It is highly preferred that instead of using this code base that instead `fasteners`_ or `oslo.concurrency`_ is used instead. For any questions or comments or further help needed please email `openstack-dev`_ and prefix your email subject with ``[oslo][pylockfile]`` (for a faster response). The lockfile package exports a LockFile class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the fcntl.lockf and flock functions, and the deprecated posixfile module, the API is identical across both Unix (including Linux and Mac) and Windows platforms. The lock mechanism relies on the atomic nature of the link (on Unix) and mkdir (on Windows) system calls. An implementation based on SQLite is also provided, more as a demonstration of the possibilities it provides than as production-quality code. Note: In version 0.9 the API changed in two significant ways: * It changed from a module defining several classes to a package containing several modules, each defining a single class. * Where classes had been named SomethingFileLock before the last two words have been reversed, so that class is now SomethingLockFile. The previous module-level definitions of LinkFileLock, MkdirFileLock and SQLiteFileLock will be retained until the 1.0 release. To install: python setup.py install * Documentation: http://docs.openstack.org/developer/pylockfile * Source: http://git.openstack.org/cgit/openstack/pylockfile * Bugs: http://bugs.launchpad.net/pylockfile %prep %{?scl:scl enable %{scl} - << \EOF} set -ex %setup -n lockfile-%{unmangled_version} -n lockfile-%{unmangled_version} %{?scl:EOF} %build %{?scl:scl enable %{scl} - << \EOF} set -ex python3 setup.py build %{?scl:EOF} %install %{?scl:scl enable %{scl} - << \EOF} set -ex python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES %{?scl:EOF} %clean %{?scl:scl enable %{scl} - << \EOF} set -ex rm -rf $RPM_BUILD_ROOT %{?scl:EOF} %files -f INSTALLED_FILES %defattr(-,root,root)