chiark / gitweb /
Merge the Disobedience rewrite.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 15 Jun 2008 17:25:23 +0000 (18:25 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 15 Jun 2008 17:25:23 +0000 (18:25 +0100)
13 files changed:
CHANGES.html
README
README.developers
README.upgrades
cgi/Makefile.am
configure.ac
debian/README.Debian
debian/changelog
debian/postinst.disorder-server
debian/rules
lib/trackdb.c
server/speaker-alsa.c
tests/Makefile.am

index 8a39719348e2496f1ba9c33660c08407faafc4f8..a1a0b9aa236a80660dbf904fc5619d37f6c496e3 100644 (file)
@@ -57,7 +57,25 @@ span.command {
 
 <p>This file documents recent user-visible changes to DisOrder.</p>
 
-<h2>Changes up to version 3.1</h2>
+<h2>Changes up to version 4.0.2</h2>
+
+<div class=section>
+
+  <p>Corrected web browser linked from Disobedience.</p>
+  
+</div>
+
+<h2>Changes up to version 4.0.1</h2>
+
+<div class=section>
+
+  <p>Libtool and Automake now install the CGI correctly.  As part of this,
+  <tt>cgidir</tt> has been renamed to <tt>cgiexecdir</tt>.  The configure
+  script will report an error if you try to use the old name.</p>
+  
+</div>
+
+<h2>Changes up to version 4.0</h2>
 
 <div class=section>
 
diff --git a/README b/README
index acd06ee5b2ee690269849eaa0194b37259be5a8c..8cd2c35ff954953429e4b5a4ded972d666c9d057 100644 (file)
--- a/README
+++ b/README
@@ -34,9 +34,9 @@ Build dependencies:
   libao            0.8.6
   libasound        1.0.13
   libFLAC          1.1.2
-  GNU C            4.1.2
-  GNU Make         3.81
-  GNU Sed          4.1.5
+  GNU C            4.1.2               }
+  GNU Make         3.81                } Non-GNU versions will NOT work
+  GNU Sed          4.1.5               }
   Python           2.4.4               (optional)
   GTK+             2.8.20              (if you want the GTK+ client)
   GLIB             2.12.4              (if you want the GTK+ client)
@@ -91,7 +91,7 @@ platform, please get in touch.
    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 httpdir=/whatever/htdocs
+     ./configure cgiexecdir=/whatever/cgi-bin httpdir=/whatever/htdocs
 
    See README.client for setting up a standalone client (or read the
    disobedience man page).
@@ -229,9 +229,13 @@ You need to configure a number of things to make this work:
 
      disorder setup-guest --no-online-registration
 
-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.
+3. Try it out.  The url will be (something like):
+
+     http://localhost/cgi-bin/disorder
+
+   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.
 
 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
index 5a5dd8908acba9035dc3aea11ccc4f3d2d9ffbd9..e1045981b5366c5096869138cedc6bdfe84cd994 100644 (file)
@@ -14,6 +14,8 @@ Dependencies:
                     libao-dev libmad0-dev libasound2-dev libdb4.3-dev \
                     libflac-dev
 
+     (Use the bzr from backports, the one in etch is obsolete.)
+
    * On FreeBSD you'll need at least these packages:
         autotools
         bash
@@ -138,10 +140,7 @@ Web Interface:
      keep it that way.  Clever use of CSS is OK provided it works well on the
      mainstream browsers.
 
-   * I know that the web template syntax is rather nasty.  Perhaps it will be
-     improved in a future version.
-
-   * Update templates/help.html for any changes you make.
+   * Update templates/help.tmpl for any changes you make.
 
 Disobedience:
 
@@ -188,12 +187,10 @@ Code And Patches:
      (But if your new feature only makes sense on a given platform then
      obviously its new dependencies don't need to be available elsewhere.)
 
-   * GCC is stated as a dependency.  In fact the code is mostly standard C,
-     with C99 initializers, long long and possibly the occasional // comment as
-     the main departures from C89.  Additional GCCisms will be accepted if it's
-     impractical to avoid them.  At least one active user is still using GCC
-     2.95, so extensions that only appear in later versions are to be avoided
-     for the time being.
+   * GCCisms such as typeof are used; the configure script asks for -std=gnu99
+     by default.  At least one active user is still using GCC 2.95, so
+     extensions that only appear in later versions are to be avoided for the
+     time being.
 
    * Please submit patches either using 'diff -u', or by publishing a bzr
      branch somewhere I can get at it.
index 63b7852e09dfb7fbc6bfd3666b6c3cbac3cb1b51..185ea4fe05af86f5bcc783d29691a749a74f0b16 100644 (file)
@@ -17,7 +17,7 @@ all 1.1.x versions.
 
 If you install from .deb files then much of this work is automated.
 
-* 3.0 -> 3.1
+* 3.0 -> 4.0
 
 If you customized any of the templates, you will pretty much have to start from
 scratch as the web interface has been rewritten.  See disorder.cgi(8) for a
index e2fa8955e7061ac90b3cec5274dea8d3d83edf9a..72ea195a8acfa55827498d2276ab9b351db6464f 100644 (file)
@@ -18,7 +18,7 @@
 # USA
 #
 
-cgi_PROGRAMS=disorder
+cgiexec_PROGRAMS=disorder
 
 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
 
@@ -28,3 +28,6 @@ disorder_LDADD=../lib/libdisorder.a \
        $(LIBPCRE) $(LIBGCRYPT) $(LIBDL) $(LIBDB)
 disorder_LDFLAGS=-export-dynamic
 disorder_DEPENDENCIES=../lib/libdisorder.a
+
+install-exec-hook:
+       $(LIBTOOL) --mode=finish $(DESTDIR)$(cgiexecdir)
index 44ca4b2683252fa622181ce6ba255f4116c38138..2522f453433301c88ceb73e4987be4963ae3dc06 100644 (file)
@@ -20,9 +20,9 @@
 # USA
 #
 
-AC_INIT([disorder], [3.0+], [richard+disorder@sfere.greenend.org.uk])
+AC_INIT([disorder], [4.0+], [richard+disorder@sfere.greenend.org.uk])
 AC_CONFIG_AUX_DIR([config.aux])
-AM_INIT_AUTOMAKE(disorder, [3.0+])
+AM_INIT_AUTOMAKE(disorder, [4.0+])
 AC_CONFIG_SRCDIR([server/disorderd.c])
 AM_CONFIG_HEADER([config.h])
 
@@ -226,14 +226,18 @@ if test $want_cgi = yes; then
         fi
       done
     ])
-    if test "$rjk_cv_cgidir" = "not found"; then
+    if test "$rjk_cv_cgiexecdir" = "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"
+  if test ! -z "$cgidir"; then
+    # This is a bit harsh but should stop any disasters
+    AC_MSG_ERROR([cgidir has been renamed to cgiexecdir])
+  fi
+  if test -z "$cgiexecdir"; then
+    AC_CACHE_CHECK([for CGI directory],[rjk_cv_cgiexecdir],[
+      rjk_cv_cgiexecdir="not found"
       for dir in /usr/lib/cgi-bin \
                  /Library/WebServer/CGI-Executables \
                  /srv/www/cgi-bin \
@@ -244,18 +248,18 @@ if test $want_cgi = yes; then
                  /usr/local/www/cgi-bin \
                  /usr/local/www/*/cgi-bin; do
         if test -d "$dir"; then
-          rjk_cv_cgidir="$dir"
+          rjk_cv_cgiexecdir="$dir"
           break
         fi
       done
     ])
-    if test "$rjk_cv_cgidir" = "not found"; then
-      AC_MSG_ERROR([cannot identify CGI install directory.  Set cgidir on configure command line])
+    if test "$rjk_cv_cgiexecdir" = "not found"; then
+      AC_MSG_ERROR([cannot identify CGI install directory.  Set cgiexecdir on configure command line])
     fi
-    cgidir="$rjk_cv_cgidir"
+    cgiexecdir="$rjk_cv_cgiexecdir"
   fi
 fi
-AC_ARG_VAR([cgidir], [location of cgi-bin directory, e.g. /usr/lib/cgi-bin])
+AC_ARG_VAR([cgiexecdir], [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'
index a670319475af4e8f9f7680f667780ada49153dc8..e7bf6f7b83007c1b1f1b11ba23e4c920fdff5f72 100644 (file)
@@ -1,8 +1,13 @@
 Debian package for DisOrder
 ===========================
 
-The web interface should now start working automatically.  Test it at
-http://YOURHOSTNAME/cgi-bin/disorder/disorder If it doesn't work,
-always look at the web server error log.
+The web interface should now start working automatically.  Test it at:
 
- -- Richard Kettlewell <rjk@greenend.org.uk>, Sat, 29 Mar 2008 16:20:20 +0000
+    http://YOURHOSTNAME/cgi-bin/disorder
+
+You will need to create yourself a user.
+
+If it doesn't work, always look at the web server error log and at
+/var/log/daemon.log.
+
+ -- Richard Kettlewell <rjk@greenend.org.uk>, Sun, 15 Jun 2008 12:15:50 +0100
index ab46f89e4258cd9d57f95da379d99594d04fb3f7..9a4bb4001c4bd9003f3880f80504224c5244bc04 100644 (file)
@@ -1,8 +1,23 @@
-disorder (3.0.99.dev) unstable; urgency=low
+disorder (4.0.2) unstable; urgency=low
 
-  * Bodge version number
+  * Correct web browser linkage from Disobedience.
 
- -- Richard Kettlewell <rjk@greenend.org.uk>  Sun, 18 May 2008 21:30:14 +0100
+ -- Richard Kettlewell <rjk@greenend.org.uk>  Sun, 15 Jun 2008 14:44:22 +0100
+
+disorder (4.0.1) unstable; urgency=low
+
+  * Version 4.0.1
+  * Update READMEs
+  * Make group modification noisier
+  * Makefile fiddling for Automake/Libtool's benefit
+
+ -- Richard Kettlewell <richard@dekabrach.anjou.terraraq.org.uk>  Sun, 15 Jun 2008 12:22:52 +0100
+
+disorder (4.0) unstable; urgency=low
+
+  * Version 4.0
+
+ -- Richard Kettlewell <rjk@greenend.org.uk>  Sun,  8 Jun 2008 14:44:05 +0100
 
 disorder (3.0) unstable; urgency=low
 
index 9e516489741f71615102798b518d192e3884b522..458cc791c996fba490bf95ae979459b379f52ab5 100755 (executable)
@@ -28,7 +28,7 @@ add_jukebox_user() {
     --no-create-home jukebox
   # If it happens that there's no audio group we don't fail; perhaps only
   # network play was required.
-  adduser --quiet jukebox audio || true
+  adduser jukebox audio || true
 }
 
 configure_init_d() {
index 000be812d5b9e782db6bc4641d6c3e750b85bbab..0c14444f4670b20317517f82eecf223848a2f589 100755 (executable)
 # USA
 #
 
-cgidir=/usr/lib/cgi-bin
+cgiexecdir=/usr/lib/cgi-bin
 httpdir=/var/www
 browser=x-www-browser
 
 # 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=$browser cgidir="${cgidir}" httpdir="${httpdir}"
+CONFIGURE=--prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --mandir=/usr/share/man --with-browser=${browser} cgiexecdir="${cgiexecdir}" httpdir="${httpdir}"
 
 # Set DEB_BUILD_OPTIONS=noopt to produce a non-optimized build.
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -149,7 +149,7 @@ pkg-disorder-server: build
        rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
        $(MKDIR) debian/disorder-server/etc/disorder
        $(MKDIR) debian/disorder-server/etc/init.d
-       $(MKDIR) debian/disorder-server/usr/lib/cgi-bin
+       $(MKDIR) debian/disorder-server${cgiexecdir}
        $(MKDIR) debian/disorder-server/var/lib/disorder
        $(INSTALL_SCRIPT) examples/disorder.init \
                debian/disorder-server/etc/init.d/disorder
@@ -160,9 +160,9 @@ pkg-disorder-server: build
        $(INSTALL_DATA) debian/etc.disorder.options.user \
                debian/disorder-server/etc/disorder/options.user
        $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
-               $(shell pwd)/debian/disorder-server/usr/lib/cgi-bin/disorder
+               $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
        dpkg-shlibdeps -Tdebian/substvars.disorder-server \
-               debian/disorder-server/usr/lib/cgi-bin/disorder \
+               debian/disorder-server${cgiexecdir}/disorder \
                debian/disorder-server/usr/sbin/* \
                debian/disorder-server/usr/lib/disorder/*.so*
        rm -rf debian/disorder-server/usr/share/doc/disorder-server
index 42871046a4a68aea6a5dfa1730615bacb6354a17..3647f1068639ea755a4e63c8a505f5798a6f594c 100644 (file)
@@ -1852,7 +1852,7 @@ static int do_list(struct vector *v, const char *dir,
   char *ptr;
   int err;
   size_t l, last_dir_len = 0;
-  char *last_dir = 0, *track, *alias;
+  char *last_dir = 0, *track;
   struct kvp *p;
 
   dl = strlen(dir);
@@ -1885,12 +1885,35 @@ static int do_list(struct vector *v, const char *dir,
         if((err = trackdb_getdata(trackdb_prefsdb,
                                   track, &p, tid)) == DB_LOCK_DEADLOCK)
           goto deadlocked;
+        /* There's an awkward question here...
+         *
+         * If a track shares a directory with its alias then we could
+         * do one of three things:
+         * - report both.  Looks ridiculuous in most UIs.
+         * - report just the alias.  Remarkably inconvenient to write
+         *   UI code for!
+         * - report just the real name.  Ugly if the UI doesn't prettify
+         *   names via the name parts.
+         */
+#if 1
+        /* If this file is an alias for a track in the same directory then we
+         * skip it */
+        struct kvp *t = kvp_urldecode(d.data, d.size);
+        const char *alias_target = kvp_get(t, "_alias_for");
+        if(!(alias_target
+             && !strcmp(d_dirname(alias_target),
+                        d_dirname(track))))
+         if(track_matches(dl, k.data, k.size, re))
+           vector_append(v, track);
+#else
        /* if this file has an alias in the same directory then we skip it */
+           char *alias;
         if((err = compute_alias(&alias, track, p, tid)))
           goto deadlocked;
         if(!(alias && !strcmp(d_dirname(alias), d_dirname(track))))
          if(track_matches(dl, k.data, k.size, re))
            vector_append(v, track);
+#endif
       }
     }
     err = cursor->c_get(cursor, &k, &d, DB_NEXT);
index 41e53b24b971eaa211ff8753399a1d2610becc77..21a9a75889e0835a312475d030d26b58a06d1b6d 100644 (file)
@@ -49,7 +49,6 @@ static void alsa_init(void) {
 static void log_params(snd_pcm_hw_params_t *hwparams,
                        snd_pcm_sw_params_t *swparams) {
   snd_pcm_uframes_t f;
-  unsigned u;
 
   return;                               /* too verbose */
   if(hwparams) {
@@ -60,14 +59,22 @@ static void log_params(snd_pcm_hw_params_t *hwparams,
     info("sw silence_size=%lu", (unsigned long)f);
     snd_pcm_sw_params_get_silence_threshold(swparams, &f);
     info("sw silence_threshold=%lu", (unsigned long)f);
-    snd_pcm_sw_params_get_sleep_min(swparams, &u);
-    info("sw sleep_min=%lu", (unsigned long)u);
+#if HAVE_SND_PCM_SW_PARAMS_GET_SLEEP_MIN
+    {
+      unsigned u;
+
+      snd_pcm_sw_params_get_sleep_min(swparams, &u);
+      info("sw sleep_min=%lu", (unsigned long)u);
+    }
+#endif
     snd_pcm_sw_params_get_start_threshold(swparams, &f);
     info("sw start_threshold=%lu", (unsigned long)f);
     snd_pcm_sw_params_get_stop_threshold(swparams, &f);
     info("sw stop_threshold=%lu", (unsigned long)f);
+#if HAVE_SND_PCM_SW_PARAMS_GET_XFER_ALIGN
     snd_pcm_sw_params_get_xfer_align(swparams, &f);
     info("sw xfer_align=%lu", (unsigned long)f);
+#endif
   }
 }
 
index 9358b196b8609e0d8ce3ce8f1c3b7aa3a0f8ff7c..e8e8507dedbc04e1a4854ea76fc2ac1a01078938 100644 (file)
@@ -22,8 +22,8 @@ noinst_PROGRAMS=disorder-udplog
 
 AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib
 
-disorder_udplog_SOURCES=udplog.c
-disorder_udplog_LDADD=$(LIBOBJS) ../lib/libdisorder.a
+disorder_udplog_SOURCES=udplog.c ../lib/memgc.c
+disorder_udplog_LDADD=$(LIBOBJS) ../lib/libdisorder.a $(LIBGC)
 disorder_udplog_DEPENDENCIES=../lib/libdisorder.a
 
 TESTS=cookie.py dbversion.py dump.py files.py play.py queue.py \