[python-narcissus-hub] Initial import (#1056654)

Ralph Bean ralph at fedoraproject.org
Thu Jan 23 14:50:24 UTC 2014


commit a91e0ed9776f1eaaed89701d1fa7cccfae5e04e2
Author: Ralph Bean <rbean at redhat.com>
Date:   Thu Jan 23 09:50:39 2014 -0500

    Initial import (#1056654)

 .gitignore                                      |    1 +
 python-narcissus-hub-geolitecity-location.patch |   43 +++++++++++++
 python-narcissus-hub.spec                       |   76 +++++++++++++++++++++++
 sources                                         |    1 +
 4 files changed, 121 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..54a2823 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/narcissus.hub-0.9.0.1.tar.gz
diff --git a/python-narcissus-hub-geolitecity-location.patch b/python-narcissus-hub-geolitecity-location.patch
new file mode 100644
index 0000000..8c660ad
--- /dev/null
+++ b/python-narcissus-hub-geolitecity-location.patch
@@ -0,0 +1,43 @@
+From c4d6ddbd9d6ebb478eebc5b2561135e88343c62b Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Wed, 22 Jan 2014 10:11:10 -0500
+Subject: [PATCH] Patch location of geolitecity.dat to use the system-provided
+ one.
+
+---
+ narcissus.hub/narcissus/hub/consumers.py | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/narcissus.hub/narcissus/hub/consumers.py b/narcissus.hub/narcissus/hub/consumers.py
+index 43039cd..0aabcd8 100644
+--- a/narcissus.hub/narcissus/hub/consumers.py
++++ b/narcissus.hub/narcissus/hub/consumers.py
+@@ -77,10 +77,8 @@ class RawIPConsumer(Consumer):
+     topic = 'narcissus.hits'
+     jsonify = True
+ 
+-    # TODO -- get this location from config
+-    geoip_url = '/'.join([
+-        os.getcwd(), "data", "GeoLiteCity.dat",
+-    ])
++    # This is where it lives for Fedora
++    geoip_url = "/usr/share/GeoIP/GeoLiteCity.dat"
+     gi = GeoIP(geoip_url, GEOIP_MEMORY_CACHE)
+ 
+     def consume(self, message):
+@@ -121,10 +119,8 @@ class HttpLightConsumer(Consumer):
+     topic = 'httpdlight_http_rawlogs'
+     jsonify = False
+ 
+-    # TODO -- get this location from config
+-    geoip_url = '/'.join([
+-        os.getcwd(), "data", "GeoLiteCity.dat",
+-    ])
++    # This is where it lives for Fedora
++    geoip_url = "/usr/share/GeoIP/GeoLiteCity.dat"
+     gi = GeoIP(geoip_url, GEOIP_MEMORY_CACHE)
+ 
+     def __init__(self, *args, **kwargs):
+-- 
+1.8.4.2
+
diff --git a/python-narcissus-hub.spec b/python-narcissus-hub.spec
new file mode 100644
index 0000000..d60059c
--- /dev/null
+++ b/python-narcissus-hub.spec
@@ -0,0 +1,76 @@
+%global modname narcissus.hub
+
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2:        %global __python2 /usr/bin/python2}
+%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+Name:               python-narcissus-hub
+Version:            0.9.0.1
+Release:            1%{?dist}
+Summary:            Hub components for Narcissus, realtime log visualization
+
+Group:              Development/Libraries
+License:            AGPLv3+
+URL:                http://pypi.python.org/pypi/narcissus.hub
+Source0:            http://pypi.python.org/packages/source/n/%{modname}/%{modname}-%{version}.tar.gz
+Patch0:             python-narcissus-hub-geolitecity-location.patch
+
+BuildArch:          noarch
+
+BuildRequires:      python2-devel
+BuildRequires:      python-setuptools
+BuildRequires:      python-moksha-hub
+BuildRequires:      python-pygeoip
+BuildRequires:      python-geojson
+
+Requires:           python-setuptools
+Requires:           python-moksha-hub
+Requires:           python-pygeoip
+Requires:           python-geojson
+
+%description
+This package contains the "hub" components for narcissus.  Narcissus is a web
+application that visualizes web server hits as they happen in real time.
+
+Features:
+
+* IP addresses converted to latitude/longitude, then streamed via
+  WebSockets to `polymaps <http://polymaps.org/>`_.
+* Realtime graphs of what countries are downloading what content with `d3
+  <http://d3js.org>`_.
+* `Ømq (zeromq) <http://www.zeromq.org/>`_ on the backend.
+* **Fast**.  No polling.
+
+You can see a demo running live at http://narcissus.rc.rit.edu
+It is visualizing the logs of http://mirror.rit.edu
+
+%prep
+%setup -q -n %{modname}-%{version}
+%patch0 -p2
+
+# Remove bundled egg-info in case it exists
+rm -rf %{modname}.egg-info
+
+%build
+%{__python2} setup.py build
+
+%install
+%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
+%{__mkdir} -p %{buildroot}%{_sysconfdir}/moksha/
+cp development.ini %{buildroot}%{_sysconfdir}/moksha/production.ini.example-narcissus
+
+%check
+%{__python2} setup.py test
+
+%files
+%doc README.rst LICENSE
+%{python2_sitelib}/narcissus/hub/
+%{python2_sitelib}/%{modname}-%{version}*
+%{_sysconfdir}/moksha/production.ini.example-narcissus
+
+
+%changelog
+* Tue Jan 21 2014 Ralph Bean <rbean at redhat.com> - 0.9.0.1-1
+- Initial package for Fedora
diff --git a/sources b/sources
index e69de29..9b4c793 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+352fb30a859e2d28f7a4aaa77537e31a  narcissus.hub-0.9.0.1.tar.gz


More information about the scm-commits mailing list