Merge lp:~statik/bindwood/build-stuff into lp:~urbanape/bindwood/trunk

Proposed by Elliot Murphy
Status: Rejected
Rejected by: Elliot Murphy
Proposed branch: lp:~statik/bindwood/build-stuff
Merge into: lp:~urbanape/bindwood/trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~statik/bindwood/build-stuff
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+8750@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

One thing that is weird is that the build script seemed to want the subdirs of chrome/ to be at the base level. I've moved them, but am not sure if that was the right thing to do, so please advise.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2009-07-14 14:09:22 +0000
@@ -0,0 +1,1 @@
1bindwood.xpi
02
=== added file 'README'
--- README 1970-01-01 00:00:00 +0000
+++ README 2009-07-14 14:09:22 +0000
@@ -0,0 +1,7 @@
1This is a Firefox extension that syncs bookmarks with a desktop CouchDB instance.
2To build it, run ./build.sh.
3
4The project home page is https://launchpad.net/bindwood.
5To submit patches, please make a branch on launchpad and 'propose for merging'.
6You can discuss this extension on the ubuntuone-users@lists.launchpad.net
7mailing list.
08
=== added file 'build.sh'
--- build.sh 1970-01-01 00:00:00 +0000
+++ build.sh 2009-07-14 14:09:22 +0000
@@ -0,0 +1,128 @@
1#!/bin/bash
2# build.sh -- builds JAR and XPI files for mozilla extensions
3# by Nickolay Ponomarev <asqueella@gmail.com>
4# (original version based on Nathan Yergler's build script)
5# Most recent version is at <http://kb.mozillazine.org/Bash_build_script>
6
7# This script assumes the following directory structure:
8# ./
9# chrome.manifest (optional - for newer extensions)
10# install.rdf
11# (other files listed in $ROOT_FILES)
12#
13# content/ |
14# locale/ |} these can be named arbitrary and listed in $CHROME_PROVIDERS
15# skin/ |
16#
17# defaults/ |
18# components/ |} these must be listed in $ROOT_DIRS in order to be packaged
19# ... |
20#
21# It uses a temporary directory ./build when building; don't use that!
22# Script's output is:
23# ./$APP_NAME.xpi
24# ./$APP_NAME.jar (only if $KEEP_JAR=1)
25# ./files -- the list of packaged files
26#
27# Note: It modifies chrome.manifest when packaging so that it points to
28# chrome/$APP_NAME.jar!/*
29
30#
31# default configuration file is ./config_build.sh, unless another file is
32# specified in command-line. Available config variables:
33APP_NAME= # short-name, jar and xpi files name. Must be lowercase with no spaces
34CHROME_PROVIDERS= # which chrome providers we have (space-separated list)
35CLEAN_UP= # delete the jar / "files" when done? (1/0)
36ROOT_FILES= # put these files in root of xpi (space separated list of leaf filenames)
37ROOT_DIRS= # ...and these directories (space separated list)
38BEFORE_BUILD= # run this before building (bash command)
39AFTER_BUILD= # ...and this after the build (bash command)
40
41if [ -z $1 ]; then
42 . ./config_build.sh
43else
44 . $1
45fi
46
47if [ -z $APP_NAME ]; then
48 echo "You need to create build config file first!"
49 echo "Read comments at the beginning of this script for more info."
50 exit;
51fi
52
53ROOT_DIR=`pwd`
54TMP_DIR=build
55
56#uncomment to debug
57#set -x
58
59# remove any left-over files from previous build
60rm -f $APP_NAME.jar $APP_NAME.xpi files
61rm -rf $TMP_DIR
62
63$BEFORE_BUILD
64
65mkdir --parents --verbose $TMP_DIR/chrome
66
67# generate the JAR file, excluding CVS and temporary files
68JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar
69echo "Generating $JAR_FILE..."
70for CHROME_SUBDIR in $CHROME_PROVIDERS; do
71 find $CHROME_SUBDIR -path '*CVS*' -prune -o -type f -print | grep -v \~ >> files
72done
73
74zip -0 -r $JAR_FILE `cat files`
75# The following statement should be used instead if you don't wish to use the JAR file
76#cp --verbose --parents `cat files` $TMP_DIR/chrome
77
78# prepare components and defaults
79echo "Copying various files to $TMP_DIR folder..."
80for DIR in $ROOT_DIRS; do
81 mkdir $TMP_DIR/$DIR
82 FILES="`find $DIR -path '*CVS*' -prune -o -type f -print | grep -v \~`"
83 echo $FILES >> files
84 cp --verbose --parents $FILES $TMP_DIR
85done
86
87# Copy other files to the root of future XPI.
88for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do
89 cp --verbose $ROOT_FILE $TMP_DIR
90 if [ -f $ROOT_FILE ]; then
91 echo $ROOT_FILE >> files
92 fi
93done
94
95cd $TMP_DIR
96
97if [ -f "chrome.manifest" ]; then
98 echo "Preprocessing chrome.manifest..."
99 # You think this is scary?
100 #s/^(content\s+\S*\s+)(\S*\/)$/\1jar:chrome\/$APP_NAME\.jar!\/\2/
101 #s/^(skin|locale)(\s+\S*\s+\S*\s+)(.*\/)$/\1\2jar:chrome\/$APP_NAME\.jar!\/\3/
102 #
103 # Then try this! (Same, but with characters escaped for bash :)
104 sed -i -r s/^\(content\\s+\\S*\\s+\)\(\\S*\\/\)$/\\1jar:chrome\\/$APP_NAME\\.jar!\\/\\2/ chrome.manifest
105 sed -i -r s/^\(skin\|locale\)\(\\s+\\S*\\s+\\S*\\s+\)\(.*\\/\)$/\\1\\2jar:chrome\\/$APP_NAME\\.jar!\\/\\3/ chrome.manifest
106
107 # (it simply adds jar:chrome/whatever.jar!/ at appropriate positions of chrome.manifest)
108fi
109
110# generate the XPI file
111echo "Generating $APP_NAME.xpi..."
112zip -r ../$APP_NAME.xpi *
113
114cd "$ROOT_DIR"
115
116echo "Cleanup..."
117if [ $CLEAN_UP = 0 ]; then
118 # save the jar file
119 mv $TMP_DIR/chrome/$APP_NAME.jar .
120else
121 rm ./files
122fi
123
124# remove the working files
125rm -rf $TMP_DIR
126echo "Done!"
127
128$AFTER_BUILD
0129
=== removed directory 'chrome'
=== modified file 'chrome.manifest'
--- chrome.manifest 2009-07-02 13:41:07 +0000
+++ chrome.manifest 2009-07-14 14:09:22 +0000
@@ -1,3 +1,3 @@
1content bindwood chrome/content/1content bindwood content/
2locale bindwood en chrome/locale/en/2locale bindwood en locale/en/
3overlay chrome://browser/content/browser.xul chrome://bindwood/content/browserOverlay.xul3overlay chrome://browser/content/browser.xul chrome://bindwood/content/browserOverlay.xul
44
=== added file 'config_build.sh'
--- config_build.sh 1970-01-01 00:00:00 +0000
+++ config_build.sh 2009-07-14 14:09:22 +0000
@@ -0,0 +1,9 @@
1#!/bin/bash
2# Build config for build.sh
3APP_NAME=bindwood
4CHROME_PROVIDERS="content locale"
5CLEAN_UP=1
6ROOT_FILES=
7ROOT_DIRS="defaults"
8BEFORE_BUILD=
9AFTER_BUILD=
010
=== renamed directory 'chrome/content' => 'content'
=== modified file 'install.rdf'
--- install.rdf 2009-07-06 20:00:16 +0000
+++ install.rdf 2009-07-14 14:09:22 +0000
@@ -21,6 +21,6 @@
21 <em:name>Bindwood</em:name>21 <em:name>Bindwood</em:name>
22 <em:description>An extension to synchronize your bookmarks to a local CouchDB.</em:description>22 <em:description>An extension to synchronize your bookmarks to a local CouchDB.</em:description>
23 <em:creator>Zachery Bir</em:creator>23 <em:creator>Zachery Bir</em:creator>
24 <em:homepageURL>http://launchpad.net/bindwood</em:homepageURL>24 <em:homepageURL>https://launchpad.net/bindwood</em:homepageURL>
25 </Description>25 </Description>
26</RDF>26</RDF>
2727
=== renamed directory 'chrome/locale' => 'locale'

Subscribers

People subscribed via source and target branches