File: make_djview_dmg.sh

package info (click to toggle)
djview4 4.12-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,716 kB
  • sloc: cpp: 22,079; ansic: 9,746; sh: 241; makefile: 228; awk: 94; xml: 84
file content (32 lines) | stat: -rwxr-xr-x 700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

dmgname="DjVuLibre-3.5.28 DjView-4.12-intel64-3"

cd $(dirname $0)
if ! test -d DjView.app ; then
  echo 2>&1 "Run 'make_djview_bundle.sh' first".
  exit 10
fi

run() {
    echo 2>&1 "  $@"
    "$@"
    status=$?
    if test $status -ne 0 ; then
        echo "[Exit with status $status]"
        exit $status
    fi
}

dmg=dmg$$
test -d $dmg && run rm -rf $dmg 

trap "rm -rf $dmg 2>/dev/null" 0

run mkdir $dmg || exit
run cp -r DjView.app $dmg || exit
run cp ReadMe.rtf $dmg || exit
book=DjView.app/Contents/share/doc/djvu/djvulibre-book-en.djvu
run ln -s $book $dmg/Manual.djvu || exit
run hdiutil create -ov -srcfolder $dmg -volname "$dmgname" "$dmgname".dmg || exit
run rm -rf $dmg