Commit a4e92806 authored by intrigeri's avatar intrigeri

Imported Upstream version 0.33.3

parents
Net::DBus - Perl APIs for DBus
==============================
Net::DBus is written by
Daniel Berrange <dan-at-berrange-dot-com>
With patches, contributions & suggestions gratefully received
from
Carlos Garnacho <carlosg-at-gnome-dot-org>
Emmanuele Bassi <ebassi-at-gmail-dot-com>
Olivier Blin <oblin-at-mandriva-dot-com>
Jack <ms419-at-freezone-dot-co-dot-uk>
[...send patches to get your name here!]
-- End
Changes since 0.33.2
- Fixed parsing of introspection data if there are processing
instructions, or other non-data nodes before the root element.
- Replace use of XML::Grove with XML::Twig when parsing the
introspection XML documents, since the former has not had any
updates / bug fixes since 1999(!), and several people have
reported problems using it on Perl 5.8.x
- Made all Perl scripts / modules / tests use 'strict' and
'warnings' pragmas
- Turn Net::DBus::Error into fully fledged object which services
can sub-class to allow explicit error handling by clients.
- In _dispatch method of Net::DBus::Object ensure that any
instances of Net::DBus::Error thrown by the method call
are explicitly serialized into DBus errors, rather than
a generic 'org.freedesktop.DBus.Failed'.
- Change re-distribution license from GPL, to GPL / Perl Artistic,
matching the terms of Perl itself.
- Add support for registering a callback on Net::DBus::ASyncReply
objects to allow notification of completion for asynchronous
method calls
Changes since 0.33.1
- Fixed handling of variants in introspection data
- Added binding for the DBusPendingCall C object
- Added some missing RPM dependancies on XML libs, and on minimum
required dbus version
- Added support for doing asynchronous method calls, and fire-and-
forgot calls for methods whose return status is not desired. Use
the constants in Net::DBus::Annotation module to indicate desired
call mode. Default is to do synchronous blocking calls.
- Added support for the 16-bit integer, signature and object path
data types
- Made introspection of root objects compliant with upsteam spec,
by calling introspect on the root object, "/", rather than a
Perl specific magic object path.
Changes since 0.32.3
- Constructor for Net::DBus::Object allows another Net::DBus::Object
to be passed instead of the Net::DBus::Service, to create child
objects specifying only a relative path.
- Updated minimum required DBus version to be 0.33 to gain access
to the unregister_object_path API
- Add a disconnect() method to Net::DBus::Object to make it possible
to unregister object from the bus & thus make it possible to destroy
objects which are no longer required / relevant.
- Unregister all child objects if we are unregistered ourselves
- Fix numerous POD errors identified by Test::Pod and podchecker
- Increase POD documentation to get 100% coverage of all APIs,
verified by Test::Pod::Coverage
Changes since 0.32.2
- Introspection data is used only as hint, so if an object
exports many methods, but only provides partial introspection
data, remote calls fallback to regular typing rules
- Re-add dbus_XXX convenience methods to Net::DBus to allow
clients to do explicit type casting. Must be requested at
export time, using 'Net::DBus qw(:typing)'.
- Update all example programs to run against session bus,
since there are no security rules to enable them to work
on system bus.
- Print out warning upon use, if a method, signal, or property
is annotated with the 'org.freedesktop.DBus.Deprecated' flag.
- Do not wait for a method reply if the method is annotated
with the 'org.freedesktop.DBus.Method.NoReply' flag.
- Extend Net::DBus::Exporter to enable methods, signals, and
properties to be annotated.
- Add support for 'org.freedesktop.DBus.Method.NoReply' and
'org.freedesktop.DBus.Deprecated' annotations when exporting
objects
- Add a pure in-memory bus implementation for facilitating
creation of unit tests which would otherwise require making
a connection to a 'live' message bus. Can be accessed via:
Net::DBus->test
- Add an *EXPERIMENTAL* mock object to faciltate creation of
unit tests which need to communicate with other objects on
the bus. See Net::DBus::Test::MockObject for further info.
Changes since 0.32.1
- Fix unit tests broken in previous build
- Added patch to avoid leaking memory when throwing dbus
errors from the XS layer
- Added support for org.freedesktop.DBus.Properties
in exported & remote objects.
- Added support for getting the unique name of the client's
connection to the bus
- Added support for getting the unique name of the client
owning a service on the bus
- RemoteService object constructor gains an extra parameter
for the owner of the service at the time it was aquired to
deal with issues where a service is replaced.
- Cache RemoteService objects to avoid creating multiple
instances for the same service name.
- Fix caching of objects by the service to avoid caching
objects cast to a specific interface
- Make add_signal_receiver method on Net::DBus private
- Use introspection data for hinting only, not absolute truth
since Python bindings don't provide complete data.
- Adding correct handling for (de)marshalling variant data
type to fix interaction with python bindings
- Added magic 'caller' and 'serial' data types for requesting
that data about method caller be passed into a method
- Lots more POD documentation
- Added 'lshal.pl' demo script for listing HAL devices
- Made example scripts interoperate correctly with example
scripts from Python & GLib bindings
Changes since 0.32.0
- The order of 'service_name' and 'bus' parameter to the
Net::DBus::Service constructor is reversed to match
that of Net::DBus::RemoteService
- The order of 'service' and 'object_path' parameter to the
Net::DBus::Object constructor is reversed to match
that of Net::DBus::RemoteObject
- No longer neccessary to construct an explicit Net::DBus::Service
object - one is constructed & returned by the 'export_service'
method on Net::DBus
- The 'find' method on Net::DBus will search for & attach to
a suitable bus, so no longer neccessary to hard code either
system or session bus
- Introspection data is no longer provided via the
Net::DBus::Object constructor. Consult the manual pages
for Net::DBus::OBject and Net::DBus::Exporter for details
of new approach to defining introspection data.
- The Net::DBus::Introspector class is no longer for public
use.
- The Net::DBus::Dumper class can be used to display a dump
of an object's exported API cf examples/dump-object.pl
- Signal handler callbacks now get the actual signal params
passed in, rather than low level bind info
- The Net::DBus objects are automatically registered with
the default reactor mainloop, unless 'nomainloop => 1'
is passed into constructor
This diff is collapsed.
This diff is collapsed.
AUTHORS
autobuild.sh
CHANGES
COPYING
DBus.xs
examples/dump-object.pl
examples/example-client-async.pl
examples/example-client-no-introspect.pl
examples/example-client.pl
examples/example-service-async.pl
examples/example-service-no-introspect.pl
examples/example-service.pl
examples/example-signal-emitter.pl
examples/example-signal-receiver.pl
examples/lshal.pl
lib/Net/DBus.pm
lib/Net/DBus/Annotation.pm
lib/Net/DBus/ASyncReply.pm
lib/Net/DBus/Binding/Bus.pm
lib/Net/DBus/Binding/Connection.pm
lib/Net/DBus/Binding/Introspector.pm
lib/Net/DBus/Binding/Iterator.pm
lib/Net/DBus/Binding/Message.pm
lib/Net/DBus/Binding/Message/Error.pm
lib/Net/DBus/Binding/Message/MethodCall.pm
lib/Net/DBus/Binding/Message/MethodReturn.pm
lib/Net/DBus/Binding/Message/Signal.pm
lib/Net/DBus/Binding/PendingCall.pm
lib/Net/DBus/Binding/Server.pm
lib/Net/DBus/Binding/Value.pm
lib/Net/DBus/Binding/Watch.pm
lib/Net/DBus/Callback.pm
lib/Net/DBus/Dumper.pm
lib/Net/DBus/Error.pm
lib/Net/DBus/Exporter.pm
lib/Net/DBus/Object.pm
lib/Net/DBus/Reactor.pm
lib/Net/DBus/RemoteObject.pm
lib/Net/DBus/RemoteService.pm
lib/Net/DBus/Service.pm
lib/Net/DBus/Test/MockConnection.pm
lib/Net/DBus/Test/MockIterator.pm
lib/Net/DBus/Test/MockMessage.pm
lib/Net/DBus/Test/MockObject.pm
lib/Net/DBus/Tutorial.pod
lib/Net/DBus/Tutorial/ExportingObjects.pod
lib/Net/DBus/Tutorial/UsingObjects.pod
Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
META.yml
Net-DBus.spec.PL
README
t/00-constants.t
t/05-pod.t
t/10-pod-coverage.t
t/15-message.t
t/20-callback.t
t/25-reactor.t
t/30-server.t
t/40-introspector.t
t/42-object-introspect-avahi.t
t/45-exporter.t
t/50-object-introspect.t
t/55-method-calls.t
t/56-scalar-param-typing.t
t/60-object-props.t
t/65-object-magic.t
t/70-errors.t
typemap
Net-DBus.spec
pm_to_blib
DBus\.o
DBus\.c
DBus\.bs
.*.old
DBus-
blib
.*\.bak
CVS
.cvsignore
.*~
.#.*
#.*
.hg
^Makefile$
^cover_db/
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Net-DBus
version: 0.33.3
version_from: lib/Net/DBus.pm
installdirs: site
requires:
Test::More: 0
Time::HiRes: 0
XML::Twig: 0
distribution_type: module
generated_by: ExtUtils::MakeMaker version 6.17
use 5.006;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
my $DBUS_LIBS = `pkg-config --libs dbus-1`;
my $DBUS_CFLAGS = `pkg-config --cflags dbus-1`;
if (!defined $DBUS_LIBS || !defined DBUS_CFLAGS) {
die "could not run 'pkg-config' to determine compiler/linker flags for dbus library: $!\n";
}
if (!$DBUS_LIBS || !$DBUS_CFLAGS) {
die "'pkg-config' didn't report any compiler/linker flags for dbus library\n";
}
WriteMakefile(
'NAME' => 'Net::DBus',
'VERSION_FROM' => 'lib/Net/DBus.pm',
'PREREQ_PM' => {
'Test::More' => 0,
'Time::HiRes' => 0,
'XML::Twig' => 0,
},
# 'ABSTRACT_FROM' => 'lib/Net/DBus.pm',
'AUTHOR' => 'Daniel Berrange <dan@berrange.com>',
'LIBS' => [$DBUS_LIBS],
'DEFINE' => "-DDBUS_API_SUBJECT_TO_CHANGE -DPD_DO_DEBUG=1",
'INC' => "-Wall $DBUS_CFLAGS",
'depend' => {
Net-DBus.spec => '$(VERSION_FROM)',
Makefile => '$(VERSION_FROM)',
},
'realclean' => {
FILES => 'Net-DBus.spec',
},
);
package MY;
sub libscan
{
my ($self, $path) = @_;
($path =~ /\~$/ || $path =~ m,/CVS/,) ? undef : $path;
}
sub test {
my $self = shift;
my $mm_test = $self->SUPER::test(@_);
return '
TO_TEST_PM = $(TO_INST_PM:lib/%.pm=blib/test/%.pm.tstamp)
test :: test-syntax
test-syntax: pure_all $(TO_TEST_PM)
blib/test/%.pm.tstamp: lib/%.pm
@echo -n "Checking $<: "
#@perl -I blib/lib -c $<
@podchecker $<
@mkdir -p `dirname $@`
@touch $@
' . $mm_test;
}
__END__
# Automatically generated by DBus.spec.PL
%define debug_package %{nil}
%define perlvendorarch %(perl -e 'use Config; print $Config{installvendorarch}')
%define perlvendorlib %(perl -e 'use Config; print $Config{installvendorlib}')
%define perlvendorprefix %(perl -e 'use Config; print $Config{vendorprefix}')
%define perlvendorman3 %{perlvendorprefix}/share/man/man3
%define perlversion %(perl -e 'use Config; print $Config{version}')
%define appname Net-DBus
%define _extra_release %{?extra_release:%{extra_release}}
Summary: Perl API to the DBus message system
Name: perl-%{appname}
Version: 0.33.3
Release: 1%{_extra_release}
License: GPL
Group: Applications/Internet
Source: %{appname}-%{version}.tar.gz
BuildRoot: /var/tmp/%{appname}-%{version}-root
#BuildArchitectures: noarch
Requires: perl = %{perlversion}
# For XML::Twig
Requires: perl-XML-Twig
# For Time::HiRes
Requires: perl-Time-HiRes
Requires: dbus >= 0.33
BuildRequires: dbus-devel >= 0.33
BuildRequires: perl-XML-Twig
%description
Provides a Perl API to the DBus message system
%prep
%setup -q -n %{appname}-%{version}
%build
if [ -z "$DBUS_HOME" ]; then
perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor
else
perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor DBUS_HOME=$DBUS_HOME
fi
make
%install
rm -rf $RPM_BUILD_ROOT
make install INSTALLVENDORMAN3DIR=$RPM_BUILD_ROOT%{perlvendorman3}
find $RPM_BUILD_ROOT -name perllocal.pod -exec rm -f {} \;
find $RPM_BUILD_ROOT -name .packlist -exec rm -f {} \;
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README CHANGES AUTHORS COPYING examples/*.pl
%{perlvendorman3}/*
%{perlvendorarch}/Net/DBus.pm
%{perlvendorarch}/Net/DBus/
%{perlvendorarch}/auto/Net/DBus
%changelog
* Fri Jan 6 2006 Daniel Berrange <berrange@localhost.localdomain> - 0.33.1-1
- Added explicit dependancies on perl-libxml-perl and perl-Time-HiRes
- Increased min required dbus version to 0.33 since we
need the dbus_connection_unregister_object_path method
# -*- rpm-spec -*-
# Copyright (C) 2004-2006 Daniel Berrange <dan@berrange.com>
#
# $Id: Net-DBus.spec.PL,v 1.8 2006/01/06 16:21:04 dan Exp $
use strict;
die unless (scalar @ARGV == 1);
open SRC, "lib/Net/DBus.pm"
or die "lib/Net/DBus.pm: $!";
our $VERSION;
while (<SRC>) {
if (/$VERSION\s*=\s*'(.*)'/) {
$VERSION=$1;
}
}
close SRC;
local $/ = undef;
$_ = <DATA>;
s/\@VERSION\@/$VERSION/g;
open SPEC, ">$ARGV[0]" or die "$!";
print SPEC $_;
close SPEC;
__DATA__
# Automatically generated by DBus.spec.PL
%define debug_package %{nil}
%define perlvendorarch %(perl -e 'use Config; print $Config{installvendorarch}')
%define perlvendorlib %(perl -e 'use Config; print $Config{installvendorlib}')
%define perlvendorprefix %(perl -e 'use Config; print $Config{vendorprefix}')
%define perlvendorman3 %{perlvendorprefix}/share/man/man3
%define perlversion %(perl -e 'use Config; print $Config{version}')
%define appname Net-DBus
%define _extra_release %{?extra_release:%{extra_release}}
Summary: Perl API to the DBus message system
Name: perl-%{appname}
Version: @VERSION@
Release: 1%{_extra_release}
License: GPL
Group: Applications/Internet
Source: %{appname}-%{version}.tar.gz
BuildRoot: /var/tmp/%{appname}-%{version}-root
#BuildArchitectures: noarch
Requires: perl = %{perlversion}
# For XML::Twig
Requires: perl-XML-Twig
# For Time::HiRes
Requires: perl-Time-HiRes
Requires: dbus >= 0.33
BuildRequires: dbus-devel >= 0.33
BuildRequires: perl-XML-Twig
%description
Provides a Perl API to the DBus message system
%prep
%setup -q -n %{appname}-%{version}
%build
if [ -z "$DBUS_HOME" ]; then
perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor
else
perl Makefile.PL PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor DBUS_HOME=$DBUS_HOME
fi
make
%install
rm -rf $RPM_BUILD_ROOT
make install INSTALLVENDORMAN3DIR=$RPM_BUILD_ROOT%{perlvendorman3}
find $RPM_BUILD_ROOT -name perllocal.pod -exec rm -f {} \;
find $RPM_BUILD_ROOT -name .packlist -exec rm -f {} \;
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README CHANGES AUTHORS COPYING examples/*.pl
%{perlvendorman3}/*
%{perlvendorarch}/Net/DBus.pm
%{perlvendorarch}/Net/DBus/
%{perlvendorarch}/auto/Net/DBus
%changelog
* Fri Jan 6 2006 Daniel Berrange <berrange@localhost.localdomain> - 0.33.1-1
- Added explicit dependancies on perl-libxml-perl and perl-Time-HiRes
- Increased min required dbus version to 0.33 since we
need the dbus_connection_unregister_object_path method
Net::DBus
=========
Net::DBus provides a Perl XS API to the dbus inter-application
messaging system. The Perl API covers the core base level
of the dbus APIs, not concerning itself yet with the GLib
or QT wrappers. For more information on dbus visit the
project website at:
http://www.freedesktop.org/software/dbus/
This version operates against DBus 0.33, through 0.60, and
possibly later versions, if there have been no serious API
changes.
INSTALLATION
------------
To install this module type the following:
perl Makefile.PL
make
make test
sudo make install
The makefile calls the C<pkg-config> script to determine the
correct flags to pass to the compiler & linkers when building
the XS part of the module. Thus, ensure pkg-config is in
a directory listed by the $PATH environment.
The pkg-config program will likely find the DBus install in /usr
provided by the base OS distribution, so if testing against an
alternate install of DBus, set the C$PKG_CONFIG_PATH env
variable before generating the Makefile. For example, if your
dbus installation is in C<$HOME/usr/dbus-cvs-tip> , then to build
and install against this version of DBus do
export PKG_CONFIG_PATH=$HOME/usr/dbus-cvs-tip/lib/pkg-config
perl Makefile.PL PREFIX=$HOME/usr/dbus-cvs-tip
make
make test
make install
DEPENDENCIES
------------
In keeping with the C API, the Perl DBus implementation
has minimal external dependancies:
Time::HiRes
XML::Twig
XML::Parser
And to run the test suite:
Test::More
Test::Pod (optional, but recommended)
Test::Pod::Coverage (optional, but recommended)
Although they are not part of the base Perl distribution, most
OS distributor will already provide addon packages containing
these modules. Failing this, they are all available from CPAN
http://search.cpan.org/
EXAMPLES
--------
There are a number of example programs in the examples/
subdirectory demonstrating use of the high level application
developer APIs.
example-service.pl - Providing a simple service
example-client.pl - Talking to a remote service
example-signal-emitter.pl - How to broadcast signals
example-signal-receiver.pl - How to receive signals
dump-object.pl - Dump info about dbus objects
lshal.pl - Dump names of all HAL devices
CONTRIBUTIONS
-------------
Contributions both simple bug fixes & new features are
always welcome. Please supply patches in context, or
unified diff format. A simple method to generate such a
patch is as follows:
* Clean out generated files from your working
directory:
make distclean
* Rename your working directory to have '-new'
extension:
mv DBus-0.33.3 DBus-0.33.3-new
* Extract a pristine copy of the source:
gunzip -c DBus-0.33.3.tar.gz | tar xf -
mv DBus-0.33.3 DBus-0.33.3-orig
* Generate the patch:
diff -ruN DBus-0.33.3-orig DBus-0.33.3-new \
> DBus-0.33.3-[something].patch
gzip DBus-0.33.3-[something].patch
Send the resulting to .patch.gz file directly to
Daniel Berrange <dan at berrange dot com>
COPYRIGHT AND LICENCE
---------------------
Copyright (C) 2004-2006 Daniel Berrange
Net-DBus may be redistributed and/or modified under the terms of Perl itself.
Either:
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version
or
b) the "Artistic License"
See the file "COPYING" for the full text of each license
-- End
#!/bin/sh
#
# This script is used to Test::AutoBuild (http://www.autobuild.org)
# to perform automated builds of the DBus module
NAME=Net-DBus
set -e
make -k realclean ||:
rm -rf MANIFEST blib pm_to_blib
perl Makefile.PL PREFIX=$AUTOBUILD_INSTALL_ROOT
rm -f MANIFEST
make manifest
echo $NAME.spec >> MANIFEST
# Build the RPM.
make
if [ -z "$USE_COVER" ]; then
perl -MDevel::Cover -e '' 1>/dev/null 2>&1 && USE_COVER=1 || USE_COVER=0
fi
if [ -z "$SKIP_TESTS" -o "$SKIP_TESTS" = "0" ]; then
if [ "$USE_COVER" = "1" ]; then
cover -delete
HARNESS_PERL_SWITCHES=-MDevel::Cover make test
cover
mkdir blib/coverage
cp -a cover_db/*.html cover_db/*.css blib/coverage
mv blib/coverage/coverage.html blib/coverage/index.html
else
make test
fi
fi
make install
rm -f $NAME-*.tar.gz
make dist
if [ -f /usr/bin/rpmbuild ]; then
if [ -n "$AUTOBUILD_COUNTER" ]; then
EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
else
NOW=`date +"%s"`
EXTRA_RELEASE=".$USER$NOW"
fi
rpmbuild -ta --define "extra_release $EXTRA_RELEASE" --clean $NAME-*.tar.gz
fi
# Skip debian pkg for now
exit 0
if [ -f /usr/bin/fakeroot ]; then
fakeroot debian/rules clean
fakeroot debian/rules DESTDIR=$HOME/packages/debian binary
fi
#!/usr/bin/perl
use warnings;
use strict;
use Net::DBus;
use Net::DBus::Dumper;
use Carp qw(confess);
$SIG{__DIE__} = sub {confess $_[0] };
my $bus = Net::DBus->find;
if (@ARGV) {