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

Subscribers

People subscribed via source and target branches