--- cddbd-1.5.2.old/install.sh +++ cddbd-1.5.2/install.sh @@ -336,63 +336,13 @@ $ECHO "\nInstalling \"${CDDBDEXEC}\" CDDB Protocol Server $CDDBD_VER by Steve Scherf et al." - # Determine BINDIR - -if [ -z "$BINDIR" ] -then - if [ -d /usr/local/bin ] - then - BINDIR=/usr/local/bin - elif [ -d /usr/lbin ] - then - BINDIR=/usr/lbin - elif [ -d /usr/bin ] - then - BINDIR=/usr/bin - else - BINDIR=/usr/local/bin - fi -else - BINDIR=`echo $BINDIR | sed 's/\/\//\//g'` -fi +BINDIR=__META_PREFIX__/sbin +mkdir -p $BINDIR # get the man path -MANDIR=`echo $BINDIR | sed 's/bin$/man\/man1/g'` +MANDIR=`echo $BINDIR | sed 's/sbin$/man\/man1/g'` -while : -do - if getstr "\nEnter cddbd binary directory\n[${BINDIR}]:" - then - if [ -d "$ANS" ] - then - BINDIR=$ANS - break - else - $ECHO "Error: $ANS does not exist." - fi - else - break - fi -done - -while : -do - if getstr "\nEnter cddbd man directory (for cddbd.1)\n[${MANDIR}]:" - then - if [ -d "$ANS" ] - then - MANDIR=$ANS - break - else - $ECHO "Error: $ANS does not exist." - fi - else - break - fi -done - - # Find other directories BASEDIR=`grep '^ACCESSFILE' .accessfile | awk '{ print $2 }'` @@ -405,123 +355,6 @@ fi CDDBDIR=${CDDBDIR}/cddb -while : -do - if getstr "\nEnter cddbd work directory\n[${WORKDIR}]:" - then - if [ -d `dirname "$ANS"` ] - then - WORKDIR=$ANS - break - else - $ECHO "Error: `dirname $ANS` does not exist." - fi - else - break - fi -done - -while : -do - if getstr "\nEnter CD database directory\n[${CDDBDIR}]:" - then - if [ -d "$ANS" ] - then - if [ "$ANS" = "$WORKDIR" ] - then - $ECHO "The database directory cannot be the \c" - $ECHO "same as the work directory." - else - CDDBDIR=$ANS - break - fi - - else - CDDBTMP=$ANS - YNDEF=n - if getyn "Warning: $ANS does not exist. Continue anyway" - then - CDDBDIR=$CDDBTMP - break - fi - fi - else - break - fi -done - -YNDEF=y -if getyn "\nDo you want to enable server access via HTTP" -then - if [ -d "$HOME/public_html" ] - then - CGIDIR="$HOME/public_html" - else - CGIDIR="" - fi - - while : - do - if getstr "\nEnter cddbd CGI directory\n[${CGIDIR}]:" - then - if [ -d "$ANS" ] - then - CGIDIR=$ANS - break - else - $ECHO "Error: $ANS does not exist." - fi - else - if [ "$CGIDIR" != "" ] - then - break - else - $ECHO: "Error: a directory must be entered." - fi - fi - done - $ECHO "\nSubmissions via http are handled by the submit.cgi. The submit.cgi" - $ECHO "forwards the submissions it receives to the central submit e-mail" - $ECHO "address. To do that, it needs sendmail (or a sendmail wrapper) installed." - if getyn "\nDo you want to accept submissions via http" - then - instsubmitcgi=true - rm -f submit.cgi - cat ${SUBMITCGI}.template > ${SUBMITCGI} - while : - do - if getstr "\nEnter the path to sendmail.\n[${DSENDMAIL}]:" - then - if [ -x "$ANS" -a -f "$ANS" ] - then - ANS=`echo $ANS | sed 's/\//\\\\\//g'` - sed "s/\/usr\/sbin\/sendmail/$ANS/" ${SUBMITCGI} > ${SUBMITCGI}.tmp && mv ${SUBMITCGI}.tmp ${SUBMITCGI} - break - else - $ECHO "Error: $ANS does not exist." - fi - else - if [ "$DSENDMAIL" != "" ] - then - DSENDMAIL=`$ECHO $DSENDMAIL | sed 's/\//\\\\\//'` - sed "s/\/usr\/sbin\/sendmail/$DSENDMAIL/" ${SUBMITCGI} > ${SUBMITCGI}.tmp && mv ${SUBMITCGI}.tmp ${SUBMITCGI} - break - else - $ECHO "The path to sendmail must be entered." - fi - fi - done - if getstr "\nEnter submit e-mail address.\n[${DSUBMITADDR}]:" - then - sed "s/${DSUBMITADDR}/$ANS/" ${SUBMITCGI} > ${SUBMITCGI}.tmp && mv ${SUBMITCGI}.tmp ${SUBMITCGI} - fi - if getstr "\nEnter test-submit e-mail address.\n[${DTESTSUBMITADDR}]:" - then - sed "s/${DTESTSUBMITADDR}/$ANS/" ${SUBMITCGI} > ${SUBMITCGI}.tmp && mv ${SUBMITCGI}.tmp ${SUBMITCGI} - fi - fi -fi - # Make directory names. SERVDIR="${WORKDIR}/server" @@ -560,51 +393,10 @@ $ECHO "workdir: ${WORKDIR}" >> access $ECHO "cddbdir: ${CDDBDIR}" >> access -YNDEF=n -if getyn "\nDo you want configure your site as a master database hub" -then - master=true - logging=post - - POSTDIR=${WORKDIR}/post - DUPDIR=${WORKDIR}/dup - - $ECHO "postdir: ${POSTDIR}" >> access - $ECHO "dupdir: ${DUPDIR}" >> access - $ECHO "dup_policy: compare" >> access - $ECHO "transmits: ${XMITS}" >> access - - if getstr "\nEnter your SMTP server host\n[${DSMTPHOST}]:" - then - SMTPHOST=$ANS - else - SMTPHOST=$DSMTPHOST - fi - - $ECHO "smtphost: ${SMTPHOST}" >> access - - if getstr "\nEnter your full email address\n[${DEMAILADDR}]:" - then - EMAILADDR=$ANS - else - EMAILADDR=$DEMAILADDR - fi - - $ECHO "admin_email: ${EMAILADDR}" >> access - $ECHO "bounce_email: ${EMAILADDR}" >> access - $ECHO "test_email: ${EMAILADDR}" >> access -else - logging=norm - master=false - $ECHO "postdir: ${CDDBDIR}" >> access - $ECHO "dup_policy: always" >> access -fi - -if getstr "\nEnter the hostname used for banner message etc.\n[${DHOSTNAME}]:" -then - $ECHO "apphost: $ANS" >> access -fi - +logging=norm +master=false +$ECHO "postdir: ${CDDBDIR}" >> access +$ECHO "dup_policy: always" >> access case $logging in norm) @@ -647,62 +439,14 @@ $ECHO "should be setuid/setgid unless you can guarantee that the owner will" $ECHO "be the only user to run it." -if getstr "\nEnter the user who will own the server directory\n[${OWNER}]:" -then - OWNID=$ANS -else - OWNID=$OWNER -fi - -if getstr "\nEnter the group of the server directory\n[${GROUP}]:" -then - GRPID=$ANS -else - GRPID=$GROUP -fi - -if getstr "\nEnter the server file creation mode\n[${FILEPERM}]:" -then - FPERM=$ANS -else - FPERM=$FILEPERM -fi - -if getstr "\nEnter the server directory creation mode\n[${DIRPERM}]:" -then - DPERM=$ANS -else - DPERM=$DIRPERM -fi - -if getstr "\nEnter the user who will own the database\n[${OWNID}]:" -then - DBOWNID=$ANS -else - DBOWNID=$OWNID -fi - -if getstr "\nEnter the group of the database\n[${GRPID}]:" -then - DBGRPID=$ANS -else - DBGRPID=$GRPID -fi - -if getstr "\nEnter the database file mode\n[${FPERM}]:" -then - DBFPERM=$ANS -else - DBFPERM=$FPERM -fi - -if getstr "\nEnter the database directory mode\n[${DPERM}]:" -then - DBDPERM=$ANS -else - DBDPERM=$DPERM -fi - +OWNID=$OWNER +GRPID=$GROUP +FPERM=$FILEPERM +DPERM=$DIRPERM +DBOWNID=$OWNID +DBGRPID=$GRPID +DBFPERM=$FPERM +DBDPERM=$DPERM SECUSERS=`grep '^SECUSERS' .accessfile | awk '{ print $2 }'` if [ "$OWNID" = "$DBOWNID" -a "$GRPID" = "$DBGRPID" -a $SECUSERS -eq 0 ] @@ -712,27 +456,6 @@ BINPERM=$DBINPERM2 fi -if getstr "\nEnter the server file binary mode\n[${BINPERM}]:" -then - BINPERM=$ANS -fi - -if [ "$CGIDIR" != "" ] -then - $ECHO "\nThe cddb.cgi file binary mode required depends on your web server settings." - $ECHO "The cddb.cgi should be executed as the user who owns the server directory." - $ECHO "If you are installing cddb.cgi in the public_html directory of that user" - $ECHO "and executing the cgi suid is already taken care of by Apache suexec, then" - $ECHO "you should specify 711 here, otherwise leave the default of 6711." - if getstr "\nEnter the cddb.cgi binary mode\n[${DCDDBCGIPERM}]:" - then - CDDBCGIPERM=$ANS - else - CDDBCGIPERM=$DCDDBCGIPERM - fi -fi - - $ECHO "user: ${OWNID}" >> access $ECHO "group: ${GRPID}" >> access $ECHO "file_mode: ${FPERM}" >> access @@ -744,86 +467,9 @@ PERMACC=access -if [ $master = true ] -then - $ECHO "\n# Beginning of permissions.\n" >> access - $ECHO "host_perms: ches default connect nopost noupdate noget \c" >> access - $ECHO "noput nopasswd" >> access -else - YNDEF=n - if getyn "\nDo you want to allow automatic database updates" - then - YNDEF=n - if getyn "\nDo you want your server remotely administered" - then - $ECHO "altaccfile: ${ALTACC}" >> access - - PERMACC=access.alt - PUT=put - touch access.alt - chmod $FILEPERM access.alt - $ECHO "\n# Beginning of permissions.\n" >> access - else - PUT=noput - fi - - $ECHO "\n# Beginning of permissions.\n" >> $PERMACC - - if getstr "\nEnter database feed site\n[${DFEEDHOST}]:" - then - FEEDHOST=$ANS - else - FEEDHOST=$DFEEDHOST - fi - - $ECHO "host_perms: sc ${FEEDHOST} connect post update \c" >> access - $ECHO "get $PUT nopasswd" >> access - - $ECHO "\nIn order for automatic updates to be initiated, you must" - $ECHO "contact the cddbd administrator at \c" - - if [ "${FEEDHOST}" = "${DFEEDHOST}" ] - then - $ECHO "${ADMINMAIL}.\n" - else - $ECHO "the site you have specified.\n" - fi - else - $ECHO "\n# Beginning of permissions.\n" >> access - fi - - $ECHO "host_perms: che default connect nopost noupdate noget \c" >> $PERMACC - $ECHO "noput nopasswd" >> $PERMACC - $ECHO "host_perms: s default noconnect nopost noupdate noget \c" >> $PERMACC - $ECHO "noput nopasswd" >> $PERMACC -fi - -YNDEF=y -if getyn "\nDo you want to create the motd file now" -then - if [ "$EDITOR" = "" ] - then - ED=/usr/bin/vi - else - ED=$EDITOR - fi - - if getstr "\nEnter editor you wish to use\n[${ED}]:" - then - ED=$ANS - fi - - if [ -f $MOTD ] - then - cp $MOTD motd - fi - - $ED motd -else - $ECHO "\nYou will have to edit $MOTD by hand if you" - $ECHO "wish to create a message of the day." - rm -f motd -fi +$ECHO "\nYou will have to edit $MOTD by hand if you" +$ECHO "wish to create a message of the day." +rm -f motd # Make all necessary directories @@ -934,22 +580,6 @@ instfile motd $MOTD $FPERM $OWNID $GRPID fi -YNDEF=y -if getyn "\nDo you want to create the fuzzy matching hash file now" -then - $ECHO "\nPlease wait while the hash file is created." - $ECHO "This will take a few minutes.\n" - - ${BINDIR}/${CDDBDEXEC} -fd - - err=$? - if [ $err -ne 0 ] - then - logerr -n "Failed to build the fuzzy matching hash file." - fi -else - $ECHO "\nIf you wish to enable fuzzy matching in the future, you will" - $ECHO "have to run \"${CDDBDEXEC} -fd\"." -fi - +$ECHO "\nIf you wish to enable fuzzy matching in the future, you will" +$ECHO "have to run \"${CDDBDEXEC} -fd\"." doexit $ERROR