skeleton/DISTNAME.spec.tmpl
author Julien Cristau <julien.cristau@logilab.fr>
Thu, 10 Dec 2015 16:58:45 +0100
changeset 10997 da712d3f0601
parent 10965 b1ba18016151
child 11094 13c9cd75f097
permissions -rw-r--r--
Bring back the separate web-side entity cache Prior to changeset 635cfac73d28 "[repoapi] fold ClientConnection into Connection", we had two entity caches: one on the client/dbapi/web side, and one on the server/repo side. This is a waste, but it is actually needed as long as we have the magic _cw attribute on entities which must sometimes be a request and sometimes a cnx. Removing the duplication caused weird problems with entity._cw alternating between both types of objects, which is unexpected by both the repo and the web sides. We add an entity cache on ConnectionCubicWebRequestBase, separate from the Connection's, and bring back the _cw_update_attr_cache/dont-cache-attrs mechanism, to let the server/edition code let caches know which attributes have been modified Entity.as_rset can be cached again, as ResultSet no longer modifies the entity when fetching it from a cache. Contrary to the pre-3.21 code, _cw_update_attr_cache now handles web requests and connections in the same way (otherwise the cache ends up with wrong values if a hook modifies attributes), but dont-cache-attrs is never set for (inlined) relations. Closes #6863543
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8891
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     1
# for el5, force use of python2.6
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     2
%%if 0%%{?el5}
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     3
%%define python python26
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     4
%%define __python /usr/bin/python2.6
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     5
%%else
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     6
%%define python python
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     7
%%define __python /usr/bin/python
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     8
%%endif
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     9
%%{!?_python_sitelib: %%define _python_sitelib %%(%%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    10
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    11
Name:           %(distname)s
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    12
Version:        0.1.0
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    13
Release:        logilab.1%%{?dist}
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    14
Summary:        %(shortdesc)s
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    15
Group:          Applications/Internet
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    16
License:        %(license)s
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    17
Source0:        %(distname)s-%%{version}.tar.gz
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    18
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    19
BuildArch:      noarch
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    20
BuildRoot:      %%{_tmppath}/%%{name}-%%{version}-%%{release}-buildroot
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    21
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    22
BuildRequires:  %%{python} %%{python}-setuptools
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    23
Requires:       cubicweb >= %(version)s
10965
b1ba18016151 [skeleton] Fix broken spec file template
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10601
diff changeset
    24
Requires:       %%{python}-six >= 1.4.0
8891
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    25
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    26
%%description
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    27
%(longdesc)s
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    28
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    29
%%prep
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    30
%%setup -q -n %(distname)s-%%{version}
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    31
%%if 0%%{?el5}
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    32
# change the python version in shebangs
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    33
find . -name '*.py' -type f -print0 |  xargs -0 sed -i '1,3s;^#!.*python.*$;#! /usr/bin/python2.6;'
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    34
%%endif
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    35
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    36
%%install
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    37
NO_SETUPTOOLS=1 %%{__python} setup.py --quiet install --no-compile --prefix=%%{_prefix} --root="$RPM_BUILD_ROOT"
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    38
# remove generated .egg-info file
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    39
rm -rf $RPM_BUILD_ROOT/usr/lib/python*
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    40
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    41
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    42
%%clean
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    43
rm -rf $RPM_BUILD_ROOT
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    44
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    45
%%files
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    46
%%defattr(-, root, root)
ada2f065f279 skeleton: add RPM spec template (closes #2800884)
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    47
/*