6 echo " ======================================================================== "
7 echo " (( An Error has Been Encountered ))"
8 echo " ======================================================================== "
11 echo " In the most cases, some libraries are missing or cannot be found."
12 echo " Think to install the *-dev or *-devel packages of your distribution."
13 echo " For example, if libmng cannot be found,"
14 echo " please check if libmng AND libmng-devel packages are installed on your system."
15 echo " See the reported errors to know which librarie need to be installed."
17 echo $
'\a' # Beep to avert user of the error
21 ##echo " (( An error has been encountered ))"
22 ##echo " ((654321 987654321 987654321 98765432 23456789 123456789 123456789 123456))"
23 ##echo" ((654321 987654321 987654321 98765432 23456789 123456789 123456789 123456))"
27 echo " ======================================================================== "
28 echo " (( BasKet Note Pads Quick Installer ))"
29 echo " ======================================================================== "
32 echo " Welcome to the BasKet Note Pads installer assistant."
33 echo " It will configure, build and install BasKet Note Pads."
36 echo " What do you want to do?"
38 echo " 1/ Install BasKet Note Pads system wide (you will need the root password)"
39 echo " 2/ Install BasKet Note Pads in your user folder"
40 #echo " 3/ Uninstall BasKet Note Pads (you should not: it is so fantastic ;-) )"
43 echo -n "Your choice (default is 1): "
47 if [ "_$WHAT_TO_DO" == "_2" ]; then
49 WHAT_TO_DO
=2 # To transform it from string to int
51 # if [ $WHAT_TO_DO == 3 ]; then
53 # else # [ WHAT_TO_DO == 1 ] or default
55 WHAT_TO_DO
=1 # If user entered another number than those he should
59 if [ $SYS_WIDE == 0 ]; then
60 prefix
=`kde-config --localprefix --expandvars`
62 prefix
=`kde-config --prefix --expandvars`
65 # Uninstall of BasKet:
66 if [ $WHAT_TO_DO == 3 ]; then
67 # Search installed basket:
68 prefix
=`kde-config --localprefix --expandvars` # First loacally
69 if [ -f $prefix/bin
/basket
]; then
72 prefix
=`kde-config --prefix --expandvars` # And then system wide
73 if [ -f $prefix/bin
/basket
]; then
76 echo "BasKet Note Pads does not seem to be installed."
80 # TODO: Also definitively remove your baskets?
81 # At this stage, SYS_WIDE and prefix are set and uninstall can begin:
82 if [ $SYS_WIDE == 1 ]; then
84 make uninstall || .
/configure
--prefix=$prefix && make uninstall
87 make uninstall || .
/configure
--prefix=$prefix && make uninstall
92 appVersion
=$
(cat basket.spec |
grep "%define version " | cut
-d " " -f 3)
93 isDevel
=$
(echo "$appVersion" |
grep -i -E "(alpha|beta|pre|rc|svn)")
97 echo " ======================================================================== "
98 echo " (( BasKet Note Pads Quick Installer ))"
99 echo " ======================================================================== "
104 echo " If you do not know what they are, you can ignore errors or warnings."
106 echo " The process can take several minutes."
107 echo " A beep will notify you when it will be done."
108 echo " Press ENTER to start."
112 read -s -n 1 # read 1 character without echo, ended by ENTER
114 if [ ! -e configure
]; then
117 echo " ======================================================================== "
118 echo " (( Preparation from SVN ))"
119 echo " ======================================================================== "
123 echo "make -f Makefile.cvs"
124 make -f Makefile.cvs || error
129 echo " ======================================================================== "
130 echo " (( Step 1 / 3 : Configuration ))"
131 echo " ======================================================================== "
135 if [ "_$isDevel" == "_" ]; then
136 echo "./configure --prefix=$prefix"
137 .
/configure
--prefix=$prefix || error
139 echo "./configure --enable-debug=full --prefix=$prefix"
140 .
/configure
--enable-debug=full
--prefix=$prefix || error
145 echo " ======================================================================== "
146 echo " (( Step 2 / 3 : Compilation ))"
147 echo " ======================================================================== "
156 echo " ======================================================================== "
157 echo " (( Step 3 / 3 : Installation ))"
158 echo " ======================================================================== "
161 echo " The application has successfuly been compiled."
165 echo $
'\a' # Beep to avert user the configuration/compilation is ended and he must act to enter the password
167 if [ "_$SYS_WIDE" == "_n" ]; then
168 # First make the bin folder to not copy basket file to bin file if bin/ doesn't exist
172 echo " Please now enter the root password in order to install "
173 echo " BasKet Note Pads on the system."
175 sudo
make install ||
exit 1
182 echo " ======================================================================== "
183 echo " (( End of BasKet Note Pads Installation ))"
184 echo " ======================================================================== "
187 echo " Do you want to run BasKet Note Pads now?"
188 echo " If an older version is currently running it will be exited before."
190 echo " Notice that you willn't have to exit BasKet : it will be restored each time"
191 echo " you log in to KDE."
195 echo -n "Start or restart BasKet Note Pads? [y/n] (default is y): "
197 if [ "_$RESTART" != "_" ]; then # If pressed Enter, a new line was already print
201 if [ "_$RESTART" != "_n" ]; then
202 # Get the pid of the process basket, if currently running
203 pid
=`ps aux | awk '$11 == "basket" { print $2 }'`
204 if [ "_$pid" == "_" ]; then
210 if [ "_$SYS_WIDE" == "_n" ]; then
211 echo "$prefix/bin/basket"
221 echo " ======================================================================== "
222 echo " (( Congratulation: BasKet Note Pads is now Installed onto your System ))"
223 echo " ======================================================================== "
226 echo " In the future, if you want to uninstall BasKet Note Pads, you will have to"
227 if [ "_$SYS_WIDE" == "_n" ]; then
228 echo " enter the command make uninstall in this folder."
230 echo " enter the command su -c 'make uninstall' in this folder."