summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
Diffstat (limited to 'dist')
-rwxr-xr-xdist/build_all.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/dist/build_all.sh b/dist/build_all.sh
index 5cdde31..8dbb287 100755
--- a/dist/build_all.sh
+++ b/dist/build_all.sh
@@ -13,12 +13,14 @@ function export_files() {
}
echo "Cleaning up work/ directory..."
-[ -d work.old/ ] && rm -r work.old/
+[ -d work.old/ ] && chmod 777 -R work.old/ && rm -rf work.old/
[ -d work ] && mv work/ work.old/
mkdir work/
srcbase=".."
dstbase="work/tarball"
+commit=$(cd $srcbase ; git describe --always HEAD)
+archfile=work/editablesite-$commit
export_files $srcbase $dstbase <<EOT
./README ./
@@ -54,3 +56,20 @@ export_files $srcbase $dstbase <<EOT
./samplefiles/templates/aloha/layout-article.php ./admin/templates/aloha/
./samplefiles/templates/aloha/screen.css ./admin/templates/aloha/
EOT
+
+echo "Adjusting perms..."
+find $dstbase -mindepth 1 -type d -print0 | xargs -0r chmod 550
+find $dstbase -type f -name '*.php' -print0 | xargs -0r chmod 550
+find $dstbase -type f \! -name '*.php' -print0 | xargs -0r chmod 440
+find $dstbase/admin/content -type d -print0 | xargs -0r chmod 770
+find $dstbase/admin/content -type f -print0 | xargs -0r chmod 440
+
+echo "Creating tarball..."
+# Tarball with samples
+tar cf $archfile.tar -C "$dstbase" --owner www-data --group www-data .
+
+echo "Compressing..."
+gzip -9 $archfile.tar
+#gzip -9 -c $archfile.tar > $archfile.tar.gz
+( cd "$dstbase" ; zip -9 -q -r - .) > $archfile.zip
+