chiark / gitweb /
More automation of web interface installation
authorRichard Kettlewell <rjk@greenend.org.uk>
Fri, 6 Jun 2008 12:49:15 +0000 (13:49 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Fri, 6 Jun 2008 12:49:15 +0000 (13:49 +0100)
CHANGES.html
README
configure.ac
debian/rules
images/Makefile.am
scripts/setup.in
templates/Makefile.am

index 9cbcd90962c1755885065dc8fcd74935bd706950..8a39719348e2496f1ba9c33660c08407faafc4f8 100644 (file)
@@ -130,9 +130,10 @@ span.command {
   possible to use TCP to connect to an SMTP server.  See <tt>sendmail</tt> and
   <tt>smtp_server</tt> in disorder_config(5).</p>
 
   possible to use TCP to connect to an SMTP server.  See <tt>sendmail</tt> and
   <tt>smtp_server</tt> in disorder_config(5).</p>
 
-  <p>The makefiles will now install the CGI automatically.  If they cannot
-  figure out the location of the cgi-bin directory on your system, set
-  <tt>cgidir</tt> on the <tt>configure</tt> command line.</p>
+  <p>The web interface is now installed automatically.  If you don't want it,
+  use <tt>./configure --without-cgi</tt>.  If you want it in a non-default
+  location, or no location for it is detected, set <tt>cgidir</tt>
+  and <tt>httpdir</tt> on the <tt>./configure</tt> command line.</p>
   
 </div>
 
   
 </div>
 
diff --git a/README b/README
index 333b558bcbc1c9dc5dd9dfc81982b0d1f17a9afd..acd06ee5b2ee690269849eaa0194b37259be5a8c 100644 (file)
--- a/README
+++ b/README
@@ -88,10 +88,10 @@ platform, please get in touch.
      --without-gtk          Don't build GTK+ client (Disobedience)
      --without-python       Don't build Python support
 
      --without-gtk          Don't build GTK+ client (Disobedience)
      --without-python       Don't build Python support
 
-   If configure cannot figure out where your CGI programs live, you must set
-   cgidir on the command line, e.g.:
+   If configure cannot guess where your web server keeps its HTML documents and
+   CGI programs, you may have to tell it, for instance:
 
 
-     ./configure cgidir=/whatever/cgi-bin
+     ./configure cgidir=/whatever/cgi-bin httpdir=/whatever/htdocs
 
    See README.client for setting up a standalone client (or read the
    disobedience man page).
 
    See README.client for setting up a standalone client (or read the
    disobedience man page).
@@ -229,26 +229,15 @@ You need to configure a number of things to make this work:
 
      disorder setup-guest --no-online-registration
 
 
      disorder setup-guest --no-online-registration
 
-3. Make sure that DisOrder can find its icons and stylesheet.  For example in
-   your web server configuration:
-
-     Alias /disorder/ /usr/local/share/disorder/static/
-
-   Alternatively you could use a symlink from the right location in your
-   document root, provided your web server is configured to follow them.
-
-     cd /var/www
-     ln -s /usr/local/share/disorder/static disorder
-
-4. Try it out.  You should be able to perform read-only operations straight
+3. Try it out.  You should be able to perform read-only operations straight
    away, and after visiting the 'Login' page to authenticate, perform other
    operations like adding a track to the queue.
 
    away, and after visiting the 'Login' page to authenticate, perform other
    operations like adding a track to the queue.
 
-5. If you run into problems, always look at the appropriate error log; the
+4. If you run into problems, always look at the appropriate error log; the
    message you see in your web browser will usually not be sufficient to
    diagnose the problem all by itself.
 
    message you see in your web browser will usually not be sufficient to
    diagnose the problem all by itself.
 
-6. If you have a huge number of top level directories, then you might find
+5. If you have a huge number of top level directories, then you might find
    that the 'Choose' page is unreasonably large.  If so add the following line
    to /etc/disorder/options.user:
      label sidebar.choosewhich choosealpha
    that the 'Choose' page is unreasonably large.  If so add the following line
    to /etc/disorder/options.user:
      label sidebar.choosewhich choosealpha
index 3f4c0b0c8a3b53c9d7ae844a0095abf6f47ada07..f7956fda8fd609b25e128dab45e024b5d3348d88 100644 (file)
@@ -178,12 +178,61 @@ if test $want_server = no; then
   want_cgi=no
 fi
 
   want_cgi=no
 fi
 
+#
+# OS          Document Root                  CGI directory
+# ==          =============                  =============
+# Debian      /var/www                       /usr/lib/cgi-bin
+# Ubuntu      /var/www                       /usr/lib/cgi-bin
+# Red Hat     /var/www/html                  /var/www/cgi-bin
+#      or:    /home/httpd/html/              /home/httpd/cgi-bin
+# Slackware   /var/www/htdocs                (unknown)
+# SuSE        /srv/www/html                  /srv/www/cgi-bin
+# Gentoo      /var/www/localhost/htdocs      /var/www/localhost/cgi-bin/
+# FreeBSD     /usr/local/www/data            /usr/local/www/cgi-bin
+#      or:    /usr/local/www/???/data        /usr/local/www/???/cgi-bin
+# OS X        /Library/WebServer/Documents   /Library/WebServer/CGI-Executables
+# Apache      /usr/local/apache/htdocs       (none)
+#
+# Sources:
+#   http://wiki.linuxquestions.org/wiki/Apache
+#   http://mapserver.gis.umn.edu/docs/howto/suse-linux
+#   http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html
+#   http://sources.gentoo.org/viewcvs.py/apache/trunk/dist/2.2/conf/vhosts.d/default_vhost.include?rev=198&view=log
+#   http://httpd.apache.org/docs/
+#
 if test $want_cgi = yes; then
 if test $want_cgi = yes; then
+  if test -z "$httpdir"; then
+    AC_CACHE_CHECK([for httpd document root],[rjk_cv_httpdir],[
+      rjk_cv_httpdir="not found"
+      for dir in /var/www/html \
+                 /var/www/htdocs \
+                 /var/www/localhost/htdocs \
+                 /var/www \
+                 /home/httpd/html \
+                 /srv/www/html \
+                 /usr/local/www/data \
+                 /usr/local/www/*/data \
+                 /Library/WebServer/Documents \
+                 /usr/local/apache/htdocs; do
+        if test -d "$dir"; then
+          rjk_cv_httpdir="$dir"
+        fi
+      done
+    ])
+    if test "$rjk_cv_cgidir" = "not found"; then
+      AC_MSG_ERROR([cannot identify httpd documentroot.  Set httpdir on configure command line])
+    fi
+    httpdir="$rjk_cv_httpdir"
+  fi
   if test -z "$cgidir"; then
     AC_CACHE_CHECK([for CGI directory],[rjk_cv_cgidir],[
       rjk_cv_cgidir="not found"
       for dir in /usr/lib/cgi-bin \
                  /Library/WebServer/CGI-Executables \
   if test -z "$cgidir"; then
     AC_CACHE_CHECK([for CGI directory],[rjk_cv_cgidir],[
       rjk_cv_cgidir="not found"
       for dir in /usr/lib/cgi-bin \
                  /Library/WebServer/CGI-Executables \
+                 /srv/www/cgi-bin \
+                 /var/www/cgi-bin \
+                 /home/httpd/cgi-bin \
+                 /var/www/localhost/cgi-bin \
                  /usr/local/lib/cgi-bin \
                  /usr/local/www/cgi-bin \
                  /usr/local/www/*/cgi-bin; do
                  /usr/local/lib/cgi-bin \
                  /usr/local/www/cgi-bin \
                  /usr/local/www/*/cgi-bin; do
@@ -200,6 +249,11 @@ if test $want_cgi = yes; then
   fi
 fi
 AC_ARG_VAR([cgidir], [location of cgi-bin directory, e.g. /usr/lib/cgi-bin])
   fi
 fi
 AC_ARG_VAR([cgidir], [location of cgi-bin directory, e.g. /usr/lib/cgi-bin])
+AC_ARG_VAR([httpdir], [location of http document root, e.g. /var/www/htdocs])
+if test -z "$pkghttpdir"; then
+  pkghttpdir='$(httpdir)/disorder'
+fi
+AC_SUBST([pkghttpdir])
 
 subdirs="scripts lib"
 if test $want_tests = yes; then
 
 subdirs="scripts lib"
 if test $want_tests = yes; then
index 865fb6ef103f69d854430f09ecc3cdbb8fff64d3..000be812d5b9e782db6bc4641d6c3e750b85bbab 100755 (executable)
 # USA
 #
 
 # USA
 #
 
+cgidir=/usr/lib/cgi-bin
+httpdir=/var/www
+browser=x-www-browser
+
 # Options to configure.  This can be overridden by the caller if necessary.
 # Options to configure.  This can be overridden by the caller if necessary.
-CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=x-www-browser cgidir=/usr/lib/cgi-bin
+CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=$browser cgidir="${cgidir}" httpdir="${httpdir}"
 
 # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
 # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -132,13 +136,13 @@ pkg-disorder-server: build
            $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
          fi;\
        done
            $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
          fi;\
        done
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C images
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C server
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C templates
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C driver
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C plugins
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C sounds
-       $(MAKE) DESTDIR=`pwd`/debian/disorder-server staticdir=/var/www/disorder installdirs install -C doc
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C driver
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C plugins
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C sounds
+       $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C doc
        rm -rf debian/disorder-server/usr/share/man/man1
        rm -rf debian/disorder-server/usr/share/man/man3
        rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
        rm -rf debian/disorder-server/usr/share/man/man1
        rm -rf debian/disorder-server/usr/share/man/man3
        rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
index 7c77c85c4ec494520e6f89740696f884c4c90226..88145b1a083a5a020b8bb055bc7f62aa62ae5654 100644 (file)
 # USA
 #
 
 # USA
 #
 
-static_DATA=cross.png down.png downdown.png edit.png nocross.png       \
+pkghttp_DATA=cross.png down.png downdown.png edit.png nocross.png      \
 nodown.png nodowndown.png noup.png noupup.png tick.png up.png upup.png \
 notes.png play.png pause.png random.png randomcross.png notescross.png \
 propagate.png speaker.png speakercross.png directory.png logo.png      \
 logosmall.png
 
 nodown.png nodowndown.png noup.png noupup.png tick.png up.png upup.png \
 notes.png play.png pause.png random.png randomcross.png notescross.png \
 propagate.png speaker.png speakercross.png directory.png logo.png      \
 logosmall.png
 
-staticdir=${pkgdatadir}/static
-
-EXTRA_DIST=$(static_DATA) duck.png disobedience16x16.xpm disobedience32x32.xpm
+EXTRA_DIST=$(pkghttp_DATA) duck.png disobedience16x16.xpm disobedience32x32.xpm
 
 CLEANFILES=$(SEDFILES)
 
 CLEANFILES=$(SEDFILES)
index 8c8b3b070ba320df05373e3e984d577153e982ef..48f87c2c5ac3a7362a04ccca1d9ebc12d27413fb 100755 (executable)
@@ -437,34 +437,13 @@ Mac )
   launchctl load /Library/LaunchDaemons
   echo "Starting DisOrder server"
   launchctl start uk.org.greenend.rjk.disorder
   launchctl load /Library/LaunchDaemons
   echo "Starting DisOrder server"
   launchctl start uk.org.greenend.rjk.disorder
-  DOCROOT=/Library/WebServer/Documents
-  sever_running=true
+  server_running=true
   ;;
 FreeBSD )
   echo "Installing startup script into /etc/rc.d"
   install -m 555 examples/disorder.rc /etc/rc.d/disorder
   echo "Starting DisOrder server"
   /etc/rc.d/disorder start
   ;;
 FreeBSD )
   echo "Installing startup script into /etc/rc.d"
   install -m 555 examples/disorder.rc /etc/rc.d/disorder
   echo "Starting DisOrder server"
   /etc/rc.d/disorder start
-  echo "Identifying web server"
-  set /usr/local/www/*
-  case $# in
-  0 )
-    echo
-    echo "Could not find a web server"
-    exit 1
-    ;;
-  1 )
-    ;;
-  * )
-    echo
-    echo "Yikes!  There seems to be more than one web server here."
-    echo "Guessing that you want $1."
-    echo
-    ;;
-  esac
-  web=$1
-  echo "Found $web"
-  DOCROOT=$web/data
   server_running=true
   ;;
 Linux )
   server_running=true
   ;;
 Linux )
@@ -494,13 +473,6 @@ Linux )
     echo "Starting DisOrder server"
     $RC_D/init.d/disorder start
   fi
     echo "Starting DisOrder server"
     $RC_D/init.d/disorder start
   fi
-  echo "Looking for web server document root"
-  for d in /var/www/html /var/www; do
-    if [ -d $d ]; then
-      DOCROOT=$d
-      break
-    fi
-  done
   server_running=true
   ;;
 * )
   server_running=true
   ;;
 * )
@@ -511,15 +483,6 @@ Linux )
   ;;
 esac
 
   ;;
 esac
 
-echo
-if [ -z "$DOCROOT" ]; then
-  echo "Cannot find your web server's document root"
-else
-  echo "Setting up link to CGI's dependencies in $DOCROOT"
-  rm -f $DOCROOT/disorder
-  ln -s pkgdatadir/static $DOCROOT/disorder
-fi
-
 if $server_running; then
   first=true
   sleep 5
 if $server_running; then
   first=true
   sleep 5
index bf55c08d25ad82e9af6d4ac3fc8b56f2357a41a1..700b695ae309bef7e5cf2ee8c9e5494736270aff 100644 (file)
@@ -23,7 +23,6 @@ pkgdata_DATA=about.tmpl choose.tmpl playing.tmpl recent.tmpl          \
             new.tmpl login.tmpl macros.tmpl                            \
             options options.labels                                     \
             options.columns
             new.tmpl login.tmpl macros.tmpl                            \
             options options.labels                                     \
             options.columns
-static_DATA=disorder.css
-staticdir=${pkgdatadir}/static
+pkghttp_DATA=disorder.css
 
 
-EXTRA_DIST=${pkgdata_DATA} $(static_DATA)
+EXTRA_DIST=${pkgdata_DATA} $(pkghttp_DATA)