summaryrefslogtreecommitdiffstats
path: root/SPECS/python-cached_property.spec
blob: f3c23573202eb03957aaa236082027691848da74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

%global projectname cached-property
Name:           python-%{projectname}
Version:        1.0.0 
Release:        1%{?dist}
Summary:        A cached-property for decorating methods in Python classes.

License:        BSD
URL:            https://github.com/pydanny/cached-property
Source0:        https://github.com/pydanny/%{projectname}/archive/%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python-devel
BuildRequires:  python-tox
BuildRequires:  python-freezegun
BuildRequires:  python3-devel
BuildRequires:  python3-freezegun

%description
cached_property allows properties in Python classes to be cached until the cache
is invalidated or expired.

%package -n python3-%{projectname}
Summary:        A cached-property for decorating methods in Python classes.

%description -n python3-%{projectname}
cached_property allows properties in Python classes to be cached until the cache
is invalidated or expired.

%prep
%setup -q -n %{projectname}-%{version}
cp -a . %{py3dir}

%build
# Remove CFLAGS=... for noarch packages (unneeded)
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
pushd %{py3dir}
%{__python3} setup.py build
popd

%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}

%check
tox --sitepackages --skip-missing-interpreters

%files
%doc AUTHORS.rst HISTORY.rst CONTRIBUTING.rst README.rst
%license LICENSE
%{python_sitelib}/cached_property*

%files -n python3-%{projectname}
%doc AUTHORS.rst HISTORY.rst CONTRIBUTING.rst README.rst
%license LICENSE
%{python3_sitelib}/cached_property*
%{python3_sitelib}/__pycache__/cached_property*

%changelog
* Fri Feb 20 2015 Pete Travis <me@petetravis.com>
- Initial packaging.