File: djvulibre-install.sh

package info (click to toggle)
djvulibre 3.5.27.1-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,976 kB
  • ctags: 8,037
  • sloc: cpp: 65,455; xml: 5,723; ansic: 4,640; sh: 846; makefile: 315
file content (104 lines) | stat: -rwxr-xr-x 3,073 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh

c=/cygdrive/c
qtdir=$c/QtSDK/Desktop/Qt/4.8.1/msvc2010
djdir=$HOME/djvulibre-3.5
dwdir=$djdir/win32/djvulibre/Release
djsrc=$HOME/djvulibre-djview/src
msvc="$c/Program Files/Microsoft Visual Studio 10.0/VC"
msredist="$msvc/redist/x86/Microsoft.VC100.CRT"

target=$HOME/DjVuLibre

function run() {
    echo "$@"
    "$@"
    if test $? -ne 0 ; then
      echo "FAILED: " "$@"
    fi
}

## Djvulibre tools
echo ---- DjVuLibre tools

djexe="bzz.exe c44.exe cjb2.exe cpaldjvu.exe csepdjvu.exe
       ddjvu.exe djvm.exe djvmcvt.exe djvudump.exe djvuextract.exe 
       djvumake.exe djvups.exe djvused.exe djvutoxml.exe
       djvutxt.exe djvuxmlparser.exe"
djdll="libdjvulibre.dll libjpeg.dll libtiff.dll libz.dll"
for n in $djdll $djexe ; do 
    run cp $dwdir/$n $target ; done

## Qt libs
echo ---- Qt libs

qtdll="QtCore4.dll QtGui4.dll QtNetwork4.dll QtOpenGL4.dll"
qtssl="ssleay32.dll libeay32.dll libssl32.dll"
qtplug="accessible codecs imageformats"
for n in $qtdll ; do 
    run cp $qtdir/lib/$n $target ; done
for n in $qtssl ; do 
    test -r $qtdir/bin/$n && run cp $qtdir/bin/$n $target ; done
test -d $target/plugins || run mkdir $target/plugins
for n in $qtplug ; do 
    test -d $target/plugins/$n || run mkdir $target/plugins/$n 
    for m in $qtdir/plugins/$n/*.dll ; do
        run cp $m $target/plugins/$n ; done
    run chmod 0755 $target/plugins/$n/* ; done
    run rm $target/plugins/*/*d4.dll
    run rm $target/plugins/imageformats/qsvg*
run find $target -name '*.dll' -exec chmod 0755 {} \;

echo '[Paths]' > $target/qt.conf

## MS libs
echo ---- MS libs

for n in "$msredist"/* ; do
    run cp "$n" $target; done

## DjVuLibre shared files
echo ---- DjVuLibre shared files

test -d $target/share || mkdir $target/share
run cp -r $djdir/share/djvu $target/share
run find $target/share -name CVS -exec rm -rf {} \; -prune

## DjVuLibre dev files
echo ---- DjVuLibre dev files

run cp $dwdir/libdjvulibre.lib $target
test -d $target/include || run mkdir $target/include
test -d $target/include/libdjvu || run mkdir $target/include/libdjvu
run cp $djdir/libdjvu/miniexp.h $target/include/libdjvu
run cp $djdir/libdjvu/ddjvuapi.h $target/include/libdjvu

## DjView exe
echo ---- DjView exe

if test -r $dwdir/djview.exe ; then
  run cp $dwdir/djview.exe $target
else
  run cp $djsrc/release/djview.exe $target
fi
( cd $djsrc; run $qtdir/bin/lrelease djview.pro )
test -d $target/share/djvu/djview4 || run mkdir $target/share/djvu/djview4
run cp $djsrc/*.qm $target/share/djvu/djview4
run cp $qtdir/translations/qt_*.qm  $target/share/djvu/djview4
run chmod 0644 $target/share/djvu/djview4/qt*.qm
run rm -f $target/share/djvu/djview4/qt_help_*.qm


## Doc
echo ---- Doc

run cp $djdir/win32/djvulibre/djvulibre.nsi $target
run cp $djdir/win32/djvulibre/djvulibre*.nsh $target

test -d $target/man || run mkdir $target/man
test -d $target/doc || run mkdir $target/doc
run cp $djdir/doc/*.djvu $target/doc
run cp $djdir/doc/*.txt $target/doc
run unix2dos $target/doc/*.txt
run cp $djdir/COPYING $target/COPYING.txt
run unix2dos $target/COPYING.txt