debian/rules
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 09 Mar 2017 16:36:33 +0100
changeset 12053 c3c9f2e1424c
parent 11836 21c72857178f
child 12630 1c156d9f224a
permissions -rwxr-xr-x
[pyramid] Add a "pyramid" instance configuration type In a new module 'cubicweb.pyramid.config' we define a "pyramid" instance configuration type. The noticeable feature of this configuration is that it manages a 'development.ini' file that gets installed in application home (along with `.conf` file). This file is templated and includes generated values for secrets of session and authtk tokens. This means that we can just call: pserve etc/cubicweb.d/<appname>/development.ini or gunicorn --paste etc/cubicweb.d/<appname>/development.ini -b :8080 just after instance creation to get a pyramid instance running without having to hack around a 'pyramid.ini' file. This patch drops 'development.ini' from skeleton and moves it in cubicweb/pyramid so that it gets installed at instance creation which is more appropriate than in cube creation. The new configuration class sets "cubicweb.bwcompat" setting to false so it is not intended to replace the "all-in-one" configuration type (which would require a bit more work). This configuration is close to the the 'repository' configuration type with just a couple of options from WebConfiguration that are needed for Pyramid (anonymous user/password plus some miscellaneous options that I'm not so sure are really needed). Note, in particular, that we do not pull CORS settings to be injected as a WSGI middleware like in wsgi_application_from_cwconfig() since I believe this should be left as an end-user responsibility and since this can be defined in a standard way in paste configuration. This configuration inherits from ServerConfiguration but registers the same appobjects as WebConfiguration. In cubicweb.web.request._CubicWebRequestBase, we guard against access to "uiprops" and "datadir_url" of the config because this new "pyramid" config does not have these (this does not make sense without bwcompat mode). At some point, we should either avoid using `cw_request`'s pyramid request attribute or make cubicweb's web request really independant of existing implementation and drop these assumptions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     1
#!/usr/bin/make -f
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
# Sample debian/rules that uses debhelper.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
# GNU copyright 1997 to 1999 by Joey Hess.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
# Uncomment this to turn on verbose mode.
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
     6
# export DH_VERBOSE=1
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
     8
export PYBUILD_NAME=cubicweb
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
     9
export PYBUILD_DISABLE_python2=test
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    11
%:
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    12
	dh $@ --with python2,sphinxdoc --buildsystem=pybuild
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    13
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    14
override_dh_auto_build: export http_proxy=127.0.0.1:9
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    15
override_dh_auto_build: export https_proxy=127.0.0.1:9
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    16
override_dh_auto_build:
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    17
	dh_auto_build
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    18
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    19
	PYTHONPATH=. sphinx-build -N -bhtml doc/ debian/cubicweb-doc/html
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    20
endif
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    21
11836
21c72857178f [debian] Rework split of cubicweb-ctl package
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11832
diff changeset
    22
override_dh_auto_install:
21c72857178f [debian] Rework split of cubicweb-ctl package
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11832
diff changeset
    23
	dh_auto_install
21c72857178f [debian] Rework split of cubicweb-ctl package
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11832
diff changeset
    24
	mv debian/python-${PYBUILD_NAME}/usr/bin/cubicweb-ctl \
21c72857178f [debian] Rework split of cubicweb-ctl package
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11832
diff changeset
    25
		debian/cubicweb-ctl/usr/bin/cubicweb-ctl
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    27
override_dh_installchangelogs:
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    28
	dh_installchangelogs -Xdoc/changes
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29