-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_install_prereqs.sh
executable file
·59 lines (43 loc) · 1.11 KB
/
image_install_prereqs.sh
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
#!/bin/bash
pagetools=lib/pagetools-0.1.tar.gz
if [ -e $pagetools ]; then
sudo apt-get install -y \
zenity \
xsane \
imagemagick \
graphicsmagick \
libtiff-tools \
tesseract-ocr \
ocrad \
gocr \
zbar-tools \
libnetpbm10-dev \
libtiff4-dev
if [ ! -e /usr/bin/tiff_findskew ] || [ ! -e /usr/bin/pbm_findskew ]; then
mkdir ~/Downloads/pagetools
cp "$pagetools" ~/Downloads
cwd=`pwd`
pushd ~/Downloads/pagetools
tar -xvzf "$cwd/$pagetools"
make
sudo cp tiff_findskew/tiff_findskew /usr/bin/
sudo cp pbm_findskew/pbm_findskew /usr/bin/
popd
fi
echo "installing desktop shortcuts..."
cp shortcuts/*.desktop ~/Desktop/
if [ ! -d /var/lib/scans ]; then
echo "Creating /var/lib/scans..."
sudo mkdir /var/lib/scans
sudo chown nobody:enhs-all /var/lib/scans/
sudo chmod 0775 /var/lib/scans/
fi
if [ -d /var/lib/scans ] && [ ! -h ~/Scans ]; then
echo "Symlinking Scans Folder..."
ln -s /var/lib/scans ~/Scans
fi
else
echo "You'll need to download Page Tools"
echo " Available at: http://pagetools.sourceforge.net/"
echo "$pagetools not found, not installing."
fi