]> git.pld-linux.org Git - packages/python-tdbus.git/commitdiff
new package
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 21 Feb 2014 14:35:47 +0000 (15:35 +0100)
committerJacek Konieczny <j.konieczny@eggsoft.pl>
Fri, 21 Feb 2014 14:35:47 +0000 (15:35 +0100)
python-tdbus-cflags.patch [new file with mode: 0644]
python-tdbus-format_string.patch [new file with mode: 0644]
python-tdbus.spec [new file with mode: 0644]

diff --git a/python-tdbus-cflags.patch b/python-tdbus-cflags.patch
new file mode 100644 (file)
index 0000000..d8e5c1e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -dur python-tdbus-0.8.orig/setup.py python-tdbus-0.8/setup.py
+--- python-tdbus-0.8.orig/setup.py     2013-06-13 11:26:53.000000000 +0200
++++ python-tdbus-0.8/setup.py  2014-02-21 15:12:22.000000000 +0100
+@@ -31,7 +31,7 @@
+ def pkgconfig(*args):
+     """Run pkg-config."""
+     output = subprocess.check_output(['pkg-config'] + list(args))
+-    return output.strip().split() + ['-O0']
++    return output.strip().split()
+ setup(
diff --git a/python-tdbus-format_string.patch b/python-tdbus-format_string.patch
new file mode 100644 (file)
index 0000000..5abbbd4
--- /dev/null
@@ -0,0 +1,12 @@
+diff -dur python-tdbus-0.8.orig/lib/tdbus/_tdbus.c python-tdbus-0.8/lib/tdbus/_tdbus.c
+--- python-tdbus-0.8.orig/lib/tdbus/_tdbus.c   2013-06-11 22:58:46.000000000 +0200
++++ python-tdbus-0.8/lib/tdbus/_tdbus.c        2014-02-21 15:14:57.000000000 +0100
+@@ -34,7 +34,7 @@
+ #define RETURN_DBUS_ERROR(err) \
+     do { \
+-        if (dbus_error_is_set(&err)) RETURN_ERROR(err.message); \
++        if (dbus_error_is_set(&err)) RETURN_ERROR("%s", err.message); \
+         else RETURN_ERROR("unknown error"); \
+     } while (0)
diff --git a/python-tdbus.spec b/python-tdbus.spec
new file mode 100644 (file)
index 0000000..2e4d9a1
--- /dev/null
@@ -0,0 +1,157 @@
+
+# Conditional build:
+%bcond_without tests   # do not perform "make test"
+%bcond_without python2 # CPython 2.x module
+%bcond_with    python3 # CPython 3.x module (not compatible yet)
+
+%define        module  tdbus
+Summary:       Simple ("trivial") Python bindings for D-BUS
+Name:          python-%{module}
+Version:       0.8
+Release:       0.1
+License:       MIT
+Group:         Libraries/Python
+Source0:       https://pypi.python.org/packages/source/p/python-tdbus/%{name}-%{version}.tar.gz
+# Source0-md5: 3e6f25707540a2d65e32f7be961d19a9
+Patch0:                %{name}-cflags.patch
+Patch1:                %{name}-format_string.patch
+URL:           https://github.com/hmvp/python-tdbus
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.219
+%if %{with python2}
+BuildRequires: python-devel
+BuildRequires: python-distribute
+%endif
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-distribute
+BuildRequires: python3-modules
+%endif
+Requires:      python-libs
+Requires:      python-modules
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Python-tdbus is a simple ("trivial") python interface for D-BUS. It
+builds directly on top of libdbus and has no other dependencies. Some
+benefits of python-tdbus with respect to the standard dbus-python [1]_
+Python bindings:
+
+ - The code is extremely simple. Python-tdbus is < 2.000 lines of code
+   (C and Python), while dbus-python contains > 15.000 lines of code.
+ - Event loop integration is not required for sending and receiving
+   signals (if you can afford to block).
+ - Includes `gevent' [2]_ event loop integration.
+ - Event loop integration can be achieved in Python code rather than in
+   C.
+ - Uses native Python types for method and signal arguments, driven by
+   a simple format string.
+ - Provides a more "correct" object model (IMHO) where there's separate
+   Dispatcher and Connection objects, instead of putting dispatching
+   functionality into the connection object.
+
+%package -n python3-%{module}
+Summary:       Simple ("trivial") Python bindings for D-BUS
+Group:         Libraries/Python
+
+%description -n python3-%{module}
+Python-tdbus is a simple ("trivial") python interface for D-BUS. It
+builds directly on top of libdbus and has no other dependencies. Some
+benefits of python-tdbus with respect to the standard dbus-python [1]_
+Python bindings:
+
+ - The code is extremely simple. Python-tdbus is < 2.000 lines of code
+   (C and Python), while dbus-python contains > 15.000 lines of code.
+ - Event loop integration is not required for sending and receiving
+   signals (if you can afford to block).
+ - Includes `gevent' [2]_ event loop integration.
+ - Event loop integration can be achieved in Python code rather than in
+   C.
+ - Uses native Python types for method and signal arguments, driven by
+   a simple format string.
+ - Provides a more "correct" object model (IMHO) where there's separate
+   Dispatcher and Connection objects, instead of putting dispatching
+   functionality into the connection object.
+
+%package apidocs
+Summary:       %{module} API documentation
+Summary(pl.UTF-8):     Dokumentacja API %{module}
+Group:         Documentation
+
+%description apidocs
+API documentation for %{module}.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API %{module}.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%if %{with python2}
+# CC/CFLAGS is only for arch packages - remove on noarch packages
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+# CC/CFLAGS is only for arch packages - remove on noarch packages
+CC="%{__cc}" \
+CFLAGS="%{rpmcflags}" \
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%{__python} setup.py \
+       build --build-base build-2 \
+       install --skip-build \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+       build --build-base build-3 \
+       install --skip-build \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README
+%dir %{py_sitedir}/%{module}
+%{py_sitedir}/%{module}/*.py[co]
+%attr(755,root,root) %{py_sitedir}/%{module}/_tdbus.so
+%dir %{py_sitedir}/%{module}/test
+%{py_sitedir}/%{module}/test/*.py*
+%if "%{py_ver}" > "2.4"
+%{py_sitedir}/*.egg-info
+%endif
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README
+%dir %{py_sitedir}/%{module}
+%{py_sitedir}/%{module}/__pycache__
+%{py_sitedir}/%{module}/*.py
+%attr(755,root,root) %{py_sitedir}/%{module}/_tdbus.so
+%dir %{py_sitedir}/%{module}/test
+%{py_sitedir}/%{module}/test/*.py
+%{py_sitedir}/%{module}/test/__pycache__
+%{py3_sitedir}/*.egg-info
+%endif
This page took 0.12225 seconds and 4 git commands to generate.