ddmg.sh 903 Bytes
Newer Older
boklm's avatar
boklm committed
1
2
3
4
5
6
7
8
9
10
11
12
[% SET src = c('dmg_src', { error_if_undef => 1 }) -%]
find [% src %] -executable -exec chmod 0755 {} \;
find [% src %] ! -executable -exec chmod 0644 {} \;

find [% src %] -exec [% c("var/touch") %] {} \;

dmg_tmpdir=$(mktemp -d)
[% SET filelist = '"$dmg_tmpdir/filelist.txt"' %]
pushd [% src %] 
find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > [% filelist %]
find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> [% filelist %]

boklm's avatar
boklm committed
13
14
15
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"

boklm's avatar
boklm committed
16
17
18
19
20
21
genisoimage -D -V "Tor Browser" -no-pad -R -apple -o "$dmg_tmpdir/tbb-uncompressed.dmg" -path-list [% filelist %] -graft-points -gid 20 -dir-mode 0755 -new-dir-mode 0755

dmg dmg "$dmg_tmpdir/tbb-uncompressed.dmg" [% c('dmg_out', { error_if_undef => 1 }) %]
popd

rm -Rf "$dmg_tmpdir"