]> arthur.barton.de Git - netatalk.git/commitdiff
Merge remote-tracking branch 'origin/develop' into spotlight
authorRalph Boehme <sloowfranklin@gmail.com>
Tue, 2 Apr 2013 16:13:43 +0000 (18:13 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 2 Apr 2013 16:13:43 +0000 (18:13 +0200)
Conflicts:
VERSION

1  2 
bin/ad/ad_util.c
libatalk/Makefile.am
macros/netatalk.m4
macros/summary.m4

diff --combined bin/ad/ad_util.c
index 135bf7abdc83b1be94e8b419f3de6e0cf46fa00c,fbe85235c2af51201ec331e5e0ea67d27ed93f86..a168eed8a201f16413eaa3637431e2cea05d9d8a
@@@ -138,9 -138,11 +138,11 @@@ int openvol(AFPObj *obj, const char *pa
  
  void closevol(afpvol_t *vol)
  {
-     if (vol->vol->v_cdb) {
-         cnid_close(vol->vol->v_cdb);
-         vol->vol->v_cdb = NULL;
+     if (vol->vol) {
+         if (vol->vol->v_cdb) {
+             cnid_close(vol->vol->v_cdb);
+             vol->vol->v_cdb = NULL;
+         }
      }
      memset(vol, 0, sizeof(afpvol_t));
  }
@@@ -231,6 -233,73 +233,6 @@@ int convert_dots_encoding(const afpvol_
      return 0;
  }
  
 -/*!
 - * ResolvesCNID of a given paths
 - *
 - * path might be:
 - * (a) relative:
 - *     "dir/subdir" with cwd: "/afp_volume/topdir"
 - * (b) absolute:
 - *     "/afp_volume/dir/subdir"
 - *
 - * path MUST be pointing inside vol, this is usually the case as vol has been build from
 - * path using loadvolinfo and friends.
 - *
 - * @param vol  (r) pointer to afpvol_t
 - * @param path (r) path, see above
 - * @param did  (rw) parent CNID of returned CNID
 - *
 - * @returns CNID of path
 - */
 -cnid_t cnid_for_path(const afpvol_t *vol,
 -                     const char *path,
 -                     cnid_t *did)
 -{
 -    EC_INIT;
 -
 -    cnid_t cnid;
 -    bstring rpath = NULL;
 -    bstring statpath = NULL;
 -    struct bstrList *l = NULL;
 -    struct stat st;
 -
 -    cnid = htonl(2);
 -
 -    EC_NULL(rpath = rel_path_in_vol(path, vol->vol->v_path));
 -    EC_NULL(statpath = bfromcstr(vol->vol->v_path));
 -    EC_ZERO(bcatcstr(statpath, "/"));
 -
 -    l = bsplit(rpath, '/');
 -    for (int i = 0; i < l->qty ; i++) {
 -        *did = cnid;
 -
 -        EC_ZERO(bconcat(statpath, l->entry[i]));
 -        EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st),
 -                       "lstat(rpath: %s, elem: %s): %s: %s",
 -                       cfrombstr(rpath), cfrombstr(l->entry[i]),
 -                       cfrombstr(statpath), strerror(errno));
 -
 -        if ((cnid = cnid_add(vol->vol->v_cdb,
 -                             &st,
 -                             *did,
 -                             cfrombstr(l->entry[i]),
 -                             blength(l->entry[i]),
 -                             0)) == CNID_INVALID) {
 -            EC_FAIL;
 -        }
 -        EC_ZERO(bcatcstr(statpath, "/"));
 -    }
 -
 -EC_CLEANUP:
 -    bdestroy(rpath);
 -    bstrListDestroy(l);
 -    bdestroy(statpath);
 -    if (ret != 0)
 -        return CNID_INVALID;
 -
 -    return cnid;
 -}
 -
  /*!
   * Resolves CNID of a given paths parent directory
   *
diff --combined libatalk/Makefile.am
index 4ad799bf7ba38164462b2f4a9bec31e82e84525c,00712ddaa0b3c6214169a964e2321e2d36b95c86..8254e57959f94c3afbcaddc49948ea21d5056757
@@@ -18,7 -18,7 +18,7 @@@
  #        current+1:0:0
  #
  
- VERSION_INFO = 3:0:0
+ VERSION_INFO = 4:0:0
  
  # History:          VERSION_INFO
  #
@@@ -30,8 -30,9 +30,9 @@@
  #   3.0             1:0:0
  #   3.0.1           2:0:0
  #   3.0.2           3:0:0
+ #   3.0.3           4:0:0
  
 -SUBDIRS = acl adouble bstring compat cnid dsi iniparser tdb util unicode vfs
 +SUBDIRS = acl adouble bstring compat cnid dsi iniparser talloc tdb util unicode vfs
  
  lib_LTLIBRARIES = libatalk.la
  
@@@ -49,7 -50,6 +50,7 @@@ libatalk_la_LIBADD  = 
        compat/libcompat.la     \
        dsi/libdsi.la           \
        iniparser/libiniparser.la \
 +      talloc/libtalloc.la       \
        tdb/libtdb.la       \
        unicode/libunicode.la \
        util/libutil.la         \
@@@ -62,7 -62,6 +63,7 @@@ libatalk_la_DEPENDENCIES = 
        cnid/libcnid.la \
        compat/libcompat.la     \
        dsi/libdsi.la           \
 +      talloc/libtalloc.la       \
        iniparser/libiniparser.la \
        tdb/libtdb.la       \
        unicode/libunicode.la \
@@@ -96,4 -95,5 +97,5 @@@ EXTRA_DIST = 
        libatalk-3.0beta2.abi \
        libatalk-3.0.abi \
        libatalk-3.0.1.abi \
-       libatalk-3.0.2.abi
+       libatalk-3.0.2.abi \
+       libatalk-3.0.3.abi
diff --combined macros/netatalk.m4
index 5e04b518eeba8af17747335a58d84015d5595231,beceeef9ffcd01e113c12896dd68dc88952bf64a..f5e48b8bbed810a658d3f1f343c5c217ab6c42b2
@@@ -83,63 -83,6 +83,63 @@@ AC_DEFUN([AC_DEVELOPER], 
      AM_CONDITIONAL(DEVELOPER, test x"$enable_dev" = x"yes")
  ])
  
 +dnl Tracker, for Spotlight
 +AC_DEFUN([AC_NETATALK_SPOTLIGHT], [
 +    ac_cv_have_tracker=no
 +    dnl Tracker SPARQL
 +    ac_cv_tracker_pkg_default=tracker-sparql-0.12
 +    AC_ARG_WITH([tracker-pkg-config],
 +      [AS_HELP_STRING([--with-tracker-pkg-config],[name of the Tracker SPARQL pkg in pkg-config])],
 +      [ac_cv_tracker_pkg=$withval],
 +      [ac_cv_tracker_pkg=$ac_cv_tracker_pkg_default])
 +
 +    PKG_CHECK_MODULES([TRACKER], [$ac_cv_tracker_pkg >= 0.12], [ac_cv_have_tracker_sparql=yes], [ac_cv_have_tracker_sparql=no])
 +
 +    if test x"$ac_cv_have_tracker_sparql" = x"no" ; then
 +        if test x"$need_tracker" = x"yes" ; then
 +            AC_MSG_ERROR([$ac_cv_tracker_pkg not found])
 +        fi
 +    else
 +        AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
 +        AC_DEFINE(HAVE_TRACKER_SPARQL, 1, [Define if Tracker SPARQL is available])
 +        ac_cv_tracker_prefix=`pkg-config --variable=prefix $ac_cv_tracker_pkg`
 +        AC_DEFINE_UNQUOTED(TRACKER_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
 +      fi
 +
 +    ac_cv_tracker_miner_pkg_default=tracker-miner-0.12
 +    AC_ARG_WITH([tracker-miner-pkg-config],
 +      [AS_HELP_STRING([--with-tracker-miner-pkg-config],[name of the Tracker miner pkg in pkg-config])],
 +      [ac_cv_tracker_miner_pkg=$withval],
 +      [ac_cv_tracker_miner_pkg=$ac_cv_tracker_miner_pkg_default])
 +
 +    PKG_CHECK_MODULES([TRACKER_MINER], [$ac_cv_tracker_miner_pkg >= 0.12], [ac_cv_have_tracker_miner=yes], [ac_cv_have_tracker_miner=no])
 +
 +    if test x"$ac_cv_have_tracker_miner" = x"yes" ; then
 +        AC_DEFINE(HAVE_TRACKER_MINER, 1, [Define if Tracker miner library is available])
 +        AC_SUBST(TRACKER_MINER_CFLAGS)
 +        AC_SUBST(TRACKER_MINER_LIBS)
 +      fi
 +
 +    dnl Test for Tracker 0.6 on Solaris and derived platforms
 +    if test x"$this_os" = x"solaris" ; then
 +        PKG_CHECK_MODULES([TRACKER], [tracker >= 0.6], [ac_cv_have_tracker_rdf=yes], [ac_cv_have_tracker_rdf=no])
 +        if test x"$ac_cv_have_tracker_rdf" = x"yes" ; then
 +            AC_DEFINE(HAVE_TRACKER, 1, [Define if Tracker is available])
 +            AC_DEFINE(HAVE_TRACKER_RDF, 1, [Define if Tracker 0.6 with support for RDF queries is available])
 +            ac_cv_tracker_prefix=`pkg-config --variable=prefix tracker`
 +            AC_DEFINE_UNQUOTED(TRACKER_RDF_PREFIX, ["$ac_cv_tracker_prefix"], [Path to Tracker])
 +          fi
 +    fi
 +
 +    if test x"$ac_cv_have_tracker_sparql" = x"yes" -o x"$ac_cv_have_tracker_rdf" = x"yes" ; then
 +       ac_cv_have_tracker=yes
 +    fi
 +    AC_SUBST(TRACKER_CFLAGS)
 +    AC_SUBST(TRACKER_LIBS)
 +    AM_CONDITIONAL(HAVE_TRACKER_SPARQL, [test x"$ac_cv_have_tracker_sparql" = x"yes"])
 +    AM_CONDITIONAL(HAVE_TRACKER_RDF, [test x"$ac_cv_have_tracker_rdf" = x"yes"])
 +])
 +
  dnl Whether to disable bundled libevent
  AC_DEFUN([AC_NETATALK_LIBEVENT], [
      AC_MSG_CHECKING([whether to use bundled libevent])
          AC_MSG_ERROR([--with-libevent requires a path])
      fi
      AC_MSG_RESULT([$use_bundled_libevent])
-     AC_CONFIG_SUBDIRS([libevent])
+     if test x"$use_bundled_libevent" = x"yes" ; then
+         AC_CONFIG_SUBDIRS([libevent])
+     fi
      AC_SUBST(LIBEVENT_CFLAGS)
      AC_SUBST(LIBEVENT_LDFLAGS)
      AM_CONDITIONAL(USE_BUILTIN_LIBEVENT, test x"$use_bundled_libevent" = x"yes")
@@@ -410,7 -355,7 +412,7 @@@ AC_ARG_ENABLE(shell-check
  )
  ])
  
- dnl Check for optional sysv initscript install
+ dnl Check for optional initscript install
  AC_DEFUN([AC_NETATALK_INIT_STYLE], [
      AC_ARG_WITH(init-style,
                  [  --with-init-style       use OS specific init config [[redhat-sysv|redhat-systemd|suse-sysv|suse-systemd|gentoo|netbsd|debian|solaris|systemd]]],
          ;;
      "redhat-sysv")
            AC_MSG_RESULT([enabling redhat-style sysv initscript support])
+           ac_cv_init_dir="/etc/rc.d/init.d"
            ;;
      "redhat-systemd")
            AC_MSG_RESULT([enabling redhat-style systemd support])
+           ac_cv_init_dir="/lib/systemd/system"
            ;;
      "suse")
            AC_MSG_ERROR([--with-init-style=suse is obsoleted. Use suse-sysv or suse-systemd.])
          ;;
      "suse-sysv")
            AC_MSG_RESULT([enabling suse-style sysv initscript support])
+           ac_cv_init_dir="/etc/init.d"
            ;;
      "suse-systemd")
            AC_MSG_RESULT([enabling suse-style systemd support (>=openSUSE12.1)])
+           ac_cv_init_dir="/lib/systemd/system"
            ;;
      "gentoo")
            AC_MSG_RESULT([enabling gentoo-style initscript support])
+           ac_cv_init_dir="/etc/init.d"
          ;;
      "netbsd")
            AC_MSG_RESULT([enabling netbsd-style initscript support])
+           ac_cv_init_dir="/etc/rc.d"
          ;;
      "debian")
            AC_MSG_RESULT([enabling debian-style initscript support])
+           ac_cv_init_dir="/etc/init.d"
          ;;
      "solaris")
            AC_MSG_RESULT([enabling solaris-style SMF support])
+           ac_cv_init_dir="/lib/svc/manifest/network/"
          ;;
      "systemd")
            AC_MSG_RESULT([enabling general systemd support])
+           ac_cv_init_dir="/lib/systemd/system"
          ;;
      "none")
            AC_MSG_RESULT([disabling init-style support])
+           ac_cv_init_dir="none"
          ;;
      *)
            AC_MSG_ERROR([illegal init-style])
      AM_CONDITIONAL(USE_SYSTEMD, test x$init_style = xsystemd || test x$init_style = xredhat-systemd || test x$init_style = xsuse-systemd)
      AM_CONDITIONAL(USE_UNDEF, test x$init_style = xnone)
  
+     AC_ARG_WITH(init-dir,
+                 [  --with-init-dir=PATH    path to OS specific init directory],
+                 ac_cv_init_dir="$withval", ac_cv_init_dir="$ac_cv_init_dir"
+     )
+     INIT_DIR="$ac_cv_init_dir"
+     AC_SUBST(INIT_DIR, ["$ac_cv_init_dir"])
  ])
  
  dnl OS specific configuration
diff --combined macros/summary.m4
index b5093a04b5bd3f80438eb63016df312e43a4ae4a,b8db25798fe2d2b98f02553f7cdca0a9b0411b89..71049c73c678cfc6e758c668ebd1598cea7ed545
@@@ -12,7 -12,6 +12,7 @@@ AC_DEFUN([AC_NETATALK_CONFIG_SUMMARY], 
        AC_MSG_RESULT([    AFP:])
        AC_MSG_RESULT([         Extended Attributes: $neta_cv_eas])
        AC_MSG_RESULT([         ACL support: $with_acl_support])
 +      AC_MSG_RESULT([         Spotlight: $ac_cv_have_tracker])
        AC_MSG_RESULT([    CNID:])
        AC_MSG_RESULT([         backends: $compiled_backends])
        AC_MSG_RESULT([    UAMS:])
@@@ -58,6 -57,9 +58,9 @@@ dnl   AC_MSG_RESULT([         Samba share
        AC_MSG_RESULT([         dtrace probes:           $WDTRACE])
        AC_MSG_RESULT([    Paths:])
        AC_MSG_RESULT([         Netatalk lockfile:       $ac_cv_netatalk_lock])
+       if test "x$init_style" != x"none"; then
+               AC_MSG_RESULT([         init directory:          $ac_cv_init_dir])
+       fi
        if test x"$atalk_cv_with_dbus" = x"yes"; then
                AC_MSG_RESULT([         dbus system directory:   $ac_cv_dbus_sysdir])
        fi