Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

OpenBSD FUPPES port (woes)

Help
magrin
2008-02-16
2013-04-25
  • magrin
    magrin
    2008-02-16

    Hi!

    I am trying to make fuppes-SVN-578 work on my i386 OpenBSD 4.1 system but have had limited success so far. There is a port available for an older version but I'd like to get a later one up and running. Anyway, here is what I did and what happened:

    First I had to make a few patches to make it compile (it would be nice to have these included in the fuppes source by the way):

    $OpenBSD$
    --- src/console_main.cpp.orig   Fri Dec 14 19:43:06 2007
    +++ src/console_main.cpp        Sun Feb  3 21:30:41 2008
    @@ -33,6 +33,7 @@
    #ifndef WIN32
    #include <signal.h>
    #include <termios.h>
    +#include <unistd.h>
    #endif

    using namespace std;
    $OpenBSD$
    --- src/daemon_main.cpp.orig    Fri Dec 14 19:43:06 2007
    +++ src/daemon_main.cpp Sun Feb  3 21:54:43 2008
    @@ -33,6 +33,10 @@
    #include <termios.h>
    //#include <fcntl.h>

    +#ifndef WIN32
    +#include <unistd.h>
    +#endif
    +
    using namespace std;

    bool g_bExitApp;
    $OpenBSD$
    --- src/lib/Common/Common.h.orig        Tue Nov 20 01:17:08 2007
    +++ src/lib/Common/Common.h     Sun Feb  3 19:24:10 2008
    @@ -51,6 +51,8 @@
    #include <Ws2tcpip.h>
    #include <shlwapi.h>

    +#else
    +#include <pthread.h>
    #endif

    class EException: public std::exception
    $OpenBSD$
    --- src/lib/HTTP/HTTPMessage.cpp.orig   Sun Feb  3 19:50:52 2008
    +++ src/lib/HTTP/HTTPMessage.cpp        Sun Feb  3 19:45:27 2008
    @@ -778,7 +778,7 @@ bool CHTTPMessage::ParsePOSTMessage(std:
       if(rxContentLength.Search(p_sMessage.c_str()))
       {
         string sContentLength = rxContentLength.Match(1);
    -    m_nContentLength = std::atoll(sContentLength.c_str());
    +    m_nContentLength = atoll(sContentLength.c_str());
       }

       if((unsigned int)m_nContentLength >= p_sMessage.length())                   
    $OpenBSD$
    --- src/lib/HTTP/HTTPServer.cpp.orig    Fri Dec 14 19:43:06 2007
    +++ src/lib/HTTP/HTTPServer.cpp Sun Feb  3 21:14:58 2008
    @@ -53,7 +53,9 @@
    // SO_NOSIGPIPE is a setsockopt() option
    // and not a send() parameter as MSG_NOSIGNAL
    #ifndef MSG_NOSIGNAL
    +#ifndef __OpenBSD__
    #define USE_SO_NOSIGPIPE
    +#endif
    #define MSG_NOSIGNAL 0
    #endif

    The last (USE_SO_NOSIGPIPE)) "fix" is highly dubious and I think that it ay be the source of many of my problems. I also suspect that it could pose problems on other systems as well so maybe someone already have a solution?

    Anyway, everything compiles nicely after patching this and I get a minimal system up and running (no optional libs included) but when I start fuppes (or fuppesd) it hangs on the call to
    pSession->Start() in CSSDPCtrl::send_msearch. If I try to connect to the webinterface when this happens I get an immediate core dump.

    If I remove the call to CSSDPCtrl::send_msearch the webinterface works nicely and I can browse the shared directories using my PS3. Viewing photos works quite well like browsing for music but if I try to play a mp3-file fuppes immediately exits without any core dump or log output.

    Fuppes seem to be a very nice program and I would very much like to be able to use it. However, I cannot seem to get autoreconf to work on my system so I cannot use SVN checkouts. Could I be so bold as to ask for a new .tar.gz release containing a configure script to check if a newer version works better?

    Here is the autoconf output:

    $ autoreconf-2.61 -vfi
    autoreconf-2.61: Entering directory `.'
    autoreconf-2.61: configure.in: not using Gettext
    autoreconf-2.61: running: aclocal  --output=aclocal.m4t
    Provide an AUTOMAKE_VERSION environment variable, please
    autoreconf-2.61: configure.in: tracing
    autoreconf-2.61: configure.in: not using Libtool
    autoreconf-2.61: running: /usr/local/bin/autoconf-2.61 --force
    configure.in:5: error: possibly undefined macro: AM_CONFIG_HEADER
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    configure.in:6: error: possibly undefined macro: AM_INIT_AUTOMAKE
    configure.in:11: error: possibly undefined macro: AC_PROG_LIBTOOL
    configure.in:12: error: possibly undefined macro: AM_PROG_INSTALL_STRIP
    configure.in:41: error: possibly undefined macro: AM_CONDITIONAL
    configure.in:45: error: possibly undefined macro: AM_ICONV
    autoreconf-2.61: /usr/local/bin/autoconf-2.61 failed with exit status: 1

    I'd like to end with thanking the author for a very nice program with great potential.

    // Magnus

     
    • magrin
      magrin
      2008-02-18

      Here is an update on the progress made on the OpenBSD port of fuppes-SVN-578.

      I came up with the following "fix" for the SO_NOSIGPIPE issue. It seems to work on my system but I dont know if this is an acceptable fix in the long run for systems missing MSG_NOSIGNAL and SO_NOSIGPIPE. Uli?

      $OpenBSD$
      --- src/console_main.cpp.orig   Fri Dec 14 19:43:06 2007
      +++ src/console_main.cpp        Mon Feb 18 20:32:11 2008
      @@ -33,6 +33,7 @@
      #ifndef WIN32
      #include <signal.h>
      #include <termios.h>
      +#include <unistd.h>
      #endif

      using namespace std;
      @@ -123,6 +124,7 @@ int main(int argc, char* argv[])
         #ifndef WIN32
         signal(SIGINT, SignalHandler);  // ctrl-c
         signal(SIGTERM, SignalHandler); // start-stop-daemon -v --stop -nfuppes
      +  signal(SIGPIPE, SIG_IGN);
         #endif

         // initialize libfuppes
      $OpenBSD$
      --- src/daemon_main.cpp.orig    Fri Dec 14 19:43:06 2007
      +++ src/daemon_main.cpp Mon Feb 18 20:53:31 2008
      @@ -32,6 +32,7 @@
      #include <signal.h>
      #include <termios.h>
      //#include <fcntl.h>
      +#include <unistd.h>

      using namespace std;

      @@ -73,7 +74,7 @@ int main(int argc, char* argv[])
         // install signal handler
         signal(SIGINT, SignalHandler);  // ctrl-c
         signal(SIGTERM, SignalHandler); // start-stop-daemon -v --stop -nfuppes
      -
      +  signal(SIGPIPE, SIG_IGN);

         // start fuppes
         fuppes_start();
      $OpenBSD$
      --- src/lib/HTTP/HTTPServer.cpp.orig    Fri Dec 14 19:43:06 2007
      +++ src/lib/HTTP/HTTPServer.cpp Sun Feb  3 21:14:58 2008
      @@ -53,7 +53,9 @@
      // SO_NOSIGPIPE is a setsockopt() option
      // and not a send() parameter as MSG_NOSIGNAL
      #ifndef MSG_NOSIGNAL
      +#ifndef __OpenBSD__
      #define USE_SO_NOSIGPIPE
      +#endif
      #define MSG_NOSIGNAL 0
      #endif

      The only remaining issue in 578 on OpenBSD is that the call to pSession->Start() in CSSDPCtrl::send_msearch is blocking and that it never returns. I'll look into that next.

      On the issue of getting SVN checkouts to build I also made some progress. (it sometimes helps to read the documentation :-)

      I found the dependency to gettext in the wiki and it made some difference but still cant get autoreconf to work properly. The output changed a bit and is now:

      Running autoconf-2.61 in /usr/ports/myports/fuppes_trunk/w-fuppes-SVN-593/fuppes-SVN-593
      configure.in:5: error: possibly undefined macro: AM_CONFIG_HEADER
            If this token and others are legitimate, please use m4_pattern_allow.
            See the Autoconf documentation.
      configure.in:6: error: possibly undefined macro: AM_INIT_AUTOMAKE
      configure.in:11: error: possibly undefined macro: AC_PROG_LIBTOOL
      configure.in:12: error: possibly undefined macro: AM_PROG_INSTALL_STRIP
      configure.in:41: error: possibly undefined macro: AM_CONDITIONAL
      configure.in:45: error: possibly undefined macro: AM_ICONV
      *** Error code 1

      What do I have to do to make these errors go away? I would really like to be able to build newer versions!

      Thats all for now,

      // Magnus

       
    • Ulrich Völkel
      Ulrich Völkel
      2008-02-19

      Thanks for the patch! I will modify it a little so that signal() is called within the library and not by each frontend.

      The AM_ICONV macro comes with gettext. AC_PROG_LIBTOOL should be available after installing libtool. And the others should ship with automake.

      autoreconf calls "aclocal", "autoheader", "automake" and "autoconf". So you have to make sure that these apps are installed.

      - Uli