source: trunk/contrib/make-release.sh @ 1422

Last change on this file since 1422 was 1422, checked in by gogo, 21 months ago

A couple minor changes preparing for release.

File size: 4.2 KB
Line 
1#!/bin/bash
2
3if ! [ -f XinhaCore.js ]
4then
5  echo "Run this from the root of your working copy." >&2
6  echo                                                >&2
7  exit 1
8fi
9
10
11if ! [ -d .svn ]
12then
13  echo "This script must be run inside a subversion working copy." >&2
14  echo                                                             >&2
15  exit 1
16fi
17
18if [ "$1" = "" ]
19then
20  echo "Usage: $0 {VersionNumber}"                    >&2
21  echo                                                >&2
22  exit 1
23fi
24
25# Run this with bash from the root of your SVN working copy checkout of the trunk
26# it will dump int /tmp the archived release files
27# eg bash contrib/make-release.sh
28
29VER="$1"
30
31# Update plugin Manifest
32MANIFEST="$(bash contrib/generate-plugin-manifest.sh | sort | perl -0777 -pe 's/,\s*$//s' )"
33cat XinhaCore.js | perl -0777  -pe 's/(.pluginManifest\s+=)\s+.+?;/\1 {\nPUT_THE_MANIFEST_HERE_YO\n};/is' | replace PUT_THE_MANIFEST_HERE_YO "$MANIFEST" >XinhaCore2.js
34mv XinhaCore2.js XinhaCore.js
35
36# Export
37mkdir /tmp/Xinha-$VER
38svn export $(pwd) /tmp/Xinha-$VER/xinha
39cd /tmp/Xinha-$VER/xinha
40echo "xinha-$VER" >VERSION.TXT
41
42# Create the merged language files
43php contrib/lc_parse_strings.php
44for lang in $(find . -wholename "*/lang/*.js" | sed -r 's/.*\///' | sort | uniq | grep -v base | sed -r 's/.js//')
45do
46  php contrib/lc_create_merged_file.php $lang lang/merged/$lang.js
47done
48php contrib/lc_create_merged_file.php NEW lang/merged/__new__.js
49
50
51cd ../
52
53# Create the main distribution zip and bz2
54zip -r xinha-$VER.zip        xinha
55tar -cjvf xinha-$VER.tar.bz2 xinha
56
57# Make a strippped down plugins set for the plugins which must be run locally
58#  ie, ones that upload files or deal with the local server file system
59mkdir local_plugins
60mkdir local_plugins/contrib
61mkdir local_plugins/plugins
62cp -rp xinha/contrib/php-xinha.php         local_plugins/contrib
63cp -rp xinha/contrib/.htaccess             local_plugins/contrib
64cp -rp xinha/plugins/MootoolsFileManager   local_plugins/plugins
65cp -rp xinha/plugins/Linker                local_plugins/plugins
66cat >local_plugins/README.TXT <<'EOF'
67Xinha Local Plugins
68--------------------------------------------------------------------------------
69
70This directory contains plugins for Xinha (www.xinha.org) which must be run on
71the local web server rather than from an external server/content delivery
72network.
73
74Consult the NewbieGuide ( http://trac.xinha.org/wiki/NewbieGuide )
75for more complete details on Xinha configuration, however in short you can load
76Xinha using local plugins like this (assuming you upload the local_plugins
77directory to the root of your website).
78
79  <script type="text/javascript" src="//s3-us-west-1.amazonaws.com/xinha/xinha-1.5-beta1/XinhaEasy.js">
80    xinha_options = {
81      xinha_plugins: [
82        'minimal',
83        // Note that from is a URL to the plugins directory inside the
84        //  local_plugins directory, adjust for where you upload.
85        {from: '/local_plugins/plugins', load: ['MootoolsFileManager'] }]
86      ],
87
88      xinha_config:            function(xinha_config)
89      {
90       
91        // Configure the File Manager
92        with (xinha_config.MootoolsFileManager)
93        {
94          <?php
95            require_once($_SERVER['DOCUMENT_ROOT'].'/local_plugins/contrib/php-xinha.php');
96            xinha_pass_to_php_backend
97            (       
98              array
99              (
100                'images_dir' => $_SERVER['DOCUMENT_ROOT'] . '/images',
101                'images_url' => '/images',
102                'images_allow_upload' => true,
103                'images_allow_delete' => true,
104                'images_allow_download' => true,
105                'images_use_hspace_vspace' => false,
106               
107                'files_dir' => $_SERVER['DOCUMENT_ROOT'] . '/files',
108                'files_url' => '/files',
109                'files_allow_upload' => true,
110                'max_files_upload_size' => '4M',
111              )
112            )
113          ?>
114        }
115      }
116    }
117  </script>
118EOF
119echo "xinha-$VER" >local_plugins/VERSION.TXT
120zip -r    local_plugins.zip     local_plugins
121tar -cjvf local_plugins.tar.bz2 local_plugins
122
123cd xinha
124php contrib/compress_yui.php
125sleep 5
126cd ../
127zip -r    xinha-compressed-$VER.zip     xinha
128tar -cjvf xinha-compressed-$VER.tar.bz2 xinha
Note: See TracBrowser for help on using the repository browser.