From f8531d3f56cdad6dfbb6aac1f401876b86fa4e71 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 20 Sep 2016 23:57:12 -0700 Subject: [PATCH] Initial package --- .gitignore | 1 + python-filelock.spec | 117 +++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 119 insertions(+) create mode 100644 python-filelock.spec diff --git a/.gitignore b/.gitignore index e69de29..f630575 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/filelock-fde6c13.tar.gz diff --git a/python-filelock.spec b/python-filelock.spec new file mode 100644 index 0000000..0d4d41e --- /dev/null +++ b/python-filelock.spec @@ -0,0 +1,117 @@ +%global commit fde6c13718dd98ca50a9e3378f972706035b57c6 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global srcname filelock +%global sum A platform independent file lock + +Name: python-%{srcname} +Version: 2.0.6 +Release: 1%{?dist} +Summary: %{sum} + +Group: Development/Libraries +License: Unlicense +URL: https://github.com/benediktschmitt/py-%{srcname} +Source0: https://github.com/benediktschmitt/py-%{srcname}/archive/%{commit}.tar.gz#/%{srcname}-%{shortcommit}.tar.gz + +BuildArch: noarch + +%description +This package contains a single module, which implements a platform independent +file locking mechanism for Python. + +The lock includes a lock counter and is thread safe. This means, when locking +the same lock object twice, it will not block. + +%package doc +Summary: Documentation for %{srcname}, %{sum} +BuildRequires: python-sphinx +BuildRequires: python-sphinx_rtd_theme +Requires: fontawesome-fonts +Requires: google-roboto-slab-fonts +Requires: lato-fonts + +%description doc +Documentation for %{srcname}, %{sum} + +%package -n python2-%{srcname} +Summary: %{sum} +BuildRequires: python2-devel +%{?python_provide:%python_provide python2-%{srcname}} +Recommends: %{name}-doc + +%description -n python2-%{srcname} +This package contains a single module, which implements a platform independent +file locking mechanism for Python. + +The lock includes a lock counter and is thread safe. This means, when locking +the same lock object twice, it will not block. + +%package -n python3-%{srcname} +Summary: %{sum} +BuildRequires: python3-devel +%{?python_provide:%python_provide python3-%{srcname}} +Recommends: %{name}-doc + +%description -n python3-%{srcname} +This package contains a single module, which implements a platform independent +file locking mechanism for Python. + +The lock includes a lock counter and is thread safe. This means, when locking +the same lock object twice, it will not block. + +%prep +%autosetup -n py-%{srcname}-%{commit} + +sed -i '1{\@^#!/usr/bin/python@d}' %{srcname}.py + +%build +%py2_build +%py3_build + +make -C docs html man +rm docs/build/html/.buildinfo + +# Unbundle fonts +ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.eot docs/build/html/_static/fonts/fontawesome-webfont.eot +ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.svg docs/build/html/_static/fonts/fontawesome-webfont.svg +ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.ttf docs/build/html/_static/fonts/fontawesome-webfont.ttf +ln -sf %{_datadir}/fonts/fontawesome/fontawesome-webfont.woff docs/build/html/_static/fonts/fontawesome-webfont.woff +ln -sf %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Bold.ttf docs/build/html/_static/fonts/RobotoSlab-Bold.ttf +ln -sf %{_datadir}/fonts/google-roboto-slab/RobotoSlab-Regular.ttf docs/build/html/_static/fonts/RobotoSlab-Regular.ttf +ln -sf %{_datadir}/fonts/lato/Lato-Bold.ttf docs/build/html/_static/fonts/Lato-Bold.ttf +ln -sf %{_datadir}/fonts/lato/Lato-Regular.ttf docs/build/html/_static/fonts/Lato-Regular.ttf + +%install +%py2_install +%py3_install + +install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1 +rm %{buildroot}%{_prefix}/LICENSE.rst %{buildroot}%{_prefix}/README.rst + +%check +%{__python2} test.py +%{__python3} test.py + +%files doc +%doc docs/build/html +%license LICENSE.rst + +%files -n python2-%{srcname} +%doc README.rst +%license LICENSE.rst +%{_mandir}/man1/py-%{srcname}.1.gz +%{python2_sitelib}/%{srcname}.py +%{python2_sitelib}/%{srcname}.py[co] +%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info + +%files -n python3-%{srcname} +%doc README.rst +%license LICENSE.rst +%{_mandir}/man1/py-%{srcname}.1.gz +%{python3_sitelib}/%{srcname}.py +%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info +%{python3_sitelib}/__pycache__/%{srcname}*.py[co] + +%changelog +* Sun May 01 2016 Scott K Logan - 2.0.6-1 +- Initial package diff --git a/sources b/sources index e69de29..dfc6f95 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2f3a75f6001be4dbc52e9c535c85167d filelock-fde6c13.tar.gz