[askbot] initial import

Rahul Sundaram sundaram at fedoraproject.org
Wed Jul 20 14:19:22 UTC 2011


commit f0473b6eca3a9bd3989ab90f36ed3d5547dc7c35
Author: Rahul Sundaram <sundaram at fedoraproject.org>
Date:   Wed Jul 20 19:44:16 2011 +0530

    initial import

 askbot.spec              |  150 ++++++++++++++++++++++++++++++++++++++++++++++
 sources                  |    1 +
 use_system_modules.patch |  101 +++++++++++++++++++++++++++++++
 3 files changed, 252 insertions(+), 0 deletions(-)
---
diff --git a/askbot.spec b/askbot.spec
new file mode 100644
index 0000000..7e4f631
--- /dev/null
+++ b/askbot.spec
@@ -0,0 +1,150 @@
+Name:           askbot
+Version:        0.7.7
+Release:        2%{?dist}
+Summary:        Question and Answer forum
+Group:          Development/Languages
+License:        GPLv3+
+URL:            http://pypi.python.org/pypi/%{name}
+Source0:        http://pypi.python.org/packages/source/a/%{name}/%{name}-%{version}.tar.gz
+Patch0:         use_system_modules.patch
+BuildArch:      noarch
+BuildRequires:  python-setuptools python-devel gettext
+Requires:       Django Django-south 
+Requires:       django-keyedcache django-robots django-countries django-celery
+Requires:       django-kombu django-recaptcha django-threaded-multihost 
+Requires:       python-html5lib python-oauth2 python-coffin python-markdown2  
+Requires:       python-recaptcha-client python-grapefruit
+Requires:       python-unidecode python-httplib2 python-dateutil python-psycopg2
+# optional dependencies
+Requires:       django-followit django-avatar
+
+%description
+Question and Answer forum written in python and Django. It is similar to 
+Stack Overflow or Yahoo Answers. 
+
+Features:
+
+   * standard Q&A functionality including votes, reputation system, etc.
+   * user levels: admin, moderator, regular, suspended, blocked
+   * per-user in-box for responses & flagged items (for moderators)
+   * email alerts - instant and delayed, optionally tag filtered
+   * search by full text and a set of tags simultaneously
+   * can import data from stack-exchange database file
+
+%prep
+%setup -q 
+%patch0 -p1
+
+# remove unneeded doc
+rm -rf askbot/doc/askbot-docs.zip
+
+# remove bundled deps
+rm -rf %{name}/deps/grapefruit.py
+rm -rf %{name}/deps/recaptcha_django
+rm -rf %{name}/deps/openid
+
+# remove empty files
+rm -rf %{name}/doc/build/html/.buildinfo
+rm -rf %{name}/skins/default/media/images/flags/.DS_Store
+
+# fix permission issues
+chmod -x %{name}/skins/README
+chmod -x %{name}/setup_templates/upfiles/README
+chmod -x %{name}/views/README
+chmod -x %{name}/skins/default/media/js/wmd/*.js
+chmod -x %{name}/skins/default/media/js/*.bat
+chmod -x %{name}/skins/default/media/style/*.css
+chmod -x %{name}/skins/default/media/jquery-openid/openid.css
+chmod -x %{name}/skins/default/media/js/wmd/wmd-test.html
+chmod -x %{name}/skins/default/media/jquery-openid/jquery.openid.js
+chmod -x %{name}/skins/default/media/js/wmd/wmd.css
+
+%build
+%{__python} setup.py build
+
+%install
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+
+# Language files; not under /usr/share, need to be handled manually
+(cd %{buildroot} && find . -name 'django.?o' && find . -name 'djangojs.?o') | sed -e 's|^.||' | sed -e \
+  's:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:' \
+  >> %{name}.lang
+
+# remove shebang 
+sed -i -e '1d' %{buildroot}%{python_sitelib}/%{name}/utils/diff.py
+sed -i -e '1d' %{buildroot}%{python_sitelib}/%{name}/setup_templates/manage.py
+sed -i -e '1d' %{buildroot}%{python_sitelib}/%{name}/bin/show_profile_stats.py
+sed -i -e '1d' %{buildroot}%{python_sitelib}/%{name}/bin/generate_modules.py 
+sed -i -e '1d' %{buildroot}%{python_sitelib}/%{name}/cron/askbot_cron_job
+
+# remove empty files
+rm -rf %{buildroot}%{python_sitelib}/%{name}/version.*
+rm -rf %{buildroot}%{python_sitelib}/%{name}/setup_templates/log/askbot.log
+rm -rf %{buildroot}%{_defaultdocdir}/%{name}-%{version}/doc/build/html/.buildinfo
+
+# fix permission issues
+chmod -x %{buildroot}%{python_sitelib}/%{name}/skins/README
+chmod -x %{buildroot}%{python_sitelib}/%{name}/setup_templates/upfiles/README
+chmod -x %{buildroot}%{python_sitelib}/%{name}/views/README
+chmod -x %{buildroot}%{python_sitelib}/%{name}/bin/rmpyc
+
+
+%files -f %{name}.lang 
+%doc askbot/doc/ askbot/docs/
+
+%{_bindir}/startforum
+%dir %{python_sitelib}/%{name}/
+%dir %{python_sitelib}/%{name}/locale/
+%{python_sitelib}/%{name}/*.py*
+%{python_sitelib}/%{name}/LICENSE
+%{python_sitelib}/%{name}/bin/
+%{python_sitelib}/%{name}/conf/
+%{python_sitelib}/%{name}/const/
+%{python_sitelib}/%{name}/cron/
+%{python_sitelib}/%{name}/deployment/
+%{python_sitelib}/%{name}/skins/
+%{python_sitelib}/%{name}/templatetags/
+%{python_sitelib}/%{name}/tests/
+%{python_sitelib}/%{name}/utils/
+%{python_sitelib}/%{name}/views/
+%{python_sitelib}/%{name}/setup_templates/
+%{python_sitelib}/%{name}/doc/
+%{python_sitelib}/%{name}/docs/
+%{python_sitelib}/%{name}/migrations/
+%{python_sitelib}/%{name}/models/
+%{python_sitelib}/%{name}/management/
+%dir %{python_sitelib}/%{name}/deps/
+%{python_sitelib}/%{name}/deps/*.py*
+%{python_sitelib}/%{name}/deps/README
+%{python_sitelib}/%{name}/deps/django_authopenid/
+%dir %{python_sitelib}/%{name}/deps/livesettings/
+%dir %{python_sitelib}/%{name}/deps/livesettings/locale/
+%{python_sitelib}/%{name}/deps/livesettings/*.py*
+%{python_sitelib}/%{name}/deps/livesettings/README
+%{python_sitelib}/%{name}/deps/livesettings/temp*
+%{python_sitelib}/%{name}/importers/
+%{python_sitelib}/%{name}/middleware/
+%{python_sitelib}/%{name}/migrations_api/
+%{python_sitelib}/%{name}/patches/
+%{python_sitelib}/%{name}/search/
+%{python_sitelib}/%{name}/user_messages/
+%{python_sitelib}/%{name}/upfiles/
+%{python_sitelib}/askbot*.egg-info
+
+%changelog
+* Mon Jul 18 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 0.7.7-2
+- Changes from Praveen Kumar to fix all relevant rpmlint warnings and errors
+
+* Thu Jul 14 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 0.7.7-1
+- new upstream release.  
+- split out bundled grapefruit, django recaptcha dependencies
+
+* Sun Jun 26 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 0.7.1-1
+- new upstream release
+
+* Mon Apr 25 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 0.6.78-1
+- new upstream release
+
+* Thu Apr 18 2011 Rahul Sundaram <sundaram at fedoraproject.org> - 0.6.76-1
+- initial spec
+
diff --git a/sources b/sources
index e69de29..6fc59ec 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ebd2d12109a29d75184647f652cc59c8  askbot-0.7.7.tar.gz
diff --git a/use_system_modules.patch b/use_system_modules.patch
new file mode 100644
index 0000000..676605d
--- /dev/null
+++ b/use_system_modules.patch
@@ -0,0 +1,101 @@
+diff --git a/askbot/conf/skin_counter_settings.py b/askbot/conf/skin_counter_settings.py
+index 7601a7a..e45e254 100644
+--- a/askbot/conf/skin_counter_settings.py
++++ b/askbot/conf/skin_counter_settings.py
+@@ -4,7 +4,10 @@ Skin settings to color view, vote and answer counters
+ from askbot.conf.settings_wrapper import settings
+ from askbot.deps.livesettings import ConfigurationGroup, IntegerValue, StringValue
+ from django.utils.translation import ugettext as _
+-from askbot.deps.grapefruit import Color
++try:
++    from grapefruit import Color
++except Exception, e:
++    from askbot.deps.grapefruit import Color
+ 
+ SKIN_COUNTER_SETTINGS = ConfigurationGroup(
+                             'SKIN_COUNTER_SETTINGS',
+diff --git a/askbot/forms.py b/askbot/forms.py
+index 57775ed..60941ca 100644
+--- a/askbot/forms.py
++++ b/askbot/forms.py
+@@ -10,7 +10,10 @@ from django.contrib.contenttypes.models import ContentType
+ from django_countries import countries
+ from askbot.utils.forms import NextUrlField, UserNameField
+ from askbot.utils.mail import extract_first_email_address
+-from askbot.deps.recaptcha_django import ReCaptchaField
++try:
++    from recaptcha_django import ReCaptchaField
++except Exception,e:
++    from askbot.deps.recaptcha_django import ReCaptchaField
+ from askbot.conf import settings as askbot_settings
+ import logging
+ 
+diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py
+index 6f895ea..d6e921e 100644
+--- a/askbot/setup_templates/settings.py
++++ b/askbot/setup_templates/settings.py
+@@ -103,7 +103,7 @@ MIDDLEWARE_CLASSES = (
+     'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
+     'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
+     'askbot.middleware.cancel.CancelActionMiddleware',
+-    'askbot.deps.recaptcha_django.middleware.ReCaptchaMiddleware',
++    'recaptcha_django.middleware.ReCaptchaMiddleware',
+     'django.middleware.transaction.TransactionMiddleware',
+     #'debug_toolbar.middleware.DebugToolbarMiddleware',
+     'askbot.middleware.view_log.ViewLogMiddleware',
+diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
+index 63737ac..0b92ec2 100644
+--- a/askbot/startup_procedures.py
++++ b/askbot/startup_procedures.py
+@@ -53,14 +53,30 @@ def test_middleware():
+     installed in the django settings.py file. If that is not the
+     case - raises an ImproperlyConfigured exception.
+     """
+-    required_middleware = (
++
++    recaptcha_django_syscopy = 0
++    try:
++        import recaptcha_django
++        recaptcha_django_syscopy = 1
++    except Exception, e:
++        pass
++
++    required_middleware_list = [
+         'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
+         'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
+         'askbot.middleware.cancel.CancelActionMiddleware',
+-        'askbot.deps.recaptcha_django.middleware.ReCaptchaMiddleware',
+         'django.middleware.transaction.TransactionMiddleware',
+         'askbot.middleware.view_log.ViewLogMiddleware',
+-    )
++    ]
++
++    recaptcha_str = 'recaptcha_django.middleware.ReCaptchaMiddleware'
++    if recaptcha_django_syscopy == 0:
++        required_middleware_list.append('askbot.deps.' + recaptcha_str)
++    elif recaptcha_django_syscopy == 1:
++        required_middleware_list.append(recaptcha_str)
++
++    required_middleware = tuple(required_middleware_list)
++
+     #'debug_toolbar.middleware.DebugToolbarMiddleware',
+     missing_middleware = list()
+     for middleware in required_middleware:
+@@ -107,3 +123,4 @@ def run():
+         transaction.commit()
+     except:
+         transaction.rollback()
++
+diff --git a/askbot/utils/colors.py b/askbot/utils/colors.py
+index 9ca8ba7..1611b15 100644
+--- a/askbot/utils/colors.py
++++ b/askbot/utils/colors.py
+@@ -1,4 +1,7 @@
+-from askbot.deps.grapefruit import Color
++try:
++    from grapefruit import Color
++except Exception, e:
++    from askbot.deps.grapefruit import Color
+ import keyedcache
+ import math
+ 


More information about the scm-commits mailing list