System-wide Chromeless installation #135

Open
wants to merge 19 commits into
from

Conversation

Projects
None yet
1 participant

Hi!

I'm working on the system-wide installation of Chromeless and it's RPM package for ALT Linux distributions.

One direction of activity is to use the system-wide available xulrunner (branch 'use-sys-xulrunner'). In accordance with the policy, the users of a distribution should not download and install non-packaged software. However, the desired version of the xulrunner can be required via the package dependency mechanism. I found that the xulrunner 2.0.1 is the minimal version that runs chromeless properly and modify the application.ini.template accordingly.

Now, if the mozfetcher fails to find a suitable xulrunner configuration for the current platform, it tries to use the special "default" entry of the 'software' dictionary. That entry, if exists, should point to the system xulrunner installation and thus is not required to have a signature: the security and version issues are handled by the package subsystem. In fact, I decided not to require signatures for all of the dictionary entries, meaning that all users who would edit the _config.py know what they are doing. The "path" value of the "default" entry is a subject to be configured for a particular distribution. However, later I realized that it is more naturally to have the path to be calculated relatively to the cuddlefish root (see below).

The other, larger direction of activity is to develop an effective and portable system layout for the chromeless files (branch 'sys-layout'). More details follow.

The first thing I encountered was that chromeless is unable to run applications supplied in RO mode: some of the files in the application runtime directory (i.e. build/appname) are linked to the original files, yet attempts are made to modify them. If the original file is accessible in RO mode only, then an I/O error occurs. I added the code converting links to copies on the fly if the attempt to open the file in RW mode fails.

Then I modified _dirs.py in order to place the 'build' directory in the user's home directory under the ~/.chromeless. With a system-wide available 'chromeless' command it seems strange to make a 'build' subdirectory in every current directory that come, doesn't it?

The test outputs are now written under the ~/.chromeless too.

In order to run the chromeless script with the CUDDLEFISH_ROOT environment variable set to a proper value I've added the wrapper shell script. The variable is set to the default value if it doesn't have a value yet. That default value is the neutral '/usr/local/lib/chromeless' and is subject to be substituted for a particular distribution.

Taken the cuddlefish root as the only reference point, I then tended to adapt the chromeless code to search for all of the files from that root. First, I modifyed the chromless Python script itself to look for the default example ('first_browser' application) in the cuddlefish root directory. Then I added the 'run-mozilla.sh' to be installed in the cuddlefish root and modified mozfetcher, configuring the default xulrunner to be located in that directory too. Now, it is enough to place the links to the proper 'xulrunner' and 'xulrunner-bin' files in the cuddlefish root directory to make the chromeless be run by any user of the system.

The resulting file layout can be found in the chromeless-*.rpm packages in the Sisyphus repository: http://packages.altlinux.org/en/Sisyphus/srpms/chromeless/get . The layout is tested and seems to work.

I've merged the branches into the master trying to keep the original behavior of a locally run ./chromeless. It seems to run in that manner too.

See you in the `git log`!

  Paul.

Paul Wolneykien added some commits Jul 8, 2011

Paul Wolneykien Add support for a default xulrunner configuration
When no match for the platform is found in the software configuration
dictionary in impl/mozfetcher/_config.py then the "default" entry is
used if exists. In order to run an independently upgraded system-wide
xulrunner version the use of unsigned versions is made possible.
c185e26
Paul Wolneykien Require xulrunner v2.0.1 or higher
The minimal xulrunner version that seems to work with the framework
is 2.0.1. The maximal version is leaved open to avoid conflicts with
distribution updates.
5d786ea
Paul Wolneykien Modify on-demand copies of application files
The attempt is made to modify some of the linked files in the root
directory of a runnung application (i.e. build/name). However, the
original file a link is pointed to may not be write-accessible for
the running process (in the case the application path is passed from
one user to another, or it is a system-wide installation of an example
application). When that is the case, the symlink is substituted with
the write-accessible copy.
60c836c
Paul Wolneykien Merge branch 'sys-layout' d2ffc74
Paul Wolneykien Place the 'build' directory under the user home directory
Introduce the 'home' directory with the path "~/.chromeless". Place
the 'build' under that 'home' directory (i.e. "~/.chromeless/build").
2d8ad1a
Paul Wolneykien Merge branch 'sys-layout' e52d2df
Paul Wolneykien Write the test output to the home directory
Symlink (fallback to copy) the 'test_harness' module to the home
modules directory ("~/.chromeless/modules/internal) and write the
test output script to that module copy. Thus, the contents of
the original module directory are not modified.
5517dec
Paul Wolneykien Add the chromeless system-wide startup script
The 'chromeless' startup script to be placed in the default path
sets the CUDDLEFISH_ROOT environment variable and then runs the
main Chromeless Python script.
239527d
Paul Wolneykien Merge branch 'sys-layout' 87d0d0c
Paul Wolneykien Search for the 'first browser' example from the cuddlefish root e355734
Paul Wolneykien Merge branch 'sys-layout' 10469e7
Paul Wolneykien Add the `run-mozilla.sh' script 369c0bb
Paul Wolneykien Merge branch 'sys-layout' 1da87c5
Paul Wolneykien Merge branch 'use-sys-xulrunner' into sys-layout 0942436
Paul Wolneykien Configure to use only the default xulrunner
Configure to use only the default xulrunner for a system-wide
installation.
e8f00e7
Paul Wolneykien Configure the xulrunner path relatively to the cuddlefish root c7ab32e
Paul Wolneykien Merge branch 'sys-layout' 8dda94c
Paul Wolneykien Enable the xulrunner downloads in the master sources version
This reverts commit e8f00e7.
84cd929
Paul Wolneykien Update the chromeless version var d44a85a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment