Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. --------------------------------------------------------------------------------
  2.   Packaging suggestions for NetSurf                               30 July 2008
  3. --------------------------------------------------------------------------------
  4.  
  5.   This document lays out some suggestions for people interested in packaging
  6.   NetSurf for UNIX-like OSes.
  7.  
  8.   We consider the Debian (and thus Ubuntu) packages excellent examples to
  9.   crib from.  They do everything right.
  10.  
  11.  
  12.   Building NetSurf
  13. ==================
  14.  
  15.   You should change Makefile.config to be specific (rather than rely on AUTO)
  16.   for the libraries and functionality you want to include.  This will help
  17.   your packages be consistent.  Also remember that you can turn off
  18.   functionality such as PDF export, RISC OS Sprite support, SVG rendering etc.
  19.   from here should you require a smaller, lighter build.
  20.  
  21.  
  22.   Launching NetSurf
  23. ===================
  24.  
  25.   The GTK port of NetSurf requires access to some resources at run time.
  26.   These are stored in gtk/res/ in the source tree.  Some of these files are
  27.   symlinks into the !NetSurf directory, which is the application container
  28.   for the native RISC OS build.  None of the other files from the !NetSurf
  29.   directory are required - the symlinks are used only as a way of making
  30.   checkouts smaller and making sure changes to one set of resources updates
  31.   the other.
  32.  
  33.   The binary that the build system produces is called "nsgtk".  There is also
  34.   a shell script called "netsurf" that will set up the environment and launch
  35.   the nsgtk binary.  Do not ship this shell script with your package.  It is
  36.   included only as a convience for launching NetSurf from the build tree.
  37.   Instead, you should move nsgtk to /usr/bin/netsurf (or wherever your
  38.   distribution's packaging policy suggests) and copy the contents of
  39.   gtk/res/ (dereferencing the symlinks, obviously) to /usr/share/netsurf (or
  40.   wherever your packaging policy suggests).
  41.  
  42.   You will need to tell NetSurf where to find its resources.  NetSurf searches
  43.   three locations by default when trying to load them, in this order:
  44.  
  45.     1. ~/.netsurf/
  46.     2. $NETSURFRES/
  47.     3. /usr/share/netsurf/
  48.  
  49.   The second one is how the netsurf launcher script controls it.  The third
  50.   location is controlled by the NETSURF_GTK_RESOURCES option in
  51.   Makefile.config, and this is the recommended way for packagers to change
  52.   the location it searches, as this still allows the user some flexibility in
  53.   changing what NetSurf uses.
  54.  
  55.  
  56.   User agent string
  57. ===================
  58.  
  59.   You may also want to change NetSurf's user agent string to include the
  60.   name of your distribution.  The user agent string is build by a function
  61.   kept in utils/useragent.c - you'll want to change the macro called
  62.   NETSURF_UA_FORMAT_STRING.  It's processed via sprintf, so keep that in
  63.   mind when changing it.  The first two printf parameters are major and minor
  64.   version numbers, the second two are OS name (uname -s) and architecture
  65.   (uname -m).  You might want change this to something like:
  66.  
  67.       "NetSurf/%d.%d (%s; %s; Debian GNU/Linux)"
  68.  
  69.   or similar.  Please don't be tempted to mention Mozilla or similar - let's
  70.   let that lie die.
  71.  
  72.  
  73.   Home page URL
  74. ===============
  75.  
  76.   If the user hasn't specified a home page URL in their Preferences, NetSurf
  77.   defaults to a "portal" welcome page at about:netsurf - if you wish to
  78.   change this, you can do so by overriding the NETSURF_HOMEPAGE URL in
  79.   Makefile.config.
  80.  
  81.  
  82.   If you make significant changes to NetSurf in your package, please ask your
  83.   users to report bugs to your bug tracker, not ours.  We'd also be interested
  84.   in seeing the diffs for these changes - we may be able to integrate them
  85.   to make your job easier in future.
  86.  
  87.