Commits

Jannis Leidel  committed 0cd2f62

Added port file for uWSGI

  • Participants
  • Parent commits 2d3c2a6

Comments (0)

Files changed (2)

File www/uwsgi/Portfile

+# $Id%
+
+PortSystem 1.0
+
+name            uwsgi
+version         0.9.2
+categories      www python
+platforms       darwin
+maintainers     gmail.com:leidel
+description     Python WSGI adapter module for Apache.
+long_description uWSGI is fast (pure C), self-healing, developer-friendly \
+    WSGI server, aimed for professional Python webapps deployment and \
+    development.
+homepage        http://projects.unbit.it/uwsgi/
+depends_lib     port:libxml2
+depends_build   bin:hg:mercurial
+
+use_configure   no
+universal_variant   no
+patch.pre_args  -p1
+
+fetch.type      hg
+hg.url          http://projects.unbit.it/hg/uwsgi/
+
+
+set py_extension ""
+
+switch ${os.arch} {
+   i386 {
+       set uwsgi_arch "x86"
+   }
+   powerpc {
+       set uwsgi_arch "ppc"
+   }
+}
+set py_version "Py26"
+
+destroot {
+    xinstall -m 755 -d ${destroot}${prefix}/bin
+    xinstall -m 755 ${worksrcpath}/uwsgi${py_extension} ${destroot}${prefix}/bin
+}
+
+if {![variant_isset python25]
+    && ![variant_isset python26]} {
+    default_variants +python26
+}
+
+variant python25 conflicts python24 python26 description {Use Python 2.5} {
+    depends_lib-append port:python25
+    set py_version "Py25"
+}
+
+variant python26 conflicts python24 python25 description {Use Python 2.6} {
+    depends_lib-append port:python26
+    set py_version "Py26"
+    set py_extension "26"
+    patchfiles-append  patch-Makefile.OSX.Py26.diff
+}
+
+build.args          -f ${worksrcpath}/Makefile.OSX.${uwsgi_arch}.${py_version}

File www/uwsgi/files/patch-Makefile.OSX.Py26.diff

+diff -r 93e83397bf0d Makefile.OSX.ppc.Py26
+--- /dev/null
++++ b/Makefile.OSX.ppc.Py26
+@@ -0,0 +1,28 @@
++CC=gcc
++
++PYTHON_CFLAGS=`python2.6-config --cflags`
++PYTHON_LIBS=`python2.6-config --libs`
++XML_CFLAGS=`xml2-config --cflags`
++XML_LIBS=`xml2-config --libs`
++
++CFLAGS=$(PYTHON_CFLAGS) $(XML_CFLAGS) -DBSD -arch ppc
++LD_FLAGS=$(PYTHON_LIBS) $(XML_LIBS) -DBSD -arch ppc
++
++PROGRAM=uwsgi26
++
++all:	uwsgi
++
++uwsgi:	utils.o socket.o main.o
++	$(CC) $(LD_FLAGS) utils.o socket.o main.o -o $(PROGRAM)
++
++utils.o: utils.c
++	$(CC) -c $(CFLAGS) utils.c
++
++socket.o: socket.c
++	$(CC) -c $(CFLAGS) socket.c
++
++main.o:	uwsgi.c
++	$(CC) -c $(CFLAGS) -o main.o uwsgi.c
++
++clean:
++	rm -f utils.o socket.o main.o
+diff -r 93e83397bf0d Makefile.OSX.ub.Py26
+--- /dev/null
++++ b/Makefile.OSX.ub.Py26
+@@ -0,0 +1,28 @@
++CC=gcc
++
++PYTHON_CFLAGS=`python2.6-config --cflags`
++PYTHON_LIBS=`python2.6-config --libs`
++XML_CFLAGS=`xml2-config --cflags`
++XML_LIBS=`xml2-config --libs`
++
++CFLAGS=$(PYTHON_CFLAGS) $(XML_CFLAGS) -DBSD -arch ppc -arch i386
++LD_FLAGS=$(PYTHON_LIBS) $(XML_LIBS) -DBSD -arch ppc -arch i386
++
++PROGRAM=uwsgi
++
++all:	uwsgi26
++
++uwsgi:	utils.o socket.o main.o
++	$(CC) $(LD_FLAGS) utils.o socket.o main.o -o $(PROGRAM)
++
++utils.o: utils.c
++	$(CC) -c $(CFLAGS) utils.c
++
++socket.o: socket.c
++	$(CC) -c $(CFLAGS) socket.c
++
++main.o:	uwsgi.c
++	$(CC) -c $(CFLAGS) -o main.o uwsgi.c
++
++clean:
++	rm -f utils.o socket.o main.o
+diff -r 93e83397bf0d Makefile.OSX.x86.Py26
+--- /dev/null
++++ b/Makefile.OSX.x86.Py26
+@@ -0,0 +1,28 @@
++CC=gcc
++
++PYTHON_CFLAGS=`python2.6-config --cflags`
++PYTHON_LIBS=`python2.6-config --libs`
++XML_CFLAGS=`xml2-config --cflags`
++XML_LIBS=`xml2-config --libs`
++
++CFLAGS=$(PYTHON_CFLAGS) $(XML_CFLAGS) -DBSD -arch i386
++LD_FLAGS=$(PYTHON_LIBS) $(XML_LIBS) -DBSD -arch i386
++
++PROGRAM=uwsgi26
++
++all:	uwsgi
++
++uwsgi:	utils.o socket.o main.o
++	$(CC) $(LD_FLAGS) utils.o socket.o main.o -o $(PROGRAM)
++
++utils.o: utils.c
++	$(CC) -c $(CFLAGS) utils.c
++
++socket.o: socket.c
++	$(CC) -c $(CFLAGS) socket.c
++
++main.o:	uwsgi.c
++	$(CC) -c $(CFLAGS) -o main.o uwsgi.c
++
++clean:
++	rm -f utils.o socket.o main.o