sysfsutils: update to latest version 2.1.0
authorHenning Heinold <heinold@inf.fu-berlin.de>
Sat, 7 Jun 2008 09:31:55 +0000 (09:31 +0000)
committerHenning Heinold <heinold@inf.fu-berlin.de>
Sat, 7 Jun 2008 09:31:55 +0000 (09:31 +0000)
* add mnt patch from debian
* reorganize packages

packages/sysfsutils/sysfsutils-2.1.0/.mtn2git_empty [new file with mode: 0644]
packages/sysfsutils/sysfsutils-2.1.0/get_mnt_path_check.patch [new file with mode: 0644]
packages/sysfsutils/sysfsutils_2.1.0.bb [new file with mode: 0644]

diff --git a/packages/sysfsutils/sysfsutils-2.1.0/.mtn2git_empty b/packages/sysfsutils/sysfsutils-2.1.0/.mtn2git_empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/sysfsutils/sysfsutils-2.1.0/get_mnt_path_check.patch b/packages/sysfsutils/sysfsutils-2.1.0/get_mnt_path_check.patch
new file mode 100644 (file)
index 0000000..47f6caf
--- /dev/null
@@ -0,0 +1,56 @@
+diff -ruN sysfsutils-2.0.0-old/lib/sysfs_utils.c sysfsutils-2.0.0/lib/sysfs_utils.c
+--- sysfsutils-2.0.0-old/lib/sysfs_utils.c     2005-12-07 12:28:18.000000000 +0100
++++ sysfsutils-2.0.0/lib/sysfs_utils.c 2006-03-06 19:06:11.000000000 +0100
+@@ -22,6 +22,7 @@
+  */
+ #include "libsysfs.h"
+ #include "sysfs.h"
++#include <mntent.h>
+ /**
+  * sysfs_remove_trailing_slash: Removes any trailing '/' in the given path
+@@ -53,6 +54,9 @@
+ {
+       static char sysfs_path[SYSFS_PATH_MAX] = "";
+       const char *sysfs_path_env;
++      FILE *mnt;
++      struct mntent *mntent;
++      int ret;
+       if (len == 0 || mnt_path == NULL)
+               return -1;
+@@ -64,12 +68,31 @@
+               if (sysfs_path_env != NULL) {
+                       safestrcpymax(mnt_path, sysfs_path_env, len);
+                       sysfs_remove_trailing_slash(mnt_path);
+-                      return 0;
++              } else {
++                      safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
+               }
+-              safestrcpymax(mnt_path, SYSFS_MNT_PATH, len);
+       }
+-      return 0;
++      /* check that mount point is indeed mounted */
++      ret = -1;
++      if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) {
++              dprintf("Error getting mount information\n");
++              return -1;
++      }
++      while ((mntent = getmntent(mnt)) != NULL) {
++              if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 &&
++                      strcmp(mntent->mnt_dir, mnt_path) == 0) {
++                      ret = 0;
++                      break;
++              }
++      }
++      
++      endmntent(mnt);
++
++      if (ret < 0)
++              errno = ENOENT;
++
++      return ret;
+ }
+ /**
diff --git a/packages/sysfsutils/sysfsutils_2.1.0.bb b/packages/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644 (file)
index 0000000..52c7779
--- /dev/null
@@ -0,0 +1,30 @@
+DESCRIPTION = "System Utilities Based on Sysfs"
+HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
+LICENSE = "GPLv2"
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
+          file://get_mnt_path_check.patch;patch=1"
+
+S = "${WORKDIR}/sysfsutils-${PV}"
+
+inherit autotools
+
+includedir += "/sysfs"
+
+do_stage () {
+       oe_libinstall -a -so -C lib libsysfs ${STAGING_LIBDIR}
+       install -d ${STAGING_INCDIR}/sysfs
+       install -m 0644 ${S}/include/dlist.h ${STAGING_INCDIR}/sysfs
+       install -m 0644 ${S}/include/libsysfs.h ${STAGING_INCDIR}/sysfs
+}
+
+PACKAGES = "libsysfs libsysfs-dbg libsysfs-dev \
+           ${PN} ${PN}-dbg ${PN}-doc ${PN}-locale"
+
+FILES_libsysfs = "${libdir}/*.so.*"
+FILES_libsysfs-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la \
+                    ${libdir}/*.a ${libdir}/*.o "
+FILES_libsysfs-dbg += "${libdir}/.debug"
+FILES_${PN}-dbg += "${bindir}/.debug"
+