Home

Mongoose Web Server Spec @ 2010-03-10 20:19:33
Filed under: Code  Fedora  Linux  Python  Tech 
I happened to take a look at this and see there wasn't a package for it. It's one of those items that I don't have time to keep up with but I think would be a nice package to have in Fedora. If anyone wants to pick up with this and run with it be my guest!

The package includes a subpackage for devel (a single header file) and a subpackage for the Python bindings. There is also a patch to get the Python code to find the shared object.

Have fun!

Patch: mongoose-site-location.patch
--- bindings/python/mongoose.py	2010-03-10 20:07:53.735407453 -0500
+++ bindings/python/mongoose.py	2010-03-10 20:09:08.935760549 -0500
@@ -110,7 +110,8 @@
 
 	def __init__(self, **kwargs):
 		dll_extension = os.name == 'nt' and 'dll' or 'so'
-		self.dll = ctypes.CDLL('_mongoose.%s' % dll_extension)
+		from distutils.sysconfig import get_python_lib
+		self.dll = ctypes.CDLL(get_python_lib(1) + '/_mongoose.%s' % dll_extension)
 		start = self.dll.mg_start
 		self.ctx = ctypes.c_voidp(self.dll.mg_start()).value
 		self.version = ctypes.c_char_p(self.dll.mg_version()).value
Spec:
# sitearch for others (remove the unneeded one)
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}


Name:           mongoose
Version:        2.8
Release:        1%{?dist}
Summary:        Simple and easy to use web server

Group:          System Environment/Daemons
License:        MIT
URL:            http://code.google.com/p/mongoose/
Source0:        http://mongoose.googlecode.com/files/%{name}-%{version}.tgz
Patch0:         mongoose-site-location.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


%description
Mongoose is an easy to use web server. It can be embedded into
existing application to provide a web interface to it.


%package python
Summary:       Python bindings for the mongoose web server
Requires:      mongoose


%description python
Mongoose is an easy to use web server. It can be embedded into
existing application to provide a web interface to it. This
package includes the bindings for the Python programming language.


%package devel
Summary:       Development files for the mongoose web server
BuildArch:     noarch


%description devel
Mongoose is an easy to use web server. It can be embedded into
existing application to provide a web interface to it. This
package includes the development files.


%prep
%setup -qn %{name}
%patch0


%build
make %{?_smp_mflags} linux


%install
rm -rf $RPM_BUILD_ROOT
# Install the base
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
cp %{name} $RPM_BUILD_ROOT/%{_bindir}
cp %{name}.1 $RPM_BUILD_ROOT/%{_mandir}/man1/

# Install the python bindings
mkdir -p $RPM_BUILD_ROOT/%{python_sitearch}
cp bindings/python/mongoose.py _%{name}.so $RPM_BUILD_ROOT/%{python_sitearch}

# Install the development files
mkdir -p $RPM_BUILD_ROOT/%{_includedir}/%{name}/
cp %{name}.h $RPM_BUILD_ROOT/%{_includedir}/%{name}/


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz


%files python
%defattr(-,root,root,-)
%{python_sitearch}/_%{name}.so
%{python_sitearch}/%{name}.py*


%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}/


%changelog
* Wed Mar 10 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> 2.8-1
- Initial spec

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:          


Facebook's tornado rpm spec @ 2009-09-12 15:47:49
Filed under: Code  Fedora  Python  Tech 
Not sure if I'm going to push this up as I don't see myself using it (and thus maintain the package properly) so if you want to run with it, go ahead :-).

Edit: Some feeds were reporting funny results with the rendered code tags ... changed to pre.

[steve@mobileoppressionpalace SPECS]$ cat tornado.spec                                                                   
# sitelib for noarch packages                                                                                            
%{!?python_sitelib: %global python_sitelib %(%{__python} -c \
"from distutils.sysconfig import get_python_lib; print get_python_lib()")}                                                                                                                        

Name:           tornado
Version:        0.1    
Release:        1%{?dist}
Summary:        An open source version of the scalable, non-blocking web server

Group:          Development/Languages
License:        ASL 2.0
URL:            http://www.tornadoweb.org/
Source0:        http://www.tornadoweb.org/static/%{name}-%{version}.tar.gz
Patch0:         tornado-no-hashbang-for-non-exec-scripts.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  python-devel
Requires:       python-pycurl, python-simplejson


%description
Tornado is an open source version of the scalable, non-blocking web server
and tools that power FriendFeed. The FriendFeed application is written using
a web framework that looks a bit like web.py or Google's webapp, but with
additional tools and optimizations to take advantage of the underlying
non-blocking infrastructure.

%prep
%setup -q
%patch0 -p 1


%build
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc README
# For noarch packages: sitelib
%{python_sitelib}/*


%changelog
* Sat Sep 12 2009 Steve 'Ashcrow' Milner  0.1-1
- Initial package
[steve@mobileoppressionpalace SPECS]$ cat ../SOURCES/tornado-no-hashbang-for-non-exec-scripts.patch 
diff -ur tornado-0.1/tornado/auth.py tornado-0.1.mine/tornado/auth.py                               
--- tornado-0.1/tornado/auth.py 2009-09-10 13:32:56.000000000 -0400                                 
+++ tornado-0.1.mine/tornado/auth.py    2009-09-12 14:01:08.716733153 -0400                         
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/database.py tornado-0.1.mine/tornado/database.py                       
--- tornado-0.1/tornado/database.py     2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/database.py        2009-09-12 14:02:40.012605235 -0400                 
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/escape.py tornado-0.1.mine/tornado/escape.py                           
--- tornado-0.1/tornado/escape.py       2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/escape.py  2009-09-12 14:02:48.993692391 -0400                         
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/httpclient.py tornado-0.1.mine/tornado/httpclient.py                   
--- tornado-0.1/tornado/httpclient.py   2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/httpclient.py      2009-09-12 14:03:04.558617851 -0400                 
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/httpserver.py tornado-0.1.mine/tornado/httpserver.py                   
--- tornado-0.1/tornado/httpserver.py   2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/httpserver.py      2009-09-12 14:03:15.499707010 -0400                 
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/__init__.py tornado-0.1.mine/tornado/__init__.py                       
--- tornado-0.1/tornado/__init__.py     2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/__init__.py        2009-09-12 14:03:24.101684722 -0400                 
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/ioloop.py tornado-0.1.mine/tornado/ioloop.py                           
--- tornado-0.1/tornado/ioloop.py       2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/ioloop.py  2009-09-12 14:03:43.310690548 -0400                         
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/iostream.py tornado-0.1.mine/tornado/iostream.py                       
--- tornado-0.1/tornado/iostream.py     2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/iostream.py        2009-09-12 14:03:49.922692867 -0400                 
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook                                                                          
 #                                                                                                  
 # Licensed under the Apache License, Version 2.0 (the "License"); you may                          
diff -ur tornado-0.1/tornado/locale.py tornado-0.1.mine/tornado/locale.py                           
--- tornado-0.1/tornado/locale.py       2009-09-10 13:32:56.000000000 -0400                         
+++ tornado-0.1.mine/tornado/locale.py  2009-09-12 14:03:56.554607130 -0400                         
@@ -1,5 +1,3 @@                                                                                     
-#!/usr/bin/env python                                                                              
-#                                                                                                  
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff -ur tornado-0.1/tornado/options.py tornado-0.1.mine/tornado/options.py
--- tornado-0.1/tornado/options.py      2009-09-10 13:32:56.000000000 -0400
+++ tornado-0.1.mine/tornado/options.py 2009-09-12 14:04:11.897690510 -0400
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff -ur tornado-0.1/tornado/s3server.py tornado-0.1.mine/tornado/s3server.py
--- tornado-0.1/tornado/s3server.py     2009-09-10 13:32:56.000000000 -0400
+++ tornado-0.1.mine/tornado/s3server.py        2009-09-12 14:04:18.419607955 -0400
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff -ur tornado-0.1/tornado/template.py tornado-0.1.mine/tornado/template.py
--- tornado-0.1/tornado/template.py     2009-09-10 13:32:56.000000000 -0400
+++ tornado-0.1.mine/tornado/template.py        2009-09-12 14:04:25.778730891 -0400
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff -ur tornado-0.1/tornado/web.py tornado-0.1.mine/tornado/web.py
--- tornado-0.1/tornado/web.py  2009-09-10 13:32:56.000000000 -0400
+++ tornado-0.1.mine/tornado/web.py     2009-09-12 14:04:32.843607704 -0400
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff -ur tornado-0.1/tornado/wsgi.py tornado-0.1.mine/tornado/wsgi.py
--- tornado-0.1/tornado/wsgi.py 2009-09-10 13:32:56.000000000 -0400
+++ tornado-0.1.mine/tornado/wsgi.py    2009-09-12 14:04:39.124604938 -0400
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
 # Copyright 2009 Facebook
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:        


Impressed by KDE On Fedora 11 @ 2009-06-13 13:29:51
Filed under: Fedora  Linux  Personal  Tech 
I really am. I'm using it right now and might switch over to it for my general work. It's decently fast, pretty eye candy, has a lot of good default applications and, like GNOME, is very easy to use. Good job to the KDE guys as well as the Fedora KDE packagers!
 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:        


Python Director 1.1.3 Released @ 2009-01-07 20:51:21
Filed under: Code  director  Fedora  Tech 
Python Director 1.1.3 has been released. The changes are pretty minor from 1.1.2, mainly removing the ugly dict hack and fixing documentation. Thanks to fijal for verifying it on PyPy.There also is now a branch for Python 3.0 if you are already making the move..

Download. Project Page Pypi Documentation Ohloh

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:        


Updating python-pygments packages to 1.0 @ 2008-12-21 21:23:32
Filed under: Fedora  Linux  Python  Tech 
If you use pygments in Fedora give the updated packages a go and use Bodhi to report back if it works or doesn't :-)

Pygments 1.0 Rawhide
Pygments 1.0 F10
Pygments 1.0 F9

 digg it   seed it   del.icio.us   ma.gnolia
Comments: 0 Tags:        


 
A Django joint.
© 2007-2009 Steve 'Ashcrow' Milner | Studio7designs | Arbutus Photography