Skip to content
Browse files

debian packaging

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@566 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
1 parent bfbf7e1 commit 631dce560d0208cb87a4a3d0249fa7fb12d1a12f lkcl committed Apr 30, 2009
Showing with 230 additions and 53 deletions.
  1. +17 −13 bootstrap.py
  2. +1 −1 debian/changelog
  3. +27 −26 debian/control
  4. +18 −2 debian/copyright
  5. +1 −1 debian/dirs
  6. +149 −0 debian/pyjsbuild.1
  7. +16 −10 debian/rules
  8. +1 −0 examples/toggle/Toggle.py
View
30 bootstrap.py
@@ -5,20 +5,20 @@
"""
pyjsbuild = """#!%s
-pth = r'%s'
+pyjspth = r'%s'
import os
import sys
sys.path[0:0] = [
- pth,
+ r'%s',
]
import pyjs
-pyjs.path += [os.path.join(pth, 'library'),
-os.path.join(pth, 'library', 'builtins'),
-os.path.join(pth, 'addons'),
+pyjs.path += [os.path.join(pyjspth, 'library'),
+os.path.join(pyjspth, 'library', 'builtins'),
+os.path.join(pyjspth, 'addons'),
]
-sys.argv.extend(['-D', pth])
+sys.argv.extend(['-D', pyjspth])
import pyjs.build
@@ -28,16 +28,16 @@
pyjscompile = """#!%s
-pth = r'%s'
+pyjspth = r'%s'
import os
import sys
sys.path[0:0] = [
- pth,
+ r'%s',
]
import pyjs
-pyjs.path += [os.path.join(pth, 'library')]
+pyjs.path += [os.path.join(pyjspth, 'library')]
if __name__ == '__main__':
pyjs.main()
@@ -58,7 +58,7 @@
import os
import sys
-def make_cmd(prefix, pth, cmdname, txt):
+def make_cmd(prefix, pth, pyjspth, cmdname, txt):
if sys.platform == 'win32':
cmd_name = cmdname + ".py"
@@ -75,7 +75,7 @@ def make_cmd(prefix, pth, cmdname, txt):
if os.path.exists(cmd):
os.unlink(cmd)
f = open(cmd, "w")
- f.write(txt % (sys.executable, pth))
+ f.write(txt % (sys.executable, pyjspth, pth))
f.close()
if hasattr(os, "chmod"):
@@ -96,11 +96,15 @@ def make_cmd(prefix, pth, cmdname, txt):
else:
pth = os.path.abspath(os.getcwd())
+ pyjspth = pth
if len(sys.argv) == 3:
prefix = sys.argv[2]
+ elif len(sys.argv) == 4:
+ prefix = sys.argv[3]
+ pyjspth = sys.argv[2]
else:
prefix = "."
- make_cmd(prefix, pth, "pyjsbuild", pyjsbuild)
- make_cmd(prefix, pth, "pyjscompile", pyjscompile)
+ make_cmd(prefix, pth, pyjspth, "pyjsbuild", pyjsbuild)
+ make_cmd(prefix, pth, pyjspth, "pyjscompile", pyjscompile)
View
2 debian/changelog
@@ -1,4 +1,4 @@
-python-pyjamas (0.5p1-1) unstable; urgency=low
+pyjamas (0.5p1-1) unstable; urgency=low
* Initial release (Closes: #501744)
View
53 debian/control
@@ -1,34 +1,35 @@
-Source: python-pyjamas
+Source: pyjamas
Section: python
Priority: extra
Maintainer: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
-Build-Depends: debhelper (>= 7)
-Standards-Version: 3.7.3
+Build-Depends: debhelper (>= 7), python-support, python (>= 2.4)
+Standards-Version: 3.8.0
Homepage: http://pyjs.org
-Package: python-pyjamas
+Package: pyjamas
Architecture: all
Depends: python (>= 2.4), python-central (>= 0.5.7)
-Description: Python Web Widget Toolkit and Python-to-Javascript Compiler
- Pyjamas is a stand-alone python to javascript compiler, an AJAX
- framework / library and a Desktop-like Widget set API.
- .
- Pyjamas is typically used for the development of "Web 2.0"
- RIAs, where the application can be almost exclusively written
- in Python, instead of Javascript, yet compiled to run in the
- user's browser.
- .
- Pyjamas does not do the "usual" static AJAX javascript framework
- paradigm but instead provides the developer with the tools and
- the libraries to write their own Web 2.0 AJAX Framework, as if
- they were programming and working with a standard Desktop Widget
- Set.
- .
- The Pyjamas User-Interface Widget Set is very very similar to that
- of Python-Qt4 and Python-Gtk2, with the distinct advantage that
- applications run in all major web browsers, with absolutely no plugins
- required (only javascript need be enabled). Additional advantages
- over the use of standard Desktop Widget sets are that Pyjamas provides
- direct access to the full set of HTML features - CSS, NPAPI Plugins
- such as Adobe Flash, and SVG 2D Canvas. Are all directly available.
+Description: Python web widget toolkit and Python-to-Javascript compiler
+ Pyjamas is a stand-alone Python to Javascript compiler, an AJAX
+ framework / library and a Desktop-like Widget set.
+ .
+ Pyjamas is typically used for the development of "Web 2.0" RIAs,
+ where the application can be almost exclusively written in Python,
+ instead of Javascript, yet compiled to run in the user's browser.
+ .
+ Pyjamas does not do the "usual" static AJAX Javascript framework
+ paradigm but instead provides the developer with the tools and the
+ libraries to write their own Web 2.0 AJAX Framework, as if they
+ were programming and working with a standard Desktop Widget Set.
+ All the usual browser incompatibilities (e.g. History Management
+ and HTTPRequest) are taken care of.
+ .
+ The Pyjamas User-Interface Widget Set is startlingly similar to
+ that of Python-Qt4 and Python-Gtk2, with the distinct advantage
+ that applications run in all major web browsers, with absolutely
+ no plugins required (only Javascript need be enabled). Additional
+ advantages over the use of standard Desktop Widget sets are that
+ Pyjamas provides direct access to the full set of HTML features
+ - CSS, NPAPI Plugins such as Adobe Flash, and SVG 2D Canvas.
+ All these are directly available.
View
20 debian/copyright
@@ -3,16 +3,32 @@ on Tue, 24 Mar 2009 19:26:53 +0000.
It was downloaded from http://pyjs.org
-Upstream Author(s):
+Upstream Authors:
Luke Kenneth Casson Leighton <lkcl@lkcl.net>
James Tauber
Google, Inc.
+ Willie Gollino - wgollino@yahoo.com
+ Dobes Vandermeer - dobesv@gmail.com
+ Bernd Dorn - <bernd.dorn@lovelysystems.com>
+ Luis Pamirez
+ Erik Westra - ewestra [at] gmail [dot] com
+
+Other Contributors:
+
+ Vicente J. Ruiz Jurado - vjrj@ourproject.org
+ Gerard Labadie - gerard.labadie@gmail.com
+ Stephan Diehl - stephan.diehl@gmx.net
+ John Lehman - j1o1h1n@gmail.com
+ Jürgen Kartnaller - <kartnaller@lovelysystems.com>
+ G Clinch
+ Kees Boss
Copyright:
Copyright (C) 2008, 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
- Copyright (C) 2006 James Tauber
+ Copyright (C) 2006, 2007 James Tauber
+ Copyright (C) 2006 Google, Inc.
License:
View
2 debian/dirs
@@ -1,4 +1,4 @@
usr/bin
usr/share/pyjamas
-usr/share/doc/python-pyjamas
+usr/share/doc/pyjamas
View
149 debian/pyjsbuild.1
@@ -0,0 +1,149 @@
+.TH PYJSBUILD 1 "April 28, 2009"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+pyjsbuild \- builds a web application
+.SH SYNOPSIS
+.B pyjsbuild
+.RI [ options ] application
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B pyjsbuild
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBpyjsbuild\fP is a program that compiles python (pyjamas) web applications
+into javascript, automatically adding suitable boilerplate, "loader"
+infrastructure and run-time libraries, for detection and support of all major
+web browsers. Typical usage is simply "pyjsbuild {Application}.py" and the
+compiled application will be created in a subdirectory called "output".
+If a subdirectory called "public" exists in the same directory in which
+pyjsbuild is run, its contents will be copied verbatim and recursively
+into the "output" directory.
+.sp
+To load the compiled application, as usual for any web application,
+simply point the web browser at the {Application}.html file, which
+can be found in the output directory. If at compile-time a file
+named {Application}.html was not found in the same directory as
+{Application}.py or in the "public" folder, pyjsbuild will create
+a stub html file, automatically.
+.sp
+As applications are expected to run in a web browser as javascript,
+the "standard" python libraries are \fBnot\fP accessible to the
+web application. Hence, the pyjamas framework provides independent
+reimplementations of standard python builtins, types and libraries
+(that are written in, or compiled to, javascript, along with the
+rest of the application). It is essential that a developer not
+confuse standard python libraries with the pyjamas libraries if
+the \-I option is used to specify additional library paths.
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.TP
+.B \-o OUTPUT, --output=OUTPUT
+directory to which the webapp should be written
+.TP
+.B \-j JS_INCLUDES, --include-js=JS_INCLUDES
+javascripts to load into the same frame as the rest of the script
+.TP
+.B \-I LIBRARY_DIRS, --library_dir=LIBRARY_DIRS
+additional paths appended to PYJSPATH
+.TP
+.B \-D DATA_DIR, --data_dir=DATA_DIR
+path for data directory
+.TP
+.B \-m, --dynamic-modules
+Split output into separate dynamically-loaded modules (experimental)
+.TP
+.B \-P PLATFORMS, --platforms=PLATFORMS
+platforms to build for, comma-separated (default is all)
+.TP
+.B \-d, --debug
+.TP
+.B \-O, --optimize
+Optimize generated code (removes all print statements)
+.TP
+.B \-c, --cache_buster
+Enable browser cache-busting (MD5 hash added to output filenames)
+.SH PLATFORM SUPPORT
+Supported platforms are IE6, Mozilla, Safari, OldMoz and Opera.
+The \-P option allows a subset of platforms to be compiled, if
+desired. Platform support is done by looking for platform-specific
+"overrides" in a subdirectory called "platform". So, if the application
+is called "Hello.py", and there exists a file "platform/HelloIE6.py"
+then any functions or classes in HelloIE6.py will "override" any such
+functions or classes in the "Hello.py" module, specifically when
+the code for the IE6 platform is compiled.
+.sp
+There are plenty of examples and instances throughout the pyjamas
+libraries where platform-overrides are used (for example, the
+BrowserDetect.py example). Note that because pyjamas takes care
+of "merging" the platform-specific overrides in each module,
+it is not necessary to override an entire class: only make
+alternatives for those functions or class methods which absolutely
+need replacing on a per-platform basis, and it is good practice
+to split the application design into functions and classes where
+as few platform-specific lines of code as possible go into the
+platform-specific overrides.
+.SH CACHE BUSTING
+Browsers, Web Servers and Web Frameworks have a nasty habit of
+cacheing HTML and Javascript files, which throws a spanner in
+the works of rapid application development as the developer has
+to clear the browsers' cache, delete the HTTP proxy cache, locate
+and delete the Web Framework's cache (e.g. Joomla), clear the Web
+Browser cache, restart the web server, restart the web browser etc.
+To help avoid such stupidities, use the \-c option to add a unique
+MD5 hash to the end of all output filenames. The MD5 hash that is
+appended is the MD5 hash of the contents of each file.
+.SH OPTIMISATION
+\fBpyjsbuild\fP is \fBnot\fP a javascript compressor, it is a
+compiler. Use \-m to enable dynamic (shared) modules if space is
+at a premium, or consider running the javascript through a standard
+javascript compressor such as YUI Compressor. Also bear in mind
+that the \-d option increases the size of the compiled javascript
+by four to five times, so do not use \-d for release builds.
+.SH DEBUGGING
+\fBpyjsbuild\fP is \fBnot\fP an interpreter, it is a compiler,
+and the resultant javascript output will be interpreted by the
+web browser, not the standard python interpreter. It is worth
+emphasising this because python developers who are expecting
+pyjsbuild to perform all the usual tricks that the standard python
+interpreter performs are in for a bit of a shock. Therefore, just
+as with all Web 2.0 Javascript applications, debugging needs to
+be done using \fBjavascript\fP tools, such as the Microsoft Script
+Debugger for IE, and Firebug and Venkman for Firefox (use of both
+is thoroughly recommended). However, there are circumstances where
+script debugging is either impossible or inconvenient. For that,
+there is the "-d" option which, whilst not perfect, provides a
+reasonable approximation of python run-time stack trace exception
+handling.
+.SH SEE ALSO
+.BR pyjscompile (1),
+.BR http://pyjs.org
+.SH AUTHOR
+pyjamas was written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>,
+James Tauber and others. It originated from a port of Google Web Toolkit,
+which is Copyright Google, Inc.
+.PP
+This manual page was written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>,
+for the Debian project (but may be used by others).
View
26 debian/rules
@@ -27,7 +27,8 @@ build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
- python setup.py build
+ python bootstrap.py /usr/share/pyshared /usr/share/pyjamas .
+ python run_bootstrap_first_then_setup.py build
touch $@
@@ -37,7 +38,7 @@ clean:
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
- python setup.py clean
+ python run_bootstrap_first_then_setup.py clean
dh_clean
@@ -48,22 +49,24 @@ install: build
dh_installdirs
# Add here commands to install the package into debian/pyjamas.
- python setup.py install --root=debian/python-pyjamas
+ python run_bootstrap_first_then_setup.py install --root=debian/pyjamas
+ mv debian/pyjamas/usr/share/pyjamas/examples \
+ debian/pyjamas/usr/share/doc/pyjamas/examples
+ cp -aux doc/* debian/pyjamas/usr/share/doc/pyjamas/
+ cp bin/pyjsbuild debian/pyjamas/usr/bin
+ cp bin/pyjscompile debian/pyjamas/usr/bin
# Build architecture-independent files here.
binary-indep: build install
-# Build architecture-dependent files here.
-binaryrch: build install
-
dh_testdir
dh_testroot
dh_installchangelogs CHANGELOG
dh_installdocs
dh_installexamples
- dh_python
- dh_installman
+ dh_installman
+ dh_pysupport
dh_link
dh_compress
dh_fixperms
@@ -73,5 +76,8 @@ binaryrch: build install
dh_md5sums
dh_builddeb
-binary: binary-indep binaryrch
-.PHONY: build clean binary-indep binaryrch binary install configure
+# Build architecture-dependent files here.
+binary-arch: build install
+
+binary: binary-indep
+.PHONY: build clean binary-indep binary-arch binary install configure
View
1 examples/toggle/Toggle.py
@@ -7,6 +7,7 @@
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.CustomButton import CustomButtom
from pyjamas.ui.ToggleButton import ToggleButton
+from pyjamas.ui.PushButton import PushButton
from pyjamas import DOM

0 comments on commit 631dce5

Please sign in to comment.
Something went wrong with that request. Please try again.