summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorLudovic Pouzenc <lpouzenc@gmail.com>2013-10-29 20:22:26 +0100
committerLudovic Pouzenc <lpouzenc@gmail.com>2013-10-29 20:22:26 +0100
commit51cda16e1cc2d22a22ceff56700d1edd256171fc (patch)
tree41ac8eb787edb15c764be47eefd0363fa843941d /dist
parentc98515883097467896a3f46b755c8cb892fe8961 (diff)
downloadeditablesite-51cda16e1cc2d22a22ceff56700d1edd256171fc.tar.gz
editablesite-51cda16e1cc2d22a22ceff56700d1edd256171fc.tar.bz2
editablesite-51cda16e1cc2d22a22ceff56700d1edd256171fc.zip
Debut d'automatisation de la construction tarball
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