]> git.donarmstrong.com Git - xournal.git/blob - install-binary
Initial revision
[xournal.git] / install-binary
1 #!/bin/sh
2
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
8
9   test -z /usr/local/bin || mkdir -p /usr/local/bin
10   install -c src/xournal /usr/local/bin/xournal
11
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
16
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
21     fi
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
25   fi
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
37   fi
38
39   test -z $location || mkdir -p $location
40   install -c src/xournal $location/xournal
41
42   install -d $location/pixmaps
43   for pixmap in pixmaps/*; do
44     install -c -m 644 $pixmap $location/pixmaps
45   done
46
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
51     fi
52   done
53   if test ! -e $location/html-doc/pixmaps; then
54     ln -s ../pixmaps $location/html-doc/pixmaps
55   fi
56 fi