aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2012-02-14 15:35:00 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2012-02-14 15:36:05 +0000
commit000da9870289d803b284c8949ff59064044e6040 (patch)
tree00664b8fbde896230ef81eef227ce019e20bc84f
parent9fcdbce27b20a9c51ce36696bc9260d3acb81493 (diff)
downloadaports-000da9870289d803b284c8949ff59064044e6040.tar.bz2
aports-000da9870289d803b284c8949ff59064044e6040.tar.xz
testing/py-ethtool: new aport
Python library for the ethtool kernel interface
-rw-r--r--testing/py-ethtool/APKBUILD44
-rw-r--r--testing/py-ethtool/python-ethtool-libnl-1.0-support.patch71
2 files changed, 115 insertions, 0 deletions
diff --git a/testing/py-ethtool/APKBUILD b/testing/py-ethtool/APKBUILD
new file mode 100644
index 0000000000..de58b1ea59
--- /dev/null
+++ b/testing/py-ethtool/APKBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=py-ethtool
+_realname=python-ethtool
+pkgver=0.7
+pkgrel=0
+pkgdesc="Python library for the ethtool kernel interface"
+url="http://www.ohloh.net/p/python-ethtool"
+arch="all"
+license="GPL"
+depends=
+depends_dev="libnl-dev pkgconfig python-dev"
+makedepends="$depends_dev"
+install=
+subpackages=
+source="http://dsommers.fedorapeople.org/python-ethtool/$_realname-$pkgver.tar.bz2
+ python-ethtool-libnl-1.0-support.patch"
+
+
+_builddir="$srcdir"/$_realname-$pkgver
+
+prepare() {
+ cd "$_builddir"
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ return 0
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install
+ # python setup.py install --root="$pkgdir"
+}
+
+md5sums="2d13e2412948344b8375f5af4ced1c20 python-ethtool-0.7.tar.bz2
+188f260534eb838193e0e8c249b6a33c python-ethtool-libnl-1.0-support.patch"
diff --git a/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch b/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
new file mode 100644
index 0000000000..43c53dba4e
--- /dev/null
+++ b/testing/py-ethtool/python-ethtool-libnl-1.0-support.patch
@@ -0,0 +1,71 @@
+diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c
+index 3d2072b..23f03c6 100644
+--- a/python-ethtool/etherinfo.c
++++ b/python-ethtool/etherinfo.c
+@@ -30,6 +30,52 @@
+ #include "etherinfo_struct.h"
+ #include "etherinfo.h"
+
++#ifdef LIBNL_1_0
++#define NLHDR_COMMON \
++ int ce_refcnt; \
++ struct nl_object_ops * ce_ops; \
++ struct nl_cache * ce_cache; \
++ struct nl_list_head ce_list; \
++ int ce_msgtype; \
++ int ce_flags; \
++ uint32_t ce_mask;
++
++struct nl_cache
++{
++ struct nl_list_head c_items;
++ int c_nitems;
++ int c_iarg1;
++ int c_iarg2;
++ struct nl_cache_ops * c_ops;
++};
++
++struct nl_object
++{
++ NLHDR_COMMON
++};
++
++void nl_cache_free(struct nl_cache *cache)
++{
++ struct nl_object *obj, *tmp;
++
++ if( !cache )
++ return;
++
++ nl_list_for_each_entry_safe(obj, tmp, &cache->c_items, ce_list) {
++ struct nl_cache *cache = obj->ce_cache;
++ if( !cache ) {
++ break;
++ }
++
++ nl_list_del(&obj->ce_list);
++ obj->ce_cache = NULL;
++ nl_object_put(obj);
++ cache->c_nitems--;
++ }
++ free(cache);
++}
++#endif
++
+ /*
+ *
+ * Internal functions for working with struct etherinfo
+diff --git a/setup.py b/setup.py
+index bde04dc..9adff64 100644
+--- a/setup.py
++++ b/setup.py
+@@ -67,7 +67,8 @@ setup(name='ethtool',
+ include_dirs = libnl['include'],
+ library_dirs = libnl['libdirs'],
+ libraries = libnl['libs'],
+- define_macros = [('VERSION', '"%s"' % version)]
++ define_macros = [('VERSION', '"%s"' % version),
++ ('LIBNL_1_0', None)]
+ )
+ ]
+ )