Commit b4ce0eff authored by tdb's avatar tdb
Browse files

- Add devel/libstatgrab0 (copied from devel/libstatgrab)

- Switch bindings to use devel/libstatgrab0 instead of devel/libstatgrab
- Fix devel/pecl-statgrab to work with current PHP versions

I have an update ready for devel/libstatgrab (version 0.90) that
brings a number of API changes that are incompatible with the current
version. These bindings haven't yet been updated upstream to support
the new API, so instead of holding off indefinitely I've created the
devel/libstatgrab0 port to provide just the library and header file
for the older API version so that these bindings can continue to be
used when the main port is updated. Once these bindings are updated
the libstatgrab0 port can be removed.

Both devel/libstatgrab and devel/libstatgrab0 can be installed at the
same time.

The other ports that depend on devel/libstatgrab will be updated to
use the new API.
parent f4ae464f
......@@ -1115,6 +1115,7 @@
SUBDIR += libsoup-reference
SUBDIR += libspark2012
SUBDIR += libstatgrab
SUBDIR += libstatgrab0
SUBDIR += libstrfunc
SUBDIR += libstroke
SUBDIR += libsysinfo
......
# Created by: Tim Bishop <tdb@FreeBSD.org>
# $FreeBSD$
PORTNAME= libstatgrab
PORTVERSION= 0.17
CATEGORIES= devel
MASTER_SITES= http://ftp.uk.i-scream.org/pub/i-scream/libstatgrab/ \
http://dl.ambiweb.de/mirrors/ftp.i-scream.org/libstatgrab/ \
http://ftp.i-scream.org/pub/i-scream/libstatgrab/
PKGNAMESUFFIX= 0
MAINTAINER= tdb@FreeBSD.org
COMMENT= Provides a useful interface to system statistics
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
USES= pathfix pkgconfig libtool
CONFIGURE_ARGS= --disable-examples \
--disable-manpages \
--disable-saidar \
--disable-statgrab \
--disable-deprecated
post-configure:
${CP} ${WRKSRC}/libstatgrab.pc ${WRKSRC}/libstatgrab0.pc
post-install:
${MV} ${STAGEDIR}${PREFIX}/include/statgrab.h ${STAGEDIR}${PREFIX}/include/statgrab0.h
.include <bsd.port.mk>
SHA256 (libstatgrab-0.17.tar.gz) = bbaa88c6bde8bd3cf2720b81a26528cc055a7e83e4ea3bdb1d0a3c4287cceb88
SIZE (libstatgrab-0.17.tar.gz) = 463224
--- ./Makefile.in.orig 2014-05-10 02:04:00.303023097 +0100
+++ ./Makefile.in 2014-05-10 02:04:11.271021227 +0100
@@ -204,7 +204,7 @@
SUBDIRS = src docs examples
EXTRA_DIST = libstatgrab.pc.in PLATFORMS COPYING COPYING.LGPL
pkgconfigdir = $(prefix)/libdata/pkgconfig
-pkgconfig_DATA = libstatgrab.pc
+pkgconfig_DATA = libstatgrab0.pc
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
--- ./configure.orig 2011-11-11 14:14:46.000000000 +0000
+++ ./configure 2011-11-11 14:17:28.000000000 +0000
@@ -21740,7 +21740,7 @@
BIN_PERM="2755"
LINKFLAGS="-lkvm -ldevstat"
;;
-freebsd[5-9].*)
+freebsd[5-9].*|freebsd1[0-9].*)
cat >>confdefs.h <<\_ACEOF
#define ALLBSD
--- ./libstatgrab.pc.in.orig 2004-06-21 22:41:45.000000000 +0100
+++ ./libstatgrab.pc.in 2014-05-10 02:03:38.515022551 +0100
@@ -8,8 +8,8 @@
bin_group=@BIN_GROUP@
bin_perm=@BIN_PERM@
-Name: libstatgrab
+Name: libstatgrab0
Description: Provides a useful interface to system statistics
Version: @VERSION@
-Libs: -L${libdir} -lstatgrab @LINKFLAGS@
+Libs: -L${libdir} -lstatgrab0 @LINKFLAGS@
Cflags: -I${includedir}
--- ./src/libstatgrab/Makefile.in.orig 2014-05-10 02:03:38.484023451 +0100
+++ ./src/libstatgrab/Makefile.in 2014-05-10 02:03:38.518022821 +0100
@@ -208,7 +208,7 @@
top_srcdir = @top_srcdir@
@DEPRECATED_TRUE@include_DEPRECATEDHEADERS = statgrab_deprecated.h
include_HEADERS = statgrab.h $(include_DEPRECATEDHEADERS)
-lib_LTLIBRARIES = libstatgrab.la
+lib_LTLIBRARIES = libstatgrab0.la
libstatgrab_la_LDFLAGS = -version-info 8:3:2
@DEPRECATED_TRUE@libstatgrab_la_DEPRECATEDSOURCES = statgrab_deprecated.c
@MINGW_TRUE@libstatgrab_la_MINGWSOURCES = win32.c
@@ -274,7 +274,7 @@
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
-libstatgrab.la: $(libstatgrab_la_OBJECTS) $(libstatgrab_la_DEPENDENCIES)
+libstatgrab0.la: $(libstatgrab_la_OBJECTS) $(libstatgrab_la_DEPENDENCIES)
$(libstatgrab_la_LINK) -rpath $(libdir) $(libstatgrab_la_OBJECTS) $(libstatgrab_la_LIBADD) $(LIBS)
mostlyclean-compile:
The libstatgrab library provides an easy to use interface for
accessing system statistics and information. Available statistics
include CPU, Load, Memory, Swap, Disk I/O, and Network I/O.
Also part of the package are two tools; saidar provides a curses-based
interface to viewing live system statistics, and statgrab is a
sysctl-like interface to the statistics.
WWW: http://www.i-scream.org/libstatgrab/
include/statgrab0.h
lib/libstatgrab0.a
lib/libstatgrab0.so
lib/libstatgrab0.so.6
lib/libstatgrab0.so.6.2.3
libdata/pkgconfig/libstatgrab0.pc
......@@ -3,6 +3,7 @@
PORTNAME= statgrab
PORTVERSION= 0.6.0
PORTREVISION= 1
CATEGORIES= devel pear
MASTER_SITES= http://pecl.php.net/get/
PKGNAMEPREFIX= pecl-
......@@ -13,15 +14,10 @@ DIST_SUBDIR= PECL
MAINTAINER= tdb@FreeBSD.org
COMMENT= A PECL extension to retrieve information from libstatgrab
LIB_DEPENDS= statgrab.8:${PORTSDIR}/devel/libstatgrab
LIB_DEPENDS= libstatgrab0.so:${PORTSDIR}/devel/libstatgrab0
USE_PHP= yes
USE_PHPEXT= yes
DEFAULT_PHP_VER=53
IGNORE_WITH_PHP=5
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -ldevstat ${EXTRA_LIBS}
CONFIGURE_ARGS= --with-statgrab=${LOCALBASE}
......
--- ./config.m4.orig 2006-03-23 18:43:49.000000000 +0000
+++ ./config.m4 2014-05-10 02:12:22.943986950 +0100
@@ -5,12 +5,12 @@
[ --with-statgrab Include libstatgrab support])
AC_DEFUN([PHP_STATGRAB_CHECK_VERSION],[
- PHP_CHECK_LIBRARY(statgrab, get_network_iface_stats, [AC_DEFINE(HAVE_STATGRAB_09, 1, [ ])], [], [ -L$STATGRAB_DIR/lib $STATGRAB_SHARED_LIBADD ])
+ PHP_CHECK_LIBRARY(statgrab0, get_network_iface_stats, [AC_DEFINE(HAVE_STATGRAB_09, 1, [ ])], [], [ -L$STATGRAB_DIR/lib $STATGRAB_SHARED_LIBADD ])
])
if test "$PHP_STATGRAB" != "no"; then
SEARCH_PATH="/usr/local /usr $PHP_STATGRAB"
- SEARCH_FOR="/include/statgrab.h"
+ SEARCH_FOR="/include/statgrab0.h"
if test -r $PHP_STATGRAB/$SEARCH_FOR; then # path given as parameter
STATGRAB_DIR=$PHP_STATGRAB
else # search default path list
@@ -33,7 +33,7 @@
PHP_CHECK_LIBRARY(devstat, devstat_selectdevs, [PHP_ADD_LIBRARY(devstat,,DEVSTAT_SHARED_LIBADD)])
CFLAGS="$CFLAGS $DEVSTAT_SHARED_LIBADD"
- LIBNAME=statgrab
+ LIBNAME=statgrab0
LIBSYMBOL=sg_init
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
@@ -50,7 +50,7 @@
PHP_SUBST(STATGRAB_SHARED_LIBADD)
AC_TRY_COMPILE([
-#include <statgrab.h>
+#include <statgrab0.h>
], [
sg_network_iface_stats p;
p.dup = SG_IFACE_DUPLEX_UNKNOWN;
--- ./statgrab.c.orig 2006-11-07 22:14:38.000000000 +0000
+++ ./statgrab.c 2014-05-10 02:12:48.502985234 +0100
@@ -22,7 +22,7 @@
#include "config.h"
#endif
-#include <statgrab.h>
+#include <statgrab0.h>
#include "php.h"
#include "php_ini.h"
@@ -69,7 +69,7 @@
*
* Every user visible function must have an entry in statgrab_functions[].
*/
-function_entry statgrab_functions[] = {
+zend_function_entry statgrab_functions[] = {
PHP_FE(sg_cpu_percent_usage, NULL)
PHP_FE(sg_cpu_totals, NULL)
PHP_FE(sg_cpu_diff, NULL)
......@@ -4,9 +4,7 @@
PORTNAME= statgrab
PORTVERSION= 0.5
CATEGORIES= devel python
MASTER_SITES= ftp://ftp.uk.i-scream.org/pub/i-scream/%SUBDIR%/ \
http://ftp.uk.i-scream.org/pub/i-scream/%SUBDIR%/ \
ftp://ftp.i-scream.org/pub/i-scream/%SUBDIR%/ \
MASTER_SITES= http://ftp.uk.i-scream.org/pub/i-scream/%SUBDIR%/ \
http://ftp.i-scream.org/pub/i-scream/%SUBDIR%/
MASTER_SITE_SUBDIR= py${PORTNAME}
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
......@@ -15,9 +13,8 @@ DISTNAME= py${PORTNAME}-${PORTVERSION}
MAINTAINER= tdb@FreeBSD.org
COMMENT= Set of Python bindings for libstatgrab
LIB_DEPENDS= libstatgrab.so:${PORTSDIR}/devel/libstatgrab
LIB_DEPENDS= libstatgrab0.so:${PORTSDIR}/devel/libstatgrab0
DIST_SUBDIR= i-scream
USES= pkgconfig
USE_PYTHON= yes
USE_PYDISTUTILS= yes
......
SHA256 (i-scream/pystatgrab-0.5.tar.gz) = f6a0b4a2dca70f346b8bbbd705b8dc772dc4e8c7cde2b2b83c85eb65c4cfe1d8
SIZE (i-scream/pystatgrab-0.5.tar.gz) = 26867
SHA256 (pystatgrab-0.5.tar.gz) = f6a0b4a2dca70f346b8bbbd705b8dc772dc4e8c7cde2b2b83c85eb65c4cfe1d8
SIZE (pystatgrab-0.5.tar.gz) = 26867
--- ./_statgrab.c.orig 2014-05-10 23:16:37.500760465 +0100
+++ ./_statgrab.c 2007-07-13 23:28:28.000000000 +0100
@@ -11,7 +11,7 @@
#define __PYX_EXTERN_C extern
#endif
__PYX_EXTERN_C double pow(double, double);
-#include "statgrab.h"
+#include "statgrab0.h"
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
--- ./setup.py.orig 2014-05-10 23:15:23.105771349 +0100
+++ ./setup.py 2014-05-10 23:16:18.509761277 +0100
@@ -39,12 +39,12 @@
sys.exit("Error, could not find pkg-config.")
# test for libstatgrab presence using pkg-config
-if os.system("pkg-config --exists libstatgrab"):
- sys.exit("Error, libstatgrab is not installed (according to pkg-config).")
+if os.system("pkg-config --exists libstatgrab0"):
+ sys.exit("Error, libstatgrab0 is not installed (according to pkg-config).")
# test for libstatgrab version using pkg-config
-if os.system("pkg-config --atleast-version=%s libstatgrab" % LIBSTATGRAB):
- sys.exit("Error, need at least libstatgrab version %s." % LIBSTATGRAB)
+if os.system("pkg-config --atleast-version=%s libstatgrab0" % LIBSTATGRAB):
+ sys.exit("Error, need at least libstatgrab0 version %s." % LIBSTATGRAB)
# test for _statgrab.c, and try to generate if not found
if not os.path.exists("_statgrab.c"):
@@ -56,8 +56,8 @@
sys.exit("Error, pyrexc failed to generate _statgrab.c")
# get cflags and libs for libstatgrab
-cflags = getstatusoutput("pkg-config --cflags libstatgrab")
-libs = getstatusoutput("pkg-config --libs libstatgrab")
+cflags = getstatusoutput("pkg-config --cflags libstatgrab0")
+libs = getstatusoutput("pkg-config --libs libstatgrab0")
if cflags[0] != 0:
sys.exit("Failed to get cflags: " + cflags[1])
......@@ -3,6 +3,7 @@
PORTNAME= statgrab
PORTVERSION= 0.1
PORTREVISION= 1
CATEGORIES= devel ruby
MASTER_SITES= RF
PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX}
......@@ -11,7 +12,7 @@ DIST_SUBDIR= ruby
MAINTAINER= tdb@FreeBSD.org
COMMENT= A set of Ruby bindings for libstatgrab
LIB_DEPENDS= statgrab.8:${PORTSDIR}/devel/libstatgrab
LIB_DEPENDS= libstatgrab0.so:${PORTSDIR}/devel/libstatgrab0
USE_RUBY= yes
USE_RUBY_EXTCONF= yes
......
--- ./extconf.rb.orig 2008-06-16 20:37:28.000000000 +0100
+++ ./extconf.rb 2008-06-16 20:37:35.000000000 +0100
--- ./extconf.rb.orig 2008-04-28 01:39:02.000000000 +0100
+++ ./extconf.rb 2014-05-10 02:17:32.621965686 +0100
@@ -1,3 +1,4 @@
require 'mkmf'
+pkg_config('libstatgrab')
have_library("statgrab")
-have_library("statgrab")
+pkg_config('libstatgrab0')
+have_library("statgrab0")
create_makefile("statgrab")
--- ./statgrab.c.orig 2014-05-10 02:18:23.929963791 +0100
+++ ./statgrab.c 2014-05-10 02:18:36.289961253 +0100
@@ -15,7 +15,7 @@
*/
#include <ruby.h>
-#include <statgrab.h>
+#include <statgrab0.h>
#include <string.h>
VALUE cStatgrab;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment