Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/graphite-web/, net-analyzer/graphite-web/files/
Date: Tue, 12 Jun 2018 10:35:40
Message-Id: 1528799724.048bbf243d0ac6536b57a14fadcba5770383b681.grobian@gentoo
1 commit: 048bbf243d0ac6536b57a14fadcba5770383b681
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 12 09:52:09 2018 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 12 10:35:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=048bbf24
7
8 net-analyzer/graphite-web: version bump to 1.1.3
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 net-analyzer/graphite-web/Manifest | 1 +
13 .../files/graphite-web-1.1.3-fhs-paths.patch | 53 +++++++++
14 .../graphite-web/graphite-web-1.1.3.ebuild | 120 +++++++++++++++++++++
15 3 files changed, 174 insertions(+)
16
17 diff --git a/net-analyzer/graphite-web/Manifest b/net-analyzer/graphite-web/Manifest
18 index 56d125f06cf..b794186eb09 100644
19 --- a/net-analyzer/graphite-web/Manifest
20 +++ b/net-analyzer/graphite-web/Manifest
21 @@ -1,2 +1,3 @@
22 DIST graphite-web-0.9.13-share.png 325 BLAKE2B 390d5de23ae8300ca042e9c259fb7f892a4fd69ee8225d171b1f32b4215188fdd7a5c4f8e65fb3eae64cf154044ddb03c4490a8318ef8dc5934f3d5c04aeb6bb SHA512 19dc9139e97a99bf06fded2958bc52bc856fa11d0dc50f57e6c54214373795534cb74883ab5da7a05e2ddb69a2870d3b02dcf2ab0628bdf289f1ffd925e044e2
23 DIST graphite-web-0.9.13.tar.gz 2182781 BLAKE2B c4db10fbdfd45efb683862967e743de5d96a6342ade85548c43f3072fbc7f15d32a606979800e1c46ce8c81611121fa91ed873d57a184c92cc3167a7c5ac531e SHA512 5e2cc84ec57e1fa0ecff8c9671d8753655a8ce2c07ce2f446451ceaad7679b0cefe932de45315be360b8f13eb25cd25ef179814f340c2c42b0e7048a3d4f4a96
24 +DIST graphite-web-1.1.3.tar.gz 1171342 BLAKE2B f18c84d707f93d897553ec05d7b910a3dba97c6068498d1b216f178ea8a1f64baf59bb572b433a56f5e417a2873c018a38a19c3b8c765f667d7c3fbb38b9ed0a SHA512 3f9de216bd55e4e8de7391087e9b876a16e4f137fd60932a6d5855804c3d9868422645177776258e74486b97ec7a853b63a6d89b1de9b325bcb50ad694208436
25
26 diff --git a/net-analyzer/graphite-web/files/graphite-web-1.1.3-fhs-paths.patch b/net-analyzer/graphite-web/files/graphite-web-1.1.3-fhs-paths.patch
27 new file mode 100644
28 index 00000000000..39d32598424
29 --- /dev/null
30 +++ b/net-analyzer/graphite-web/files/graphite-web-1.1.3-fhs-paths.patch
31 @@ -0,0 +1,53 @@
32 +Install FHS-style paths
33 +
34 +--- a/conf/graphite.wsgi.example
35 ++++ b/conf/graphite.wsgi.example
36 +@@ -1,4 +1,4 @@
37 + import sys
38 +-sys.path.append('/opt/graphite/webapp')
39 ++sys.path.append('@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web/webapp')
40 +
41 + from graphite.wsgi import application
42 +--- a/setup.py
43 ++++ b/setup.py
44 +@@ -59,8 +59,7 @@
45 + ],
46 + package_data={'graphite' :
47 + ['templates/*', 'local_settings.py.example']},
48 +- scripts=glob('bin/*'),
49 +- data_files=list(webapp_content.items()) + storage_dirs + conf_files + examples,
50 ++ data_files=list(webapp_content.items()),
51 + install_requires=['Django>=1.8,<1.11.99', 'django-tagging==0.4.3', 'pytz', 'pyparsing', 'cairocffi', 'urllib3', 'scandir', 'six'],
52 + classifiers=[
53 + 'Intended Audience :: Developers',
54 +--- a/webapp/graphite/local_settings.py.example
55 ++++ b/webapp/graphite/local_settings.py.example
56 +@@ -101,6 +101,7 @@
57 + # Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
58 + # to somewhere else
59 + #GRAPHITE_ROOT = '/opt/graphite'
60 ++GRAPHITE_ROOT = '@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web'
61 +
62 + # Most installs done outside of a separate tree such as /opt/graphite will
63 + # need to change these settings. Note that the default settings for each
64 +@@ -110,6 +111,11 @@
65 + #STATIC_ROOT = '/opt/graphite/static'
66 + #LOG_DIR = '/opt/graphite/storage/log/webapp'
67 + #INDEX_FILE = '/opt/graphite/storage/index' # Search index file
68 ++CONF_DIR = '@GENTOO_PORTAGE_EPREFIX@/etc/graphite-web'
69 ++STORAGE_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon'
70 ++STATIC_ROOT = '@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web'
71 ++LOG_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/log/graphite-web'
72 ++INDEX_FILE = '@GENTOO_PORTAGE_EPREFIX@/var/lib/graphite-web/index' # Search index file
73 +
74 + # To further or fully customize the paths, modify the following. Note that the
75 + # default settings for each of these are relative to CONF_DIR and STORAGE_DIR
76 +@@ -127,6 +133,8 @@
77 + #CERES_DIR = '/opt/graphite/storage/ceres'
78 + #WHISPER_DIR = '/opt/graphite/storage/whisper'
79 + #RRD_DIR = '/opt/graphite/storage/rrd'
80 ++WHISPER_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon/whisper'
81 ++RRD_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon/rrd'
82 + #
83 + # Data directories using the "Standard" metrics finder (i.e. not Ceres)
84 + #STANDARD_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
85
86 diff --git a/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild b/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild
87 new file mode 100644
88 index 00000000000..7ca11c643e1
89 --- /dev/null
90 +++ b/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild
91 @@ -0,0 +1,120 @@
92 +# Copyright 1999-2018 Gentoo Foundation
93 +# Distributed under the terms of the GNU General Public License v2
94 +
95 +EAPI=6
96 +PYTHON_COMPAT=( python{2_7,3_{4,5,6}} )
97 +
98 +inherit distutils-r1 python-utils-r1 prefix
99 +
100 +DESCRIPTION="Enterprise scalable realtime graphing"
101 +HOMEPAGE="http://graphite.readthedocs.org/"
102 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
103 +
104 +LICENSE="Apache-2.0"
105 +SLOT="0"
106 +KEYWORDS="~amd64 ~x86"
107 +IUSE="+carbon mysql memcached postgres +sqlite"
108 +#ldap - needs bump of python-ldap to latest
109 +# ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
110 +
111 +DEPEND=""
112 +RDEPEND="
113 + carbon? ( dev-python/carbon[${PYTHON_USEDEP}] )
114 + mysql? (
115 + || (
116 + dev-python/mysql-python[${PYTHON_USEDEP}]
117 + dev-python/mysqlclient[${PYTHON_USEDEP}]
118 + )
119 + )
120 + memcached? ( dev-python/python-memcached[${PYTHON_USEDEP}] )
121 + postgres? (
122 + dev-python/psycopg:2[${PYTHON_USEDEP}]
123 + )
124 + dev-lang/python[sqlite?]
125 + dev-python/cairocffi[${PYTHON_USEDEP}]
126 + >=dev-python/django-1.8[sqlite?,${PYTHON_USEDEP}]
127 + <dev-python/django-1.11.99[sqlite?,${PYTHON_USEDEP}]
128 + >=dev-python/django-tagging-0.4.3[${PYTHON_USEDEP}]
129 + dev-python/pyparsing[${PYTHON_USEDEP}]
130 + dev-python/pytz[${PYTHON_USEDEP}]
131 + dev-python/scandir[${PYTHON_USEDEP}]
132 + dev-python/six[${PYTHON_USEDEP}]
133 + dev-python/txAMQP[${PYTHON_USEDEP}]
134 + dev-python/twisted[${PYTHON_USEDEP}]
135 + dev-python/urllib3[${PYTHON_USEDEP}]
136 + dev-python/zope-interface[${PYTHON_USEDEP}]
137 + dev-python/whisper[${PYTHON_USEDEP}]
138 + media-libs/fontconfig"
139 +
140 +PATCHES=(
141 + # Do not install the configuration and data files. We install them
142 + # somewhere sensible by hand.
143 + "${FILESDIR}"/${PN}-1.1.3-fhs-paths.patch
144 +)
145 +
146 +src_prepare() {
147 + # use FHS-style paths
148 + export GRAPHITE_NO_PREFIX=yes
149 + # make sure we don't use bundled stuff
150 + rm -Rf webapp/graphite/thirdparty
151 + distutils-r1_src_prepare
152 + eprefixify \
153 + conf/graphite.wsgi.example \
154 + webapp/graphite/local_settings.py.example
155 +}
156 +
157 +python_install() {
158 + distutils-r1_python_install \
159 + --install-data="${EPREFIX}"/usr/share/${PN}
160 +
161 + # make manage.py available from an easier location/name
162 + # (missing from tarball)
163 + dodir /usr/bin
164 + cat > "${ED}"/usr/bin/${PN}-manage <<- EOS
165 + #!/usr/bin/env python
166 + import os
167 + import sys
168 +
169 +
170 + if __name__ == "__main__":
171 + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings")
172 +
173 + from django.core.management import execute_from_command_line
174 +
175 + execute_from_command_line(sys.argv)
176 + EOS
177 + #mv "${D}"/$(python_get_sitedir)/graphite/manage.py \
178 + # "${ED}"/usr/bin/${PN}-manage || die
179 + chmod 0755 "${ED}"/usr/bin/${PN}-manage || die
180 + python_fix_shebang "${ED}"/usr/bin/${PN}-manage
181 +
182 + insinto /etc/${PN}
183 + newins webapp/graphite/local_settings.py.example local_settings.py
184 + pushd "${D}"/$(python_get_sitedir)/graphite > /dev/null || die
185 + ln -s ../../../../../etc/${PN}/local_settings.py local_settings.py
186 + popd > /dev/null || die
187 +
188 + insinto /usr/share/doc/${PF}/examples
189 + doins \
190 + examples/example-graphite-vhost.conf \
191 + conf/dashboard.conf.example \
192 + conf/graphite.wsgi.example
193 +}
194 +
195 +pkg_config() {
196 + "${ROOT}"/usr/bin/${PN}-manage syncdb --noinput
197 + local idx=$(grep 'INDEX_FILE =' "${EROOT}"/etc/graphite-web/local_settings.py 2>/dev/null)
198 + if [[ -n ${idx} ]] ; then
199 + idx=${idx##*=}
200 + idx=$(echo ${idx})
201 + eval "idx=${idx}"
202 + touch "${ROOT}"/"${idx}"/index
203 + fi
204 +}
205 +
206 +pkg_postinst() {
207 + einfo "You need to configure ${PN} to run with a WSGI server of your choice."
208 + einfo "Don't forget to edit local_settings.py in ${EPREFIX}/etc/${PN}"
209 + einfo "See http://graphite.readthedocs.org/en/latest/config-local-settings.html"
210 + einfo "Run emerge --config =${PN}-${PVR} if this is a fresh install."
211 +}