From 048bbf243d0ac6536b57a14fadcba5770383b681 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Tue, 12 Jun 2018 11:52:09 +0200 Subject: net-analyzer/graphite-web: version bump to 1.1.3 Package-Manager: Portage-2.3.40, Repoman-2.3.9 --- net-analyzer/graphite-web/Manifest | 1 + .../files/graphite-web-1.1.3-fhs-paths.patch | 53 +++++++++ .../graphite-web/graphite-web-1.1.3.ebuild | 120 +++++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 net-analyzer/graphite-web/files/graphite-web-1.1.3-fhs-paths.patch create mode 100644 net-analyzer/graphite-web/graphite-web-1.1.3.ebuild (limited to 'net-analyzer/graphite-web') diff --git a/net-analyzer/graphite-web/Manifest b/net-analyzer/graphite-web/Manifest index 56d125f06cfa..b794186eb097 100644 --- a/net-analyzer/graphite-web/Manifest +++ b/net-analyzer/graphite-web/Manifest @@ -1,2 +1,3 @@ DIST graphite-web-0.9.13-share.png 325 BLAKE2B 390d5de23ae8300ca042e9c259fb7f892a4fd69ee8225d171b1f32b4215188fdd7a5c4f8e65fb3eae64cf154044ddb03c4490a8318ef8dc5934f3d5c04aeb6bb SHA512 19dc9139e97a99bf06fded2958bc52bc856fa11d0dc50f57e6c54214373795534cb74883ab5da7a05e2ddb69a2870d3b02dcf2ab0628bdf289f1ffd925e044e2 DIST graphite-web-0.9.13.tar.gz 2182781 BLAKE2B c4db10fbdfd45efb683862967e743de5d96a6342ade85548c43f3072fbc7f15d32a606979800e1c46ce8c81611121fa91ed873d57a184c92cc3167a7c5ac531e SHA512 5e2cc84ec57e1fa0ecff8c9671d8753655a8ce2c07ce2f446451ceaad7679b0cefe932de45315be360b8f13eb25cd25ef179814f340c2c42b0e7048a3d4f4a96 +DIST graphite-web-1.1.3.tar.gz 1171342 BLAKE2B f18c84d707f93d897553ec05d7b910a3dba97c6068498d1b216f178ea8a1f64baf59bb572b433a56f5e417a2873c018a38a19c3b8c765f667d7c3fbb38b9ed0a SHA512 3f9de216bd55e4e8de7391087e9b876a16e4f137fd60932a6d5855804c3d9868422645177776258e74486b97ec7a853b63a6d89b1de9b325bcb50ad694208436 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 new file mode 100644 index 000000000000..39d325984245 --- /dev/null +++ b/net-analyzer/graphite-web/files/graphite-web-1.1.3-fhs-paths.patch @@ -0,0 +1,53 @@ +Install FHS-style paths + +--- a/conf/graphite.wsgi.example ++++ b/conf/graphite.wsgi.example +@@ -1,4 +1,4 @@ + import sys +-sys.path.append('/opt/graphite/webapp') ++sys.path.append('@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web/webapp') + + from graphite.wsgi import application +--- a/setup.py ++++ b/setup.py +@@ -59,8 +59,7 @@ + ], + package_data={'graphite' : + ['templates/*', 'local_settings.py.example']}, +- scripts=glob('bin/*'), +- data_files=list(webapp_content.items()) + storage_dirs + conf_files + examples, ++ data_files=list(webapp_content.items()), + install_requires=['Django>=1.8,<1.11.99', 'django-tagging==0.4.3', 'pytz', 'pyparsing', 'cairocffi', 'urllib3', 'scandir', 'six'], + classifiers=[ + 'Intended Audience :: Developers', +--- a/webapp/graphite/local_settings.py.example ++++ b/webapp/graphite/local_settings.py.example +@@ -101,6 +101,7 @@ + # Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite + # to somewhere else + #GRAPHITE_ROOT = '/opt/graphite' ++GRAPHITE_ROOT = '@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web' + + # Most installs done outside of a separate tree such as /opt/graphite will + # need to change these settings. Note that the default settings for each +@@ -110,6 +111,11 @@ + #STATIC_ROOT = '/opt/graphite/static' + #LOG_DIR = '/opt/graphite/storage/log/webapp' + #INDEX_FILE = '/opt/graphite/storage/index' # Search index file ++CONF_DIR = '@GENTOO_PORTAGE_EPREFIX@/etc/graphite-web' ++STORAGE_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon' ++STATIC_ROOT = '@GENTOO_PORTAGE_EPREFIX@/usr/share/graphite-web' ++LOG_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/log/graphite-web' ++INDEX_FILE = '@GENTOO_PORTAGE_EPREFIX@/var/lib/graphite-web/index' # Search index file + + # To further or fully customize the paths, modify the following. Note that the + # default settings for each of these are relative to CONF_DIR and STORAGE_DIR +@@ -127,6 +133,8 @@ + #CERES_DIR = '/opt/graphite/storage/ceres' + #WHISPER_DIR = '/opt/graphite/storage/whisper' + #RRD_DIR = '/opt/graphite/storage/rrd' ++WHISPER_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon/whisper' ++RRD_DIR = '@GENTOO_PORTAGE_EPREFIX@/var/lib/carbon/rrd' + # + # Data directories using the "Standard" metrics finder (i.e. not Ceres) + #STANDARD_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables diff --git a/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild b/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild new file mode 100644 index 000000000000..7ca11c643e1b --- /dev/null +++ b/net-analyzer/graphite-web/graphite-web-1.1.3.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=( python{2_7,3_{4,5,6}} ) + +inherit distutils-r1 python-utils-r1 prefix + +DESCRIPTION="Enterprise scalable realtime graphing" +HOMEPAGE="http://graphite.readthedocs.org/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+carbon mysql memcached postgres +sqlite" +#ldap - needs bump of python-ldap to latest +# ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) + +DEPEND="" +RDEPEND=" + carbon? ( dev-python/carbon[${PYTHON_USEDEP}] ) + mysql? ( + || ( + dev-python/mysql-python[${PYTHON_USEDEP}] + dev-python/mysqlclient[${PYTHON_USEDEP}] + ) + ) + memcached? ( dev-python/python-memcached[${PYTHON_USEDEP}] ) + postgres? ( + dev-python/psycopg:2[${PYTHON_USEDEP}] + ) + dev-lang/python[sqlite?] + dev-python/cairocffi[${PYTHON_USEDEP}] + >=dev-python/django-1.8[sqlite?,${PYTHON_USEDEP}] + =dev-python/django-tagging-0.4.3[${PYTHON_USEDEP}] + dev-python/pyparsing[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + dev-python/scandir[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] + dev-python/txAMQP[${PYTHON_USEDEP}] + dev-python/twisted[${PYTHON_USEDEP}] + dev-python/urllib3[${PYTHON_USEDEP}] + dev-python/zope-interface[${PYTHON_USEDEP}] + dev-python/whisper[${PYTHON_USEDEP}] + media-libs/fontconfig" + +PATCHES=( + # Do not install the configuration and data files. We install them + # somewhere sensible by hand. + "${FILESDIR}"/${PN}-1.1.3-fhs-paths.patch +) + +src_prepare() { + # use FHS-style paths + export GRAPHITE_NO_PREFIX=yes + # make sure we don't use bundled stuff + rm -Rf webapp/graphite/thirdparty + distutils-r1_src_prepare + eprefixify \ + conf/graphite.wsgi.example \ + webapp/graphite/local_settings.py.example +} + +python_install() { + distutils-r1_python_install \ + --install-data="${EPREFIX}"/usr/share/${PN} + + # make manage.py available from an easier location/name + # (missing from tarball) + dodir /usr/bin + cat > "${ED}"/usr/bin/${PN}-manage <<- EOS + #!/usr/bin/env python + import os + import sys + + + if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) + EOS + #mv "${D}"/$(python_get_sitedir)/graphite/manage.py \ + # "${ED}"/usr/bin/${PN}-manage || die + chmod 0755 "${ED}"/usr/bin/${PN}-manage || die + python_fix_shebang "${ED}"/usr/bin/${PN}-manage + + insinto /etc/${PN} + newins webapp/graphite/local_settings.py.example local_settings.py + pushd "${D}"/$(python_get_sitedir)/graphite > /dev/null || die + ln -s ../../../../../etc/${PN}/local_settings.py local_settings.py + popd > /dev/null || die + + insinto /usr/share/doc/${PF}/examples + doins \ + examples/example-graphite-vhost.conf \ + conf/dashboard.conf.example \ + conf/graphite.wsgi.example +} + +pkg_config() { + "${ROOT}"/usr/bin/${PN}-manage syncdb --noinput + local idx=$(grep 'INDEX_FILE =' "${EROOT}"/etc/graphite-web/local_settings.py 2>/dev/null) + if [[ -n ${idx} ]] ; then + idx=${idx##*=} + idx=$(echo ${idx}) + eval "idx=${idx}" + touch "${ROOT}"/"${idx}"/index + fi +} + +pkg_postinst() { + einfo "You need to configure ${PN} to run with a WSGI server of your choice." + einfo "Don't forget to edit local_settings.py in ${EPREFIX}/etc/${PN}" + einfo "See http://graphite.readthedocs.org/en/latest/config-local-settings.html" + einfo "Run emerge --config =${PN}-${PVR} if this is a fresh install." +} -- cgit v1.2.3-18-g5258