3 # Automatic script to install Citadel on a target system.
4 # Copyright (C) 2004 Michael Hampton <error@citadel.org>
5 # Copyright (C) 2004-2015 Art Cancro <ajc@citadel.org>
7 # This program is open source software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License version 3.
10 # Our favorite operating system is called Linux.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # Reading this script? Here's some helpful hints:
19 # If you're seeing this in your browser, it's probably not what you want.
20 # You can either save it to disk and run it, or do it the easy way:
22 # curl http://easyinstall.citadel.org/install | sh
24 # Note that this script installs software on your system and so it requires
25 # root privileges. Feel free to inspect the script to make sure we didn't
26 # do anything stupid...
28 # We have provided you the source code according to the terms of the respective
29 # software licenses included in the source code packages, even if you choose
30 # not to keep the source code around. You can always download it again later.
32 # We install the "latest" or "stable" versions of these packages:
34 # Citadel server, WebCit, libcitadel, libical, Berkeley DB, libSieve, Expat
36 # Do *not* attempt to do anything with the UNATTENDED_BUILD mode. This is
37 # for our use only and is not only unsupported, but we will deliberately break
38 # it from time to time in order to prevent you from trying to use it.
40 ###############################################################################
42 # This is the general stuff we're going to do, in order:
44 # 1. Gather information about the target system
45 # 2. Present the installation steps (from 1 above) to the user
46 # 3. Present any pre-install customizations to the user
47 # 4. Do the installation
48 # A. Download any source code files packages required
49 # B. If we build our own, compile and install prerequisites then Citadel
50 # 5. Do post-installation setup
54 ###############################################################################
57 # Begin user customization area
59 # These two directories specify where Citadel and its private support
60 # libraries will be installed. This keeps them safely tucked away from
61 # the rest of your system. The defaults should be fine for most people.
63 SUPPORT=/usr/local/ctdlsupport
64 CITADEL=/usr/local/citadel
65 WEBCIT=/usr/local/webcit
67 BUILD=$WORKDIR/citadel-build.$$
68 LOG=$WORKDIR/citadel-install-log.txt
69 export SUPPORT CITADEL WEBCIT
74 # End user customization area
76 # We're now exporting a bunch of environment variables, and here's a list:
77 # CITADEL_INSTALLER Set to "web" to indicate this script
78 # CITADEL Directory where Citadel is installed
79 # WEBCIT Directory where WebCit is installed
80 # SUPPORT Directory where support programs are installed
81 # DISTRO_MAJOR Linux distribution name, if applicable
82 # DISTRO_MINOR Linux distribution name, if applicable
83 # DISTRO_VERSION Linux distribution version (major digit) if applicable
84 # CC C compiler being used
85 # MAKE Make program being used
86 # CFLAGS C compiler flags
87 # LDFLAGS Linker flags
88 # IS_UPGRADE Set to "yes" if upgrading an existing Citadel
89 # CTDL_DIALOG Where (if at all) the "whiptail" or "dialog" program may be found
91 # Let Citadel setup recognize the Citadel installer
93 export CITADEL_INSTALLER
95 SETUP="Citadel Easy Install"
96 DOWNLOAD_SITE=http://easyinstall.citadel.org
98 # Original source code packages.
99 DB_SOURCE=db-5.1.29.NC.tar.gz
100 ICAL_SOURCE=libical-easyinstall.tar.gz
101 LIBSIEVE_SOURCE=libsieve-2.2.7-ctdl2.tar.gz
102 EXPAT_SOURCE=expat-2.0.1.tar.gz
103 LIBCURL_SOURCE=curl-7.26.0.tar.gz
104 LIBEV_SOURCE=libev-4.11.tar.gz
105 CARES_SOURCE=c-ares-1.7.5.tar.gz
106 LIBDISCOUNT_SOURCE=discount-2.1.8.tar.gz
107 LIBCITADEL_SOURCE=libcitadel-easyinstall.tar.gz
108 CITADEL_SOURCE=citadel-easyinstall.tar.gz
109 WEBCIT_SOURCE=webcit-easyinstall.tar.gz
110 TEXTCLIENT_SOURCE=textclient-easyinstall.tar.gz
116 LDADD="-L/usr/local/lib"
117 INCADD="-I/usr/local/include"
121 ##### BEGIN Functions #####
125 VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
131 echo $SETUP is aborting.
133 echo A log file has been written to $LOG
134 echo Reading this file may tell you what went wrong. If you
135 echo need to ask for help on the support forum, please post the
136 echo last screenful of text from this log.
138 echo Operating system: ${OSSTR}
139 echo Operating system: ${OSSTR} >>$LOG
148 tempfilename=test$$.sh
150 echo '#!/bin/sh' >$tempfilename
151 echo '' >>$tempfilename
152 echo 'exit 0' >>$tempfilename
153 chmod 700 $tempfilename
155 [ -x $tempfilename ] || {
156 echo Cannot write to `pwd`
157 echo 'Are you not running this program as root?'
162 echo Cannot execute a script.
163 echo 'If /tmp is mounted noexec, please change this before continuing.'
172 WGET=`which wget 2>/dev/null`
173 CURL=`which curl 2>/dev/null`
174 if [ -n "${WGET}" -a -x "${WGET}" ]; then
175 $WGET $DOWNLOAD_SITE/$FILENAME >/dev/null 2>>$LOG || die
177 if [ -n "${CURL}" -a -x "${CURL}" ]; then
178 $CURL $DOWNLOAD_SITE/$FILENAME >$FILENAME 2>>$LOG || die
180 echo Unable to find a wget or curl command.
181 echo $SETUP cannot continue.
190 cd $BUILD >>$LOG 2>&1 || die
191 FILENAME=libical-easyinstall.sum ; download_this
192 SUM=`cat libical-easyinstall.sum`
193 SUMFILE=$SUPPORT/etc/libical-easyinstall.sum
194 if [ -r $SUMFILE ] ; then
195 OLDSUM=`cat $SUMFILE`
196 if [ "$SUM" = "$OLDSUM" ] ; then
197 echo "* libical does not need updating."
201 echo "* Downloading libical..."
202 FILENAME=$ICAL_SOURCE ; download_this
203 echo "* Installing libical..."
204 ( gzip -dc $ICAL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
205 cd $BUILD/libical >>$LOG 2>&1 || die
206 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
207 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
208 $MAKE install >>$LOG 2>&1 || die
211 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
212 rm -f $WEBCIT/webcit-easyinstall.sum 2>/dev/null
215 install_libsieve () {
216 cd $BUILD >>$LOG 2>&1 || die
217 FILENAME=libsieve-easyinstall.sum ; download_this
218 SUM=`cat libsieve-easyinstall.sum`
219 SUMFILE=$SUPPORT/etc/libsieve-easyinstall.sum
220 if [ -r $SUMFILE ] ; then
221 OLDSUM=`cat $SUMFILE`
222 if [ "$SUM" = "$OLDSUM" ] ; then
223 echo "* libsieve does not need updating."
227 echo "* Downloading libsieve..."
228 FILENAME=$LIBSIEVE_SOURCE ; download_this
229 echo "* Installing libsieve..."
230 ( gzip -dc $LIBSIEVE_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
231 cd $BUILD/libsieve-2.2.7/src >>$LOG 2>&1 || die
232 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
233 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
234 $MAKE install >>$LOG 2>&1 || die
237 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
241 cd $BUILD >>$LOG 2>&1 || die
242 FILENAME=expat-easyinstall.sum ; download_this
243 SUM=`cat expat-easyinstall.sum`
244 SUMFILE=$SUPPORT/etc/expat-easyinstall.sum
245 if [ -r $SUMFILE ] ; then
246 OLDSUM=`cat $SUMFILE`
247 if [ "$SUM" = "$OLDSUM" ] ; then
248 echo "* expat does not need updating."
252 echo "* Downloading expat..."
253 FILENAME=$EXPAT_SOURCE ; download_this
254 echo "* Installing Expat..."
255 ( gzip -dc $EXPAT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
256 cd $BUILD/expat-2.0.1 >>$LOG 2>&1 || die
257 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
258 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
259 $MAKE install >>$LOG 2>&1 || die
262 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
267 cd $BUILD >>$LOG 2>&1 || die
268 FILENAME=libcurl-easyinstall.sum ; download_this
269 SUM=`cat libcurl-easyinstall.sum`
270 SUMFILE=$SUPPORT/etc/libcurl-easyinstall.sum
271 if [ -r $SUMFILE ] ; then
272 OLDSUM=`cat $SUMFILE`
273 if [ "$SUM" = "$OLDSUM" ] ; then
274 echo "* libcurl does not need updating."
278 echo "* Downloading libcurl..."
279 FILENAME=$LIBCURL_SOURCE ; download_this
280 echo "* Installing libcurl..."
281 ( gzip -dc $LIBCURL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
282 CFLAGS="${CFLAGS} -I${SUPPORT}/include ${INCADD} -g"
284 LDFLAGS="-L${SUPPORT}/lib -Wl,--rpath -Wl,${SUPPORT}/lib ${LDADD}"
285 export CFLAGS CPPFLAGS LDFLAGS
287 cd $BUILD/curl-7.26.0 >>$LOG 2>&1 || die
288 ./configure --prefix=$SUPPORT --disable-file --disable-ldap --disable-ldaps \
289 --disable-dict --disable-telnet --disable-tftp --disable-manual \
290 --enable-thread --disable-sspi --disable-crypto-auth --disable-cookies \
291 --without-libssh2 --without-ca-path --without-libidn \
292 --enable-ares=$SUPPORT \
294 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
295 $MAKE install >>$LOG 2>&1 || die
298 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
303 cd $BUILD >>$LOG 2>&1 || die
304 FILENAME=libev-easyinstall.sum ; download_this
305 SUM=`cat libev-easyinstall.sum`
306 SUMFILE=$SUPPORT/etc/libev-easyinstall.sum
307 if [ -r $SUMFILE ] ; then
308 OLDSUM=`cat $SUMFILE`
309 if [ "$SUM" = "$OLDSUM" ] ; then
310 echo "* libev does not need updating."
314 echo "* Downloading libev..."
315 FILENAME=$LIBEV_SOURCE ; download_this
316 echo "* Installing libev..."
317 ( gzip -dc $LIBEV_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
318 cd $BUILD/libev-4.11 >>$LOG 2>&1 || die
319 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
320 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
321 $MAKE install >>$LOG 2>&1 || die
324 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
329 cd $BUILD >>$LOG 2>&1 || die
330 FILENAME=c-ares-easyinstall.sum ; download_this
331 SUM=`cat c-ares-easyinstall.sum`
332 SUMFILE=$SUPPORT/etc/c-ares-easyinstall.sum
333 if [ -r $SUMFILE ] ; then
334 OLDSUM=`cat $SUMFILE`
335 if [ "$SUM" = "$OLDSUM" ] ; then
336 echo "* c-ares does not need updating."
340 echo "* Downloading c-ares..."
341 FILENAME=$CARES_SOURCE ; download_this
342 echo "* Installing c-ares..."
343 ( gzip -dc $CARES_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
344 cd $BUILD/c-ares-1.7.5 >>$LOG 2>&1 || die
345 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
346 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
347 $MAKE install >>$LOG 2>&1 || die
350 rm -f $SUPPORT/etc/libcurl-easyinstall.sum 2>/dev/null
351 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
354 install_discount () {
355 cd $BUILD >>$LOG 2>&1 || die
356 cp /home/willi/Downloads/discount*z .
357 FILENAME=discount-easyinstall.sum ; download_this
358 SUM=`cat discount-easyinstall.sum`
359 SUMFILE=$SUPPORT/etc/discount-easyinstall.sum
360 if [ -r $SUMFILE ] ; then
361 OLDSUM=`cat $SUMFILE`
362 if [ "$SUM" = "$OLDSUM" ] ; then
363 echo "* discount does not need updating."
367 echo "* Downloading discount..."
368 FILENAME=$LIBDISCOUNT_SOURCE ; download_this
369 echo "* Installing discount..."
370 ( gzip -dc $LIBDISCOUNT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
371 cd $BUILD/discount-2.1.8 >>$LOG 2>&1 || die
372 ./configure.sh --shared \
380 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
381 $MAKE install >>$LOG 2>&1 || die
384 rm -f $SUPPORT/etc/discount-easyinstall.sum 2>/dev/null
385 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
388 install_libcitadel () {
389 cd $BUILD >>$LOG 2>&1 || die
390 FILENAME=libcitadel-easyinstall.sum ; download_this
391 SUM=`cat libcitadel-easyinstall.sum`
392 SUMFILE=$SUPPORT/etc/libcitadel-easyinstall.sum
393 if [ -r $SUMFILE ] ; then
394 OLDSUM=`cat $SUMFILE`
395 if [ "$SUM" = "$OLDSUM" ] ; then
396 echo "* libcitadel does not need updating."
400 echo "* Downloading libcitadel..."
401 FILENAME=$LIBCITADEL_SOURCE ; download_this
402 echo "* Installing libcitadel..."
403 ( gzip -dc $LIBCITADEL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
404 cd $BUILD/libcitadel >>$LOG 2>&1 || die
405 ./configure --prefix=$SUPPORT >>$LOG 2>&1 || die
406 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
407 $MAKE install >>$LOG 2>&1 || die
410 # Upgrading libcitadel forces the upgrade of programs which link to it
411 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
412 rm -f $CITADEL/webcit-easyinstall.sum 2>/dev/null
413 rm -f $CITADEL/textclient-easyinstall.sum 2>/dev/null
417 cd $BUILD >>$LOG 2>&1 || die
418 FILENAME=db-easyinstall.sum ; download_this
419 SUM=`cat db-easyinstall.sum`
420 SUMFILE=$SUPPORT/etc/db-easyinstall.sum
421 if [ -r $SUMFILE ] ; then
422 OLDSUM=`cat $SUMFILE`
423 if [ "$SUM" = "$OLDSUM" ] ; then
424 echo "* Berkeley DB does not need updating."
428 echo "* Downloading Berkeley DB..."
429 FILENAME=$DB_SOURCE ; download_this
430 echo "* Installing Berkeley DB..."
431 ( gzip -dc $DB_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
432 cd $BUILD/db-5.1.29.NC/build_unix >>$LOG 2>&1 || die
433 ../dist/configure --prefix=$SUPPORT --disable-compat185 --disable-cxx --disable-debug --disable-dump185 --disable-java --disable-tcl --disable-test --without-rpm >>$LOG 2>&1 || die
434 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
435 $MAKE install >>$LOG 2>&1 || die
438 rm -f $CITADEL/citadel-easyinstall.sum 2>/dev/null
441 install_prerequisites () {
443 # Create the support directories if they don't already exist
445 mkdir $SUPPORT 2>/dev/null
446 mkdir $SUPPORT/bin 2>/dev/null
447 mkdir $SUPPORT/sbin 2>/dev/null
448 mkdir $SUPPORT/lib 2>/dev/null
449 mkdir $SUPPORT/libexec 2>/dev/null
450 mkdir $SUPPORT/include 2>/dev/null
451 mkdir $SUPPORT/etc 2>/dev/null
459 if [ -z "$OK_LIBSIEVE" ]
467 if [ -z "$OK_EXPAT" ]
471 if [ -z "$OK_LIBEV" ]
475 if [ -z "$OK_CARES" ]
479 if [ -z "$OK_DISCOUNT" ]
483 if [ -z "$OK_LIBCURL" ]
493 cd $BUILD >>$LOG 2>&1 || die
494 if [ x$IS_UPGRADE = xyes ]
496 echo "* Upgrading your existing Citadel installation."
499 CFLAGS="${CFLAGS} -I${SUPPORT}/include ${INCADD} -g"
501 LDFLAGS="-L${SUPPORT}/lib -Wl,--rpath -Wl,${SUPPORT}/lib ${LDADD}"
502 export CFLAGS CPPFLAGS LDFLAGS
504 DO_INSTALL_CITADEL=yes
505 FILENAME=citadel-easyinstall.sum ; download_this
506 SUM=`cat citadel-easyinstall.sum`
507 SUMFILE=$CITADEL/citadel-easyinstall.sum
508 if [ -r $SUMFILE ] ; then
509 OLDSUM=`cat $SUMFILE`
510 if [ "$SUM" = "$OLDSUM" ] ; then
511 echo "* Citadel does not need updating."
512 DO_INSTALL_CITADEL=no
516 if [ $DO_INSTALL_CITADEL = yes ] ; then
517 echo "* Downloading Citadel..."
518 FILENAME=$CITADEL_SOURCE ; download_this
519 echo "* Installing Citadel..."
520 cd $BUILD >>$LOG 2>&1 || die
521 ( gzip -dc $CITADEL_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
522 cd $BUILD/citadel >>$LOG 2>&1 || die
525 ./configure --prefix=$CITADEL --with-db=$SUPPORT --with-pam --with-libical --disable-threaded-client >>$LOG 2>&1 || die
527 ./configure --prefix=$CITADEL --with-db=$OK_DB --with-pam --with-libical --disable-threaded-client >>$LOG 2>&1 || die
529 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
530 if [ x$IS_UPGRADE = xyes ]
532 echo "* Performing Citadel upgrade..."
533 $MAKE upgrade >>$LOG 2>&1 || die
535 echo "* Performing Citadel install..."
536 $MAKE install >>$LOG 2>&1 || die
537 useradd -c "Citadel service account" -d $CITADEL -s $CITADEL/citadel citadel >>$LOG 2>&1
542 ## begin webcit install
544 cd $BUILD >>$LOG 2>&1 || die
545 DO_INSTALL_WEBCIT=yes
546 FILENAME=webcit-easyinstall.sum ; download_this
547 SUM=`cat webcit-easyinstall.sum`
548 SUMFILE=$WEBCIT/webcit-easyinstall.sum
549 if [ -r $SUMFILE ] ; then
550 OLDSUM=`cat $SUMFILE`
551 if [ "$SUM" = "$OLDSUM" ] ; then
552 echo "* WebCit does not need updating."
557 if [ $DO_INSTALL_WEBCIT = yes ] ; then
558 echo "* Downloading WebCit..."
559 FILENAME=$WEBCIT_SOURCE ; download_this
560 echo "* Installing WebCit..."
561 cd $BUILD >>$LOG 2>&1 || die
562 ( gzip -dc $WEBCIT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
563 cd $BUILD/webcit >>$LOG 2>&1 || die
564 ./configure --prefix=$WEBCIT --with-libical >>$LOG 2>&1 || die
565 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
566 rm -fr $WEBCIT/static 2>&1
567 $MAKE install >>$LOG 2>&1 || die
572 ## begin text client install
574 cd $BUILD >>$LOG 2>&1 || die
575 DO_INSTALL_TEXTCLIENT=yes
576 FILENAME=textclient-easyinstall.sum ; download_this
577 SUM=`cat textclient-easyinstall.sum`
578 SUMFILE=$CITADEL/webcit-easyinstall.sum
579 if [ -r $SUMFILE ] ; then
580 OLDSUM=`cat $SUMFILE`
581 if [ "$SUM" = "$OLDSUM" ] ; then
582 echo "* Citadel text mode client does not need updating."
583 DO_INSTALL_TEXTCLIENT=no
587 if [ $DO_INSTALL_TEXTCLIENT = yes ] ; then
588 echo "* Downloading the Citadel text mode client..."
589 FILENAME=$TEXTCLIENT_SOURCE ; download_this
590 echo "* Installing the Citadel text mode client..."
591 cd $BUILD >>$LOG 2>&1 || die
592 ( gzip -dc $TEXTCLIENT_SOURCE | tar -xf - ) >>$LOG 2>&1 || die
593 cd $BUILD/textclient >>$LOG 2>&1 || die
594 ./configure --prefix=$CITADEL >>$LOG 2>&1 || die
595 $MAKE $MAKEOPTS >>$LOG 2>&1 || die
596 $MAKE install >>$LOG 2>&1 || die
604 echo "* Configuring your system ..."
606 if [ x$IS_UPGRADE = xyes ]
608 echo Upgrading your existing Citadel installation.
610 echo This is a new Citadel installation.
613 if [ -x /etc/init.d/citadel ] ; then
614 echo Stopping any previously running Citadel server...
615 /etc/init.d/citadel stop
618 # If we are running a Linux operating system we try even harder to stop citserver
619 if uname -a | grep -i linux ; then
620 if ps ax | grep citserver | grep -v grep ; then
621 echo citserver still running ... trying again to terminate it
627 # If we are running a Linux operating system we try even harder to stop citserver
628 if uname -a | grep -i linux ; then
629 if ps ax | grep citserver | grep -v grep ; then
630 echo citserver still running ... trying again to terminate it
636 FILENAME=citadel-init-scripts.tar ; download_this
637 cat citadel-init-scripts.tar | (cd / ; tar xvf - )
638 echo Starting Citadel server...
639 /etc/init.d/citadel start
641 $CITADEL/setup </dev/tty || die
642 $WEBCIT/setup </dev/tty || die
647 ##### END Functions #####
649 ##### BEGIN main #####
652 # 0. Test to make sure we're running as root
654 PERMSTESTDIR=/usr/local/ctdltest.$$
655 mkdir $PERMSTESTDIR || {
657 echo 'Easy Install is unable to create subdirectories in /usr/local.'
658 echo 'Did you forget to run the install command as the root user?'
659 echo 'Please become root (with a command like "su" or "sudo su") and'
664 rmdir $PERMSTESTDIR 2>/dev/null
666 # 1. Gather information about the target system
668 # Non-GNU make does not work.
669 # This probably ought to be fixed, but for now we will simply require GNU make.
672 if gmake -v 2>&1 | grep -i GNU ; then
675 if make -v 2>&1 | grep -i GNU ; then
680 if [ $MAKE == xx ] ; then
682 echo 'Easy Install requires GNU Make (gmake), which was not found.'
683 echo 'Please install gmake and try again.'
696 rm -f $LOG 2>/dev/null
699 # Determine which operating system we are running on
705 if [ "${OS}" = "SunOS" ] ; then
708 OSSTR="${OS} ${REV}(${ARCH} `uname -v`)"
709 elif [ "${OS}" = "AIX" ] ; then
710 OSSTR="${OS} `oslevel` (`oslevel -r`)"
711 elif [ "${OS}" = "Linux" ] ; then
713 if [ -f /etc/redhat-release ] ; then
715 PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
716 REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
717 elif [ -f /etc/SUSE-release ] ; then
718 DIST=`cat /etc/SUSE-release | tr "\n" ' '| sed s/VERSION.*//`
719 REV=`cat /etc/SUSE-release | tr "\n" ' ' | sed s/.*=\ //`
720 elif [ -f /etc/mandrake-release ] ; then
722 PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
723 REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
724 elif [ -f /etc/debian_version ] ; then
725 DIST="Debian `cat /etc/debian_version`"
729 if [ -f /etc/UnitedLinux-release ] ; then
730 DIST="${DIST}[`cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//`]"
733 OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
743 # 2. Present the installation steps (from 1 above) to the user
745 if whiptail --infobox "Welcome to Citadel Easy Install" 10 70 2>/dev/null
747 CTDL_DIALOG=`which whiptail`
754 echo "Welcome to $SETUP"
755 echo Running on: ${OSSTR}
756 echo "We will perform the following actions:"
759 echo "* Download/install supporting libraries (if needed)"
760 echo "* Download/install Citadel (if needed)"
761 echo "* Download/install WebCit (if needed)"
763 echo "Configuration:"
764 echo "* Configure Citadel"
765 echo "* Configure WebCit"
767 echo -n "Perform the above installation steps now? "
768 if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
775 if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
780 FILENAME=gpl.txt ; download_this
783 echo "Do you accept the terms of this license?"
784 echo "If you do not accept the General Public License, Easy Install will exit."
785 echo -n "Enter Y or Yes to accept: "
786 if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
792 if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
797 if [ -f $CITADEL/citadel.config ]
800 echo "* Upgrading your existing Citadel installation."
803 echo "* This is a NEW Citadel installation."
806 if [ x$IS_UPGRADE = xyes ]
809 echo "This appears to be an upgrade of an existing Citadel installation."
810 echo -n "Have you performed a FULL BACKUP of your programs and data? "
811 if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then
817 if [ "`echo $yesno | cut -c 1 | tr N n`" = "n" ]; then
819 echo "citadel.org does not provide emergency support for sites"
820 echo "which broke irrecoverably during a failed upgrade."
821 echo "Easy Install will now exit."
829 echo "Installation will now begin."
830 echo "Command output will not be sent to the terminal."
831 echo "To view progress, see the $LOG file."
834 # 3. Do the installation
836 install_prerequisites
839 # 4. Do post-installation setup
841 if [ x$UNATTENDED_BUILD = "xYOU_BETCHA" ] ; then