0
-## xpi build the xpi as non-release. version will get subminor
0
-## release build the xpi as release. the xpi will be put in
0
-## jar build the jar only as non-release. version will get
0
-## install-jar build the jar and attempt shortcut install to $PROFILE
0
-## announce Edit the web page to announce the new release version.
0
-## etags build TAGS file, requires directory arg.
0
-## This variable is used when a shortcut jar-only install is requested.
0
-PROFILE="" # arg for install-jar
0
## This variable is for target `etags'. It specifies the destination
0
@@ -36,38 +11,32 @@ PROFILE="" # arg for install-jar
0
-while [[ "$1" = [-a-z]* ]]; do
0
- if [[ -z "$2" ]]; then
0
- echo "error: install-jar requires an arg. please read the source."
0
- echo 'bad usage. please read the source.'
0
+ ## TARGET=xulapp-osx ;;
0
+ echo 'bad usage. please read the source.'
0
## if this is not an official release, tag on a build date.
0
@@ -75,83 +44,70 @@ done
0
## if this is an official release, strip the subminor.
0
MILESTONE="${VERSION##*.}"
0
+BUILD_DATE=$(date +%Y%m%d)
0
+SHORT_VERSION="$VERSION"
0
VERSION="${VERSION%.*}" ;;
0
- VERSION="$
{VERSION}.$(date +%Y%m%d)"
0
+ VERSION="$
VERSION.$BUILD_DATE"
0
echo "build target: $TARGET, $VERSION"
0
-function assert_conkeror_src () {
0
- if [[ ! -e install.rdf ]] || \
0
- [[ ! -e conkeror/content/contents.rdf ]];
0
- echo "This directory does not appear to contain the Conkeror source code."
0
+## Temporary directory for build process.
0
+function get_scratch () {
0
+ if [[ -z "$SCRATCH" ]]; then
0
-function do_target_jar () {
0
- echo -n Building JAR...
0
- cp -r conkeror jar-build/conkeror
0
- pushd jar-build > /dev/null
0
- FILES=($(find conkeror -regex '.*[^~#]' | grep -v CVS))
0
- ## begin preprocessing
0
- perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' conkeror/content/contents.rdf
0
- perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' conkeror/content/conkeror.js
0
- zip conkeror.jar "${FILES[@]}" > /dev/null
0
- mv jar-build/conkeror.jar .
0
+function do_cleanup () {
0
+ if [[ -n "$SCRATCH" ]]; then
0
-function do_target_install_jar () {
0
- echo -n Performing JAR-only install for profile "$PROFILE"...
0
- # find the salted profile dir
0
- salted=$(ls -d ~/.mozilla/firefox/*."$PROFILE")'/extensions/{a79fe89b-6662-4ff4-8e88-09950ad4dfde}/chrome/'
0
- if [[ ! -e "$salted" ]]; then
0
- echo "error (not found): $salted"
0
+function assert_conkeror_src () {
0
+ if [[ ! -e application.ini ]]; then
0
+ echo "The current directory does not appear to contain the Conkeror source code."
0
- mv conkeror.jar "$salted"
0
-function do_target_xpi () {
0
- echo -n Building XPI...
0
- mkdir -p xpi-build/chrome
0
- mv conkeror.jar xpi-build/chrome/
0
- cp install.rdf xpi-build/
0
- cp -r components xpi-build/components
0
- pushd xpi-build > /dev/null
0
- ## begin preprocessing
0
- perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' install.rdf
0
- zip -r ../conkeror-firefox-$VERSION.xpi chrome install.rdf components/nsCrank.js > /dev/null
0
+function copy_tree_sans_boring () {
0
+ ( cd "$src"; find . -name CVS -prune -or \( -type d -and \
0
+ \! -name '*[~#]' -print0 \) ) \
0
+ | ( cd "$dest"; xargs -0 mkdir -p )
0
+ files=($( cd "$src"; find . -name CVS -prune -or \( -type f -and \
0
+ \! -name '*[~#]' -print \) ))
0
+ for file in "${files[@]}" ; do cp "$src/$file" "$dest/$file" ; done
0
function do_check_milestone_for_release ()
0
if [[ "$MILESTONE" = "0" ]]; then
0
@@ -174,16 +130,6 @@ function do_check_milestone_for_release ()
0
-function do_target_release () {
0
- do_check_milestone_for_release
0
- echo -n Putting conkeror-firefox-$VERSION.xpi in downloads directory ...
0
- mv conkeror-firefox-$VERSION.xpi ../downloads
0
function diff_wrapper () {
0
@@ -211,6 +157,125 @@ function diff_wrapper () {
0
+function do_target_jar () {
0
+ echo -n Building JAR...
0
+ jarbuild="$SCRATCH/jar-build"
0
+ cp -r conkeror "$jarbuild/conkeror"
0
+ pushd "$jarbuild" > /dev/null
0
+ FILES=($(find conkeror -name CVS -prune -or \( -type f -and \! -name '*[~#]' -print \)))
0
+ ## begin preprocessing
0
+ perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' conkeror/content/contents.rdf
0
+ perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' conkeror/content/conkeror.js
0
+ zip conkeror.jar "${FILES[@]}" > /dev/null
0
+ mv "$jarbuild/conkeror.jar" .
0
+function do_target_xulapp () {
0
+ echo -n Building XULRunner Application...
0
+ mkdir -p "$SCRATCH/chrome"
0
+ cp application.ini "$SCRATCH"
0
+ mv conkeror.jar "$SCRATCH/chrome/"
0
+ cp chrome.manifest "$SCRATCH/chrome/"
0
+ copy_tree_sans_boring defaults "$SCRATCH/defaults"
0
+ copy_tree_sans_boring components "$SCRATCH/components"
0
+ pushd "$SCRATCH" > /dev/null
0
+ ## begin preprocessing
0
+ perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' application.ini
0
+ perl -pi -e 's/\$CONKEROR_BUILD_DATE\$/'$BUILD_DATE'/g' application.ini
0
+ zip -r conkeror.xulapp * > /dev/null
0
+ mv "$SCRATCH/conkeror.xulapp" .
0
+function do_target_xulapp_osx () {
0
+ contents="$SCRATCH/Contents"
0
+ unzip conkeror.xulapp -d "$contents/Resources" > /dev/null
0
+ ## to-do: create Contents/Resources/app_icons.icns
0
+ cp Info.plist "$contents/"
0
+ ## begin preprocessing
0
+ perl -pi -e 's/\$CONKEROR_VERSION\$/'$VERSION'/g' "$contents/Info.plist"
0
+ perl -pi -e 's/\$CONKEROR_SHORT_VERSION\$/'$SHORT_VERSION'/g' "$contents/Info.plist"
0
+ mkdir -p "$contents/Frameworks/XUL.framework"
0
+ ## XUL.framework will contain files copied from /Library/Frameworks/XUL.framework/Versions/1.8/
0
+ ## make sure you copy all symlinks correctly. (use rsync -rl /Library/Frameworks/XUL.framework ...)
0
+ mkdir "$contents/MacOS"
0
+ ## place the xulrunner stub executable from /Library/Frameworks/XUL.framework/Versions/1.8/xulrunner
0
+ ## now make Conkeror.app
0
+function do_target_dist_tar () {
0
+ ## now we have conkeror.xulapp
0
+ ## package it with install.sh
0
+ ## some other files should probably go in here.. NEWS, for example
0
+ mkdir "$SCRATCH/conkeror-$VERSION"
0
+ mv conkeror.xulapp "$SCRATCH/conkeror-$VERSION/"
0
+ cp install.sh "$SCRATCH/conkeror-$VERSION/"
0
+ pushd "$SCRATCH" > /dev/null
0
+ tar c conkeror-$VERSION | gzip > conkeror-$VERSION.tar.gz
0
+ mv "$SCRATCH/conkeror-$VERSION.tar.gz" .
0
+ echo -n "Making conkeror-$VERSION.tar.gz ..."
0
+function do_target_release () {
0
+ do_check_milestone_for_release
0
+ ## Make any and all release archives.
0
+ ## Right now, we just make a tar.gz archive that includes an install
0
+ ## script. In the future, we could consider making an OSX App, a Windows
0
+ ## Installer EXE, and a Mozilla XPI Installer.
0
+ echo -n Putting conkeror-$VERSION.tar.gz in downloads directory ...
0
+ mv conkeror-$VERSION.tar.gz ../downloads
0
function do_target_announce () {
0
do_check_milestone_for_release
0
echo Entering ../www/ ... ok
0
@@ -220,7 +285,7 @@ function do_target_announce () {
0
perlexp='s/(?<=<!--\scontrolled\scontent\sinsertion\spoint::whatsnew\s-->\n) ()(?!.*'$VERSION'.*$)/<li>'$VERSION' released! \('"$(date '+%b %d, %Y')"'\)<\/li>\n/mxg'
0
diff_wrapper "$scratch" index.html "$perlexp"
0
- perlexp='s/(?<=<!-- begin controlled content. do not edit manually. id:newestlink -->).*?(?=<!-- end controlled content. -->)/<a href="http:\/\/downloads.mozdev.org\/conkeror\/conkeror-
firefox-'$VERSION'.xpi">conkeror-firefox-'$VERSION'.xpi<\/a>/g'
0
+ perlexp='s/(?<=<!-- begin controlled content. do not edit manually. id:newestlink -->).*?(?=<!-- end controlled content. -->)/<a href="http:\/\/downloads.mozdev.org\/conkeror\/conkeror-
'$VERSION'.tar.gz">conkeror-'$VERSION'.tar.gz<\/a>/g'
0
diff_wrapper "$scratch" installation.html "$perlexp"
0
@@ -268,14 +333,9 @@ function do_target_help () {
0
echo 'Usage: ./build.sh <TARGET>'
0
echo 'where <TARGET> is one of:'
0
- echo ' jar Builds a non-release jar in the current directory.'
0
- echo ' install-jar <PROFILE> Builds a non-release jar, attempts to find the'
0
- echo ' location of an installed Conkeror for <PROFILE>'
0
- echo ' and puts the jar there. <PROFILE> is the human-'
0
- echo ' readable name, not the salted name.'
0
- echo '
xpi Builds a non-release xpi in the current directory.'
0
echo ' release Builds a release xpi and puts it in ../downloads.'
0
@@ -293,12 +353,21 @@ function do_target_help () {
0
- install-jar) do_target_install_jar ;;
0
+ xulapp) do_target_xulapp ;;
0
+ ## xulapp-osx) do_target_xulapp_osx ;;
0
+ dist-tar) do_target_dist_tar ;;
0
release) do_target_release ;;
0
announce) do_target_announce ;;
0
etags) do_target_etags ;;
0
@@ -306,3 +375,4 @@ case "$TARGET" in
0
help) do_target_help ;;