Merged revision to configure.in (0.2.1 and Maemo)
[xournal.git] / install-binary
blob63a1fa385b6e4b5fbbeb893b1810b5072b2c60e4
1 #!/bin/sh
3 if test `id -u` = 0; then
4 echo "This installer will now attempt to install the 'xournal' binary in"
5 echo "/usr/local/bin and the support files in /usr/local/share/xournal."
6 echo "Press Control-C to abort, or Enter to proceed."
7 read
9 test -z /usr/local/bin || mkdir -p /usr/local/bin
10 install -c src/xournal /usr/local/bin/xournal
12 install -d /usr/local/share/xournal/pixmaps
13 for pixmap in pixmaps/*; do
14 install -c -m 644 $pixmap /usr/local/share/xournal/pixmaps
15 done
17 install -d /usr/local/share/xournal/html-doc
18 for docfile in html-doc/*; do
19 if test -f $docfile; then
20 install -c -m 644 $docfile /usr/local/share/xournal/html-doc
22 done
23 if test ! -e /usr/local/share/xournal/html-doc/pixmaps; then
24 ln -s ../pixmaps /usr/local/share/xournal/html-doc/pixmaps
26 else
27 echo "To install xournal in /usr/local, you must run this installer as root."
28 echo "This installer will now attempt to install xournal in your home directory."
29 echo "Press Control-C to abort, or select a directory for the installation"
30 echo "(the binary will be installed in this location, and the support files will"
31 echo "be installed into subdirectories called pixmaps/ and html-doc/)."
32 echo
33 echo -n "Location [default: $HOME/bin]: "
34 read location
35 if test -z $location; then
36 location=$HOME/bin
39 test -z $location || mkdir -p $location
40 install -c src/xournal $location/xournal
42 install -d $location/pixmaps
43 for pixmap in pixmaps/*; do
44 install -c -m 644 $pixmap $location/pixmaps
45 done
47 install -d $location/html-doc
48 for docfile in html-doc/*; do
49 if test -f $docfile; then
50 install -c -m 644 $docfile $location/html-doc
52 done
53 if test ! -e $location/html-doc/pixmaps; then
54 ln -s ../pixmaps $location/html-doc/pixmaps