moksha.spec | 27 ++++++++++++++-----
moksha/apps/__init__.py | 1
pavement.py | 33 +++++++++++++++++------
production/apache/moksha.conf | 59 ++++++++++++++++++++----------------------
production/apache/moksha.wsgi | 3 +-
5 files changed, 77 insertions(+), 46 deletions(-)
New commits:
commit f3dac45e242a587c2ac91a1d88d171efad87892f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 18 15:39:34 2009 -0400
pavement.py: Ignore non-directory files in the moksha/apps dir
diff --git a/pavement.py b/pavement.py
index c8c7999..0bbb274 100644
--- a/pavement.py
+++ b/pavement.py
@@ -193,11 +193,13 @@ def restart_httpd():
@task
def reinstall_apps():
for app in os.listdir('moksha/apps'):
- top = os.getcwd()
- os.chdir(path('moksha') / 'apps' / app)
- if os.path.isfile('pavement.py'):
- sh('paver reinstall')
- os.chdir(top)
+ app_dir = path('moksha') / 'apps' / app
+ if os.path.isdir(app_dir):
+ top = os.getcwd()
+ os.chdir(path('moksha') / 'apps' / app)
+ if os.path.isfile('pavement.py'):
+ sh('paver reinstall')
+ os.chdir(top)
@task
@cmdopts([
commit 6a3d07f721c7eae9efc668cee9ef1e3dc100a717
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 18 15:39:27 2009 -0400
Don't import the moksha module in our pavement.py
diff --git a/pavement.py b/pavement.py
index 6617749..c8c7999 100644
--- a/pavement.py
+++ b/pavement.py
@@ -25,7 +25,7 @@ from paver.setuputils import find_packages, find_package_data
import paver.misctasks
import paver.virtual
-from moksha import version
+VERSION = '0.3.1'
HEADER = """This file is part of Moksha.
Copyright (C) 2008-2009 Red Hat, Inc.
@@ -45,7 +45,7 @@ along with this program. If not, see
<
http://www.gnu.org/licenses/>."""
options(
version=Bunch(
- number=version,
+ number=VERSION,
name="Moksha",
),
package_data=find_package_data(),
commit fa1d6de02868ed9e2f48547eccf3b1d75fbeb66b
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 18 15:39:01 2009 -0400
Some minor specfile tweaks
diff --git a/moksha.spec b/moksha.spec
index 9b2be34..2b5acd1 100644
--- a/moksha.spec
+++ b/moksha.spec
@@ -1,7 +1,7 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?pyver: %define pyver %(%{__python} -c "import sys ; print
sys.version[:3]")}
-Name: moksha
+Name: moksha
Version: 0.3.1
Release: 1%{?dist}
Summary: A flexable platform for creating live collaborative web applications
@@ -19,6 +19,7 @@ BuildRequires: python-devel
BuildRequires: python-pygments
BuildRequires: python-paver
BuildRequires: python-sphinx
+BuildRequires: python-paste
BuildRequires: python-nose
Requires: TurboGears2
@@ -81,9 +82,6 @@ make -C docs html
%{__python} setup.py install -O1 --skip-build \
--install-data=%{_datadir} --root %{buildroot}
-# Wipe out moksha/apps because that is where other app packages install
-%{__rm} -fr %{buildroot}%{python_sitelib}/moksha/apps/*
-
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/apache
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/nginx
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/rabbitmq
commit 29c339207cef3dc8af63ca85c7ec957b24542f38
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 18 15:38:25 2009 -0400
Add a moksha.apps.__init__.py, which we need
diff --git a/moksha/apps/__init__.py b/moksha/apps/__init__.py
new file mode 100644
index 0000000..de40ea7
--- /dev/null
+++ b/moksha/apps/__init__.py
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
commit d18d35bb7b5d2704bf37a123b0ece7350eb1ad58
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Aug 15 14:14:51 2009 -0400
Add a paver smock task
diff --git a/pavement.py b/pavement.py
index 3471b78..6617749 100644
--- a/pavement.py
+++ b/pavement.py
@@ -198,3 +198,18 @@ def reinstall_apps():
if os.path.isfile('pavement.py'):
sh('paver reinstall')
os.chdir(top)
+
+@task
+@cmdopts([
+ ('distro=', 'd', 'Distribution to build for'),
+ ('arch=', 'a', 'Architecture to build'),
+])
+def smock(options):
+ """ Use smock.pl to rebuild everything in ~/rpmbuild/SRPMS
"""
+ arches = getattr(options, 'arch', 'i386 x86_64').split()
+ distros = getattr(options, 'distro',
+ 'epel-5 fedora-11 fedora-rawhide fedora-10').split()
+ for distro in distros:
+ for arch in arches:
+ sh('~/smock.pl --arch=%s --distro=%s ~/rpmbuild/SRPMS/*.rpm' % (
+ arch, distro))
commit e9d8775ed668750aea12f11ed36c861d7be5eb8a
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Aug 15 12:21:27 2009 -0400
Minor tweak in our wsgi app
diff --git a/production/apache/moksha.wsgi b/production/apache/moksha.wsgi
index e4e5d25..cdc76b6 100644
--- a/production/apache/moksha.wsgi
+++ b/production/apache/moksha.wsgi
@@ -1,4 +1,5 @@
-import os, sys
+import sys
+#import os
#sys.path.append('/srv/moksha')
#os.environ['PYTHON_EGG_CACHE'] = '/srv/moksha/.python-eggs'
commit a98bea55f0ebeed33c8d3401a99e0941c708e900
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Aug 15 12:21:01 2009 -0400
Update our mod_wsgi config with some sane defaults, and notes
diff --git a/production/apache/moksha.conf b/production/apache/moksha.conf
index 59aceb8..2a2309c 100644
--- a/production/apache/moksha.conf
+++ b/production/apache/moksha.conf
@@ -1,35 +1,34 @@
#MaxRequestsPerChild 100
#HostnameLookups Off
#Keepalive off
-
-# Default Python Home, with clean site-packages:
-WSGIPythonHome /srv/moksha/tg2env
-
-WSGIRestrictStdout Off
-
-WSGIPythonEggs /srv/moksha/.python-eggs
-
-<VirtualHost 0.0.0.0:8084>
-
- SSLEngine off
- DocumentRoot /srv/moksha
- ServerName Moksha
- ErrorLog logs/moksha_error_log
- CustomLog logs/moksha_access_log combined
-
- Alias /toscawidgets/ /srv/moksha/toscawidgets/
- <Directory /srv/moksha/toscawidgets/>
- Options -FollowSymLinks
- AllowOverride None
- Order allow,deny
- Allow from all
- </Directory>
-
- WSGIScriptAlias / /srv/moksha/apache/moksha.wsgi
-
- <Directory /srv/moksha/apache>
- Order deny,allow
- Allow from all
- </Directory>
+#WSGIPythonEggs /srv/moksha/.python-eggs
+#WSGIRestrictStdout Off
+
+<VirtualHost 0.0.0.0:80>
+ServerName Moksha
+DocumentRoot /usr/share/moksha/production/apache/
+ErrorLog logs/moksha_error_log
+CustomLog logs/moksha_access_log combined
+
+# By default the ToscaWidgets WSGI middleware will serve up widget resource
+# requests, but ideally you want nginx or apache to serve these. In production,
+# it is recommended that you run `python setup.py archive_tw_resources`, which
+# extract all javascript/css resources from widgets and place them in a
+# `toscawidgets` directory and statically serve the widget resources.
+#Alias /toscawidgets/ /var/www/html/toscawidgets/
+#<Directory /var/www/html/toscawidgets/>
+# Options -FollowSymLinks
+# AllowOverride None
+# Order allow,deny
+# Allow from all
+#</Directory>
+
+WSGIScriptAlias / /usr/share/moksha/production/apache/moksha.wsgi
+
+<Directory /usr/share/moksha/production/apache/>
+Order deny,allow
+Allow from all
+</Directory>
</VirtualHost>
+
commit 1721d1c3546f7dff8889616809614ad38b945864
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Aug 15 12:20:54 2009 -0400
Install the server subpackage in the 'paver reinstall' task
diff --git a/pavement.py b/pavement.py
index 156ef9c..3471b78 100644
--- a/pavement.py
+++ b/pavement.py
@@ -183,7 +183,7 @@ def reinstall():
sh('mv dist/* ~/rpmbuild/SOURCES/')
sh('cp moksha.spec ~/rpmbuild/SPECS/')
sh('rpmbuild -ba ~/rpmbuild/SPECS/moksha.spec')
- sh('sudo rpm -ivh --replacefiles --replacepkgs
~/rpmbuild/RPMS/noarch/moksha{,-docs}-%s-1.*noarch.rpm' % options.version.number)
+ sh('sudo rpm -ivh --replacefiles --replacepkgs
~/rpmbuild/RPMS/noarch/moksha{,-docs,-server}-%s-1.*noarch.rpm' %
options.version.number)
@task
def restart_httpd():
commit 47c87839a27b297c6726cff9d8351922f22af537
Author: Luke Macken <lmacken(a)redhat.com>
Date: Sat Aug 15 12:20:25 2009 -0400
Break out the mod_wsgi configuration into a moksha-server subpackage
diff --git a/moksha.spec b/moksha.spec
index a28526b..9b2be34 100644
--- a/moksha.spec
+++ b/moksha.spec
@@ -58,6 +58,16 @@ Requires: %{name} = %{version}-%{release}
This package contains developer documentation for Moksha along with
other supporting documentation
+%package server
+Summary: mod_wsgi Moksha server
+Group: Applications/Internet
+Requires: %{name} = %{version}-%{release}
+Requires: mod_wsgi httpd
+
+%description server
+This package contains an Apache mod_wsgi configuration for Moksha.
+
+
%prep
%setup -q
@@ -77,12 +87,12 @@ make -C docs html
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/apache
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/nginx
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/production/rabbitmq
-
-%{__mkdir_p} -m 0755 %{buildroot}/%{_localstatedir}/log/%{name}
%{__mkdir_p} -m 0700 %{buildroot}/%{_localstatedir}/cache/%{name}
+%{__mkdir_p} -m 0755 %{buildroot}/etc/httpd/conf.d
%{__install} production/*.* %{buildroot}%{_datadir}/%{name}/production/
%{__install} production/apache/* %{buildroot}%{_datadir}/%{name}/production/apache
+%{__install} production/apache/moksha.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/
%{__install} production/nginx/* %{buildroot}%{_datadir}/%{name}/production/nginx
%{__install} production/rabbitmq/* %{buildroot}%{_datadir}/%{name}/production/rabbitmq
@@ -95,16 +105,21 @@ make -C docs html
%doc README AUTHORS LICENSE COPYING
%{python_sitelib}/%{name}/
%attr(-,apache,root) %{_datadir}/%{name}
-%attr(-,apache,root) %{_localstatedir}/log/%{name}
%{python_sitelib}/%{name}-%{version}-py%{pyver}.egg-info/
%attr(-,apache,apache) %dir %{_localstatedir}/cache/%{name}
%{_bindir}/moksha-hub
+%files server
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/moksha.conf
+
%files docs
%defattr(-,root,root)
%doc docs/_build/html
%changelog
+* Sat Aug 15 2009 Luke Macken <lmacken(a)redhat.com> - 0.3.1-2
+- Break out the mod_wsgi configuration into a moksha-server subpackage.
+
* Fri Aug 14 2009 Luke Macken <lmacken(a)redhat.com> - 0.3.1-1
- 0.3.1