debian/0000775000000000000000000000000012305574317007177 5ustar debian/watch0000664000000000000000000000014212224717426010225 0ustar version=3 http://www.kernel.org/pub/linux/network/ofono/phonesim-(.*)\.tar\.gz \ debian \ uupdate debian/README.source0000664000000000000000000000351012224717426011355 0ustar Patches ======= This package occasionally uses cdbs simple-patch-system to store modifications to the upstream source, although in most uploads no patches are needed. To get the fully patched source: make -f debian/rules patch To revert to what's in git: make -f debian/rules unpatch To add a patch: obtain a diff and put it in debian/patches, or see below To remove an existing patch: delete it from debian/patches Packaging using git =================== The repository contains an appropriate debian/gbp.conf to build this package using git-buildpackage. The debian branch contains the latest upstream versions (for unstable, or experimental while a freeze is in progress). The debian-lenny branch contains versions targeted for lenny, etc. Here's how to build it: git clone git://git.debian.org/git/pkg-telepathy/ofono-phonesim cd ofono-phonesim git checkout debian git-buildpackage -us -uc or for testing/stable branches like debian-lenny: git clone git://git.debian.org/git/pkg-telepathy/ofono-phonesim cd ofono-phonesim git checkout debian-lenny git-buildpackage -us -uc --git-debian-branch=debian-lenny The branch 'upstream' is a copy of the contents of upstream tarballs. To import upstream tarballs use: git checkout debian git-import-orig ~/ofono-phonesim-0.x.tar.gz The branch 'debian-patches' is 'upstream' plus any patches needed for Debian. It should be rebased on 'upstream' after each upstream release: git checkout debian-patches git rebase upstream The preferred way of adding patches is to cherry pick from an upstream repository: git remote add phonesim-upstream \ git://git.kernel.org/pub/scm/network/ofono/phonesim.git git fetch git checkout debian-patches git cherry-pick xxxxxxxxxxxxxx git checkout debian fakeroot debian/rules update-patches debian/ofono-phonesim-autostart.ofono-phonesim.upstart0000664000000000000000000000106712232436535020550 0ustar # set up ofono to run with the phone simulator description "ofono with phonesim simulator" start on runlevel [2345] stop on runlevel [06] exec with-ofono-phonesim quiet post-start script # wait until the modem is actually ready echo "Waiting for modem to get powered..." for timeout in `seq 10`; do if /usr/share/ofono/scripts/list-modems | grep -q "EmergencyNumbers"; then break fi sleep 1 done if [ "$timeout" -le 1 ]; then echo "phonesim failed to start!" >&2 exit 1 fi end script debian/rules0000775000000000000000000000074712224740525010263 0ustar #!/usr/bin/make -f DEB_AUTO_CLEANUP_RCS := yes include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/utils.mk common-binary-post-install-arch:: list-missing include $(CURDIR)/debian/update-patches.mk DEB_DH_INSTALLINIT_ARGS_ofono-phonesim-autostart := --upstart-only --name=ofono-phonesim binary-post-install/ofono-phonesim:: mv debian/ofono-phonesim/usr/bin/phonesim debian/ofono-phonesim/usr/bin/ofono-phonesim debian/copyright0000664000000000000000000000316312224717426011135 0ustar This package was debianized by Andres Salomon on Mon, 02 Nov 2009 19:15:24 +0000 It was downloaded from: . Upstream Authors: Marcel Holtmann Denis Kenzior Andrzej Zaborowski Yang Gu Shane Bryan Rajyalakshmi Bommaraju Zhigang Li Jeevaka Badrappan Gustavo F. Padovan Lucas De Marchi Copyright (C) 2009 Trolltech ASA. Copyright (C) 2008-2009 Intel Corporation License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. debian/update-patches.mk0000664000000000000000000000055712224717426012446 0ustar update-patches: mkdir -p $(CURDIR)/debian/patches rm -f $(CURDIR)/debian/patches/*.patch git format-patch -N -o $(CURDIR)/debian/patches debian-patches ^upstream for patch in $$(ls $(CURDIR)/debian/patches/*.patch) ; \ do \ lines=$$(cat $$patch | wc -l) ; \ head -n $$(($$lines - 3)) $$patch > $${patch}.chomped ; \ mv $${patch}.chomped $$patch ; \ done debian/tests/0000775000000000000000000000000012305574255010342 5ustar debian/tests/script0000775000000000000000000000255412305574232011575 0ustar #!/bin/sh set -e MYPATH=`readlink -f $0` MYDIR=`dirname $MYPATH` assert_in() { if ! echo "$2" | grep -q "$1"; then echo "FAIL: '$1' not found in:" >&2 echo "$2" >&2 echo "--------" >&2 exit 1 fi } # wait until modem is present and powered for timeout in `seq 10`; do if /usr/share/ofono/scripts/list-modems | grep -q "org.ofono.MessageManager"; then break fi echo "Waiting for modem to initialize SMS manager..." sleep 1 done assert_in "/phonesim" "`/usr/share/ofono/scripts/list-modems`" # start SMS monitor LOG=`mktemp` export PYTHONUNBUFFERED=x stdbuf -o 0 /usr/share/ofono/scripts/receive-sms > "$LOG" & LOG_PID=$! # receive-sms is a Python script, give it some time to settle sleep 1 # send SMS through GUI script; do this as unprivileged user sudo su -s /bin/sh <&2 exit 1 fi } assert_in() { if ! echo "$2" | grep -q "$1"; then echo "FAIL: '$1' not found in:" >&2 echo "$2" >&2 echo "--------" >&2 exit 1 fi } # list-modems should show phonesim modem OUT=`/usr/share/ofono/scripts/list-modems` assert_in "/phonesim" "$OUT" assert_in "Powered = 1" "$OUT" assert_in "org.ofono.VoiceCallManager" "$OUT" # verify the D-BUS address file assert_eq "`stat -c '%U' /run/lock/ofono-phonesim-dbus.address 2>&1`" "nobody" # verify pid and user of phonesim process assert_eq "`stat -c '%U' /run/lock/ofono-phonesim-dbus.pid 2>&1`" "nobody" OUT=`ps U nobody` assert_in "ofono-phonesim" "$OUT" # stopping the job should go back to running normal ofono stop ofono-phonesim assert_in 'start/running' "`status ofono`" # ... and not have a phonesim modem OUT=`/usr/share/ofono/scripts/list-modems` if echo "$OUT" | grep -q "/phonesim"; then echo "ERROR: /phonesim modem still present after stopping ofono-phonesim script!" >&2 echo "$OUT" >&2 exit 1 fi # restart phonesim job again start ofono-phonesim sleep 2 assert_in 'stop/waiting' "`status ofono`" # should be back to emulated assert_in "/phonesim" "`/usr/share/ofono/scripts/list-modems`" debian/tests/control0000664000000000000000000000012312225734760011741 0ustar Tests: autostart script Depends: ofono-phonesim-autostart Restrictions: needs-root debian/tests/scripts/0000775000000000000000000000000012232477704012031 5ustar debian/tests/scripts/sms.js0000664000000000000000000000030512225734572013170 0ustar tabSMS.gbMessage1.leMessageSender.text = "0815"; tabSMS.gbMessage1.leSMSClass.text = "1"; tabSMS.gbMessage1.teSMSText.setPlainText("Generated Message"); tabSMS.gbMessage1.pbSendSMSMessage.click(); debian/local/0000775000000000000000000000000012303141706010257 5ustar debian/local/with-ofono-phonesim0000775000000000000000000001034112303141651014114 0ustar #!/bin/sh # Set up ofono to run with the phone simulator. This uses an unshared tmpfs # mount over /etc/ofono/ to avoid having to modify the file system. The script # can either be invoked without arguments and run until Control-C, or run a # program (with arguments), in which case everything will be restored when the # program ends. # # Author: Martin Pitt set -e # run program under an unshared /etc/ofono/, to be able to run ofono # with a custom configuration without having to touch the fs if [ -z "$WITH_OFONO_PHONESIM_UNSHARED" ]; then export WITH_OFONO_PHONESIM_UNSHARED=1 exec unshare -m -- "$0" "$@" fi PHONESIM_CONF=/etc/ofono/phonesim.conf SCRIPTS_DIR=/usr/share/ofono/scripts # enable to get ofono debugging log on failure #DEBUG_OFONO=-d if [ "$1" = "--help" ]; then echo "Usage: $0 [ [args..] ]" >&2 exit 0 fi # check our dependencies [ -e $PHONESIM_CONF ] || { echo "You need to install ofono-phonesim for this" >&2 exit 1 } if ! type xvfb-run >/dev/null 2>&1; then echo "You need to install xvfb for this" >&2 exit 1 fi if ! type $SCRIPTS_DIR/online-modem >/dev/null 2>&1; then echo "You need to install ofono-scripts for this" >&2 exit 1 fi # read ofono config and uncomment phonesim stanza MYCONF=$(sed '/\[phonesim/,$ s/^#//' $PHONESIM_CONF) # write our own config into tmpfs overlay mount -n -t tmpfs tmpfs /etc/ofono echo "$MYCONF" > $PHONESIM_CONF stop ofono || true ofonod -P ril $DEBUG_OFONO -n >/etc/ofono/ofono.log 2>&1 & OFONO_PID=$! echo "$0: started ofono (pid $OFONO_PID)" # session D-BUS config for phomesim where everyone can send messages to cat < /etc/ofono/phonesim-dbus.conf session unix:tmpdir=/tmp /run/lock/ofono-phonesim-dbus.pid EOF # clean up phonesim, dbus, and restart original ofono at the end cleanup() { set +e echo "$0: cleaning up..." pkill -x ofono-phonesim kill $OFONO_PID 2>/dev/null wait if [ -e /run/lock/ofono-phonesim-dbus.pid ]; then cat /run/lock/ofono-phonesim-dbus.pid | xargs kill rm /run/lock/ofono-phonesim-dbus.address fi start ofono pkill telepathy-ofono } trap cleanup 0 TERM INT QUIT HUP PIPE # start phonesim on a publicly accessible D-BUS daemon as user nobody su -s /bin/sh nobody > /etc/ofono/phonesim.log <&1 & eval \`dbus-launch --config-file=/etc/ofono/phonesim-dbus.conf\` echo \$DBUS_SESSION_BUS_ADDRESS > /run/lock/ofono-phonesim-dbus.address export DBUS_SESSION_BUS_ADDRESS xvfb-run -a ofono-phonesim -p 12345 -gui /usr/share/phonesim/default.xml EOF echo "$0: waiting for simulated modem to appear ..." timeout=10 while [ $timeout -gt 0 ]; do sleep 1 timeout=$((timeout-1)) $SCRIPTS_DIR/enable-modem && break done [ $timeout -ge 0 ] || { echo "timed out waiting for phonesim modem to appear" >&2 exit 1 } echo "$0: started phonesim" # force restart of telepathy-ofono against new ofonod pkill telepathy-ofono || true # no arguments: interactive, kill with Control-C if [ -z "$1" ]; then echo "$0: run your application now, and Control-C or kill this process to stop this simulator" tail -f /etc/ofono/ofono.log echo "$0: shutting down" exit 0 fi # with "quiet": don't tail logs, script can be killed if [ "$1" = "quiet" ]; then echo "$0: run your application now, and kill this process ($$) to stop the simulator" # need to sleep within the shell to be able to catch signals, so use the builtin read mkfifo /etc/ofono/silent read x < /etc/ofono/silent || true exit 0 fi # otherwise: run specified program echo "$0: running command line specified program/test..." $@ || { RC=$? echo "program/test failed with exit status $RC" >&2 echo "------ ofono log -------------" >&2 cat /etc/ofono/ofono.log >&2 echo "------ end ofofono log -------------" >&2 exit $RC } debian/source/0000775000000000000000000000000012232477704010500 5ustar debian/source/format0000664000000000000000000000001312224717426011704 0ustar 3.0 (quilt)debian/compat0000664000000000000000000000000212224717426010375 0ustar 5 debian/ofono-phonesim.install0000664000000000000000000000007012224737443013525 0ustar debian/tmp/usr debian/local/with-ofono-phonesim usr/bin debian/control0000664000000000000000000000332012225720006010565 0ustar Source: ofono-phonesim Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Telepathy maintainers Uploaders: Jonny Lamb , Hector Oron Build-Depends: debhelper (>= 5), cdbs, pkg-config, libqt4-dev Standards-Version: 3.9.3 Homepage: http://www.ofono.org/ Vcs-Git: git://git.debian.org/git/pkg-telepathy/ofono-phonesim.git Vcs-Browser: http://git.debian.org/?p=pkg-telepathy/ofono-phonesim.git XS-Testsuite: autopkgtest Package: ofono-phonesim Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Modem emulator used by the oFono mobile telephony stack oFono is a stack for mobile telephony devices on Linux. oFono supports speaking to telephony devices through specific drivers, or with generic AT commands. . Phonesim is a modem emulator that oFono uses for development and testing. This allows oFono to be used by any host without requiring special GSM (or other) hardware. Package: ofono-phonesim-autostart Architecture: all Depends: ofono, ofono-phonesim, ofono-scripts, xvfb, dbus-x11, ${misc:Depends} Description: Automatically start ofono-phonesim Phonesim is a modem emulator that oFono uses for development and testing. This allows oFono to be used by any host without requiring special GSM (or other) hardware. . This package provides an upstart job that automatically starts Phonesim on package installation and at boot. It makes any real SIM hardware inaccessible, and should only be installed in test environments. . You DO NOT want this package in PRODUCTION environments! debian/gbp.conf0000664000000000000000000000023312224717426010614 0ustar [DEFAULT] debian-branch = debian upstream-branch = upstream pristine-tar = True [git-buildpackage] tarball-dir = ../tarballs/ export-dir = ../build-area/ debian/changelog0000664000000000000000000001077112305574317011057 0ustar ofono-phonesim (1.19-0ubuntu10) trusty; urgency=medium * debian/tests/script: Run receive-sms under $PYTHONUNBUFFERED to make output redirection work reliably. -- Martin Pitt Wed, 05 Mar 2014 11:13:01 +0100 ofono-phonesim (1.19-0ubuntu9) trusty; urgency=medium * debian/local/with-ofono-phonesim: More precisely kill ofono-phonesim, to avoid killing the prerm script itself. (LP: #1284710) -- Martin Pitt Tue, 25 Feb 2014 17:24:35 +0100 ofono-phonesim (1.19-0ubuntu8) trusty; urgency=medium * debian/tests/script: Force /bin/sh as the shell when switching to the "games" user. -- Colin Watson Wed, 08 Jan 2014 17:24:26 +0000 ofono-phonesim (1.19-0ubuntu7) trusty; urgency=medium * debian/local/with-ofono-phonesim: Force /bin/sh as the shell when switching to the "nobody" user. -- Colin Watson Wed, 08 Jan 2014 16:09:44 +0000 ofono-phonesim (1.19-0ubuntu6) trusty; urgency=low * debian/local/with-ofono-phonesim: Drop the recursive private remounting of /. It's not necessary in Ubuntu and upsets otto containers. -- Martin Pitt Fri, 25 Oct 2013 16:27:09 +0200 ofono-phonesim (1.19-0ubuntu5) trusty; urgency=low * Move waiting for modem to get powered from the autopkgtest into the upstart job, to avoid new tests falling into the same trap. Now the modem is really ready when the package finished installing. -- Martin Pitt Fri, 25 Oct 2013 11:49:27 +0200 ofono-phonesim (1.19-0ubuntu4) saucy; urgency=low * debian/local/with-ofono-phonesim: - Run phonesim as user nobody instead of root - Run phonesim under a private session D-BUS with -gui, so that one can send GUI scripts to it for automating e. g. SMS messages. Use a D-BUS configuration which allows anyone to send messages to that. * Add dbus-x11 dependency for the change above. * debian/tests/autostart: Verify that with above changes phonesim runs as nobody and writes correct pid/address files. * Add an autopkgtest that scripting works: receive a synthesized SMS. -- Martin Pitt Fri, 11 Oct 2013 11:16:59 +0200 ofono-phonesim (1.19-0ubuntu3) saucy; urgency=low * debian/tests/autostart: Show program outputs on failures. * debian/tests/autostart: Wait for modem to get powered. Without that, the test can fail if it runs too quickly after installing ofono-phonesim-autostart. -- Martin Pitt Wed, 09 Oct 2013 08:32:28 +0200 ofono-phonesim (1.19-0ubuntu2) saucy; urgency=low * Add debian/local/with-ofono-phonesim: Script to set up ofono to run with the phone simulator. The script can either be invoked without arguments and run until Control-C, or run a program (with arguments), in which case everything will be restored when the program ends. * Add ofono-phonesim-autostart package with an upstart job that runs with-ofono-phonesim automatically on package install and boot. Continuous integration testing of ofono consumers can use this as a test dependency. (LP: #1236708) * Add autopkgtest for ofono-phonesim-autostart package. -- Martin Pitt Tue, 08 Oct 2013 11:08:20 +0200 ofono-phonesim (1.19-0ubuntu1) saucy; urgency=low * New upstream release. - Fixes acceptance of calls to "magic" numbers, and adds support for 06123xx, too. (LP: #1234219) -- Martin Pitt Wed, 02 Oct 2013 16:40:44 +0200 ofono-phonesim (1.17-1) unstable; urgency=low * New upstream release. * Add myself as uploader. * Bump Standards-Version. -- Hector Oron Mon, 04 Jun 2012 11:42:20 +0200 ofono-phonesim (1.9-1) unstable; urgency=low * New upstream release. * debian/: Add files relating to building with git. * debian/control: Adopt package from Andres. Thanks for your work! * debian/rules: Port to cdbs to be like the rest of the pkg-telepathy packages. * debian/source/format: Use 3.0 (quilt). * debian/dirs: Removed. * debian/docs: Removed. * debian/copyright: Updated author list. -- Jonny Lamb Tue, 30 Nov 2010 10:01:36 +0000 ofono-phonesim (1.0-2) unstable; urgency=low * Fix up debian/copyright (closes: #556983). -- Andres Salomon Tue, 08 Dec 2009 18:22:13 +0000 ofono-phonesim (1.0-1) unstable; urgency=low * Initial release (closes: #554035). -- Andres Salomon Mon, 02 Nov 2009 19:06:45 +0000