summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
Diffstat (limited to 'dist')
-rwxr-xr-xdist/build_all.sh54
-rwxr-xr-xdist/scripts/po2mo.sh11
2 files changed, 62 insertions, 3 deletions
diff --git a/dist/build_all.sh b/dist/build_all.sh
index 05a7907..5cdde31 100755
--- a/dist/build_all.sh
+++ b/dist/build_all.sh
@@ -1,2 +1,56 @@
#!/bin/bash
+function export_files() {
+ srcbase=$1
+ dstbase=$2
+ echo "Copying files..."
+ IFS=' '
+ while read src dst
+ do
+ [ -d "$dstbase/$dst" ] || mkdir -p "$dstbase/$dst"
+ cp "$srcbase/$src" "$dstbase/$dst"
+ done
+}
+
+echo "Cleaning up work/ directory..."
+[ -d work.old/ ] && rm -r work.old/
+[ -d work ] && mv work/ work.old/
+mkdir work/
+
+srcbase=".."
+dstbase="work/tarball"
+
+export_files $srcbase $dstbase <<EOT
+./README ./
+./code/index.php ./
+./code/admin/add.php ./admin/
+./code/admin/admin.css ./admin/
+./code/admin/admin.js ./admin/
+./code/admin/ajax.php ./admin/
+./code/admin/auth.php ./admin/
+./code/admin/editor-bind-code.html ./admin/
+./code/admin/index.php ./admin/
+./code/admin/render.php ./admin/
+./code/admin/utils.php ./admin/
+./libs/microajax/microajax.minified.js ./admin/
+./libs/treeview/treeview.css ./admin/
+./libs/treeview/treeview_icons.png ./admin/
+./samplefiles/templates/default/layout-article.php ./admin/templates/default/
+./samplefiles/templates/default/screen.css ./admin/templates/default/
+EOT
+
+scripts/po2mo.sh $srcbase/locale $dstbase/locale
+
+export_files $srcbase $dstbase <<EOT
+./samplefiles/content/en/start/div-content.html ./admin/content/en/start/
+./samplefiles/content/en/start/div-teaser.html ./admin/content/en/start/
+./samplefiles/content/en/start/props.ini ./admin/content/en/start/
+./samplefiles/content/fr/accueil/div-content.html ./admin/content/fr/accueil/
+./samplefiles/content/fr/accueil/div-teaser.html ./admin/content/fr/accueil/
+./samplefiles/content/fr/accueil/props.ini ./admin/content/fr/accueil/
+./samplefiles/content/site_conf.ini ./admin/content/
+./samplefiles/templates/aloha/images/background.png ./admin/templates/aloha/images/
+./samplefiles/templates/aloha/images/external-link-ltr-icon.png ./admin/templates/aloha/images/
+./samplefiles/templates/aloha/layout-article.php ./admin/templates/aloha/
+./samplefiles/templates/aloha/screen.css ./admin/templates/aloha/
+EOT
diff --git a/dist/scripts/po2mo.sh b/dist/scripts/po2mo.sh
index 7be049b..79f344d 100755
--- a/dist/scripts/po2mo.sh
+++ b/dist/scripts/po2mo.sh
@@ -1,9 +1,14 @@
#!/bin/bash
-for f in *.po
+srcbase=$1
+dstbase=$2
+
+echo "Generating locales..."
+for f in $(ls $srcbase/*.po)
do
- mo_dir=${f%%.po}.utf8/LC_MESSAGES/
+ fname=$(basename "$f")
+ mo_dir="$dstbase"/${fname%%.po}.utf8/LC_MESSAGES
[ -d "$mo_dir" ] || mkdir -p "$mo_dir"
- echo msgfmt -o "$mo_dir/editablesite.mo" "$f"
+ #echo msgfmt -o "'$mo_dir/editablesite.mo'" "'$f'"
msgfmt -o "$mo_dir/editablesite.mo" "$f"
done