From 8321c3efe50f691724ef8b601990acbf7945f304 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Wed, 24 Jun 2009 21:19:39 +0300 Subject: [PATCH] Initial maemo support. --- debian/changelog | 5 ++ debian/compat | 1 + debian/connman-dev.install | 2 + debian/connman-doc.install | 1 + debian/connman-test.install | 2 + debian/connman.default | 2 + debian/connman.init | 62 ++++++++++++++++++ debian/connman.install | 7 +++ debian/connman.upstart | 29 +++++++++ debian/control | 43 +++++++++++++ debian/rules | 147 +++++++++++++++++++++++++++++++++++++++++++ 11 files changed, 301 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/connman-dev.install create mode 100644 debian/connman-doc.install create mode 100644 debian/connman-test.install create mode 100644 debian/connman.default create mode 100644 debian/connman.init create mode 100644 debian/connman.install create mode 100644 debian/connman.upstart create mode 100644 debian/control create mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2c62f42 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +connman (0.19) unstable; urgency=low + + * Initial maemo support. + + -- Jukka Rissanen Wed, 24 Jun 2009 20:55:50 +0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/connman-dev.install b/debian/connman-dev.install new file mode 100644 index 0000000..65bdff8 --- /dev/null +++ b/debian/connman-dev.install @@ -0,0 +1,2 @@ +usr/include/connman +usr/lib/pkgconfig diff --git a/debian/connman-doc.install b/debian/connman-doc.install new file mode 100644 index 0000000..89d3ec9 --- /dev/null +++ b/debian/connman-doc.install @@ -0,0 +1 @@ +usr/share/gtk-doc/html/connman diff --git a/debian/connman-test.install b/debian/connman-test.install new file mode 100644 index 0000000..afe4012 --- /dev/null +++ b/debian/connman-test.install @@ -0,0 +1,2 @@ +usr/bin/*-* + diff --git a/debian/connman.default b/debian/connman.default new file mode 100644 index 0000000..df0e3f3 --- /dev/null +++ b/debian/connman.default @@ -0,0 +1,2 @@ +# Set connman options here +DAEMON_OPTS="-i wlan*" diff --git a/debian/connman.init b/debian/connman.init new file mode 100644 index 0000000..b7de060 --- /dev/null +++ b/debian/connman.init @@ -0,0 +1,62 @@ +#!/bin/sh + +DAEMON=/usr/sbin/connmand +PIDFILE=/var/run/connmand.pid +DESC="Connection Manager" +NAME=connman + +. /lib/lsb/init-functions + +if [ -f /etc/default/connman ] ; then + . /etc/default/connman +fi + +set -e + +unset USE_UPSTART +INITCTL=/sbin/initctl +test -x /sbin/initctl && USE_UPSTART=1 + +do_start() { + if [ -z "$USE_UPSTART" ]; then + start-stop-daemon --start --oknodo \ + --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS + else + $INITCTL start $NAME + fi +} + +do_stop() { + if [ -z "$USE_UPSTART" ]; then + start-stop-daemon --stop --oknodo --quiet \ + --pidfile $PIDFILE --exec $DAEMON + else + $INITCTL stop $NAME + fi +} + +case "$1" in + start) + log_daemon_msg "Starting $DESC" + do_start + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" + do_stop + log_end_msg $? + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" + do_stop + sleep 1 + do_start + log_end_msg $? + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/connman.install b/debian/connman.install new file mode 100644 index 0000000..40aebec --- /dev/null +++ b/debian/connman.install @@ -0,0 +1,7 @@ +etc/dbus-1/system.d/connman.conf +usr/sbin/connmand +usr/lib/connman/plugins/*.so +usr/lib/connman/scripts +usr/share/dbus-1 +var/lib/connman +var/run/connman diff --git a/debian/connman.upstart b/debian/connman.upstart new file mode 100644 index 0000000..511fe10 --- /dev/null +++ b/debian/connman.upstart @@ -0,0 +1,29 @@ +description "starting connman" +author "Jukka Rissanen" + +console none + +# We do not start automatically yet +#start on started xsession +stop on ACT_DEAD +stop on stopping dbus + +pre-start script + /usr/sbin/waitdbus system + initctl stop icd2 + initctl stop wlancond + initctl stop dnsmasq +end script + +post-stop script + # stop dnsmasq, wlancond and icd2 because + # they are in use in this system at the moment + initctl start dnsmasq + initctl start wlancond + initctl start icd2 + killall wpa_supplicant +end script + +exec /usr/sbin/connmand -n -i wlan* + +respawn diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..40e1cce --- /dev/null +++ b/debian/control @@ -0,0 +1,43 @@ +Source: connman +Priority: optional +Maintainer: Jukka Rissanen +Build-Depends: debhelper (>> 3.0.0), autotools-dev, libglib2.0-dev, libdbus-glib-1-dev, + upstart-dev (>= 0.3.8-18) +Standards-Version: 3.7.2 +Section: net + +Package: connman +Section: net +Provides: osso-ic +Replaces: osso-ic +Architecture: any +Depends: dbus, dbus-1-utils, ${shlibs:Depends} +Description: Connection manager + This package contains the connection manager daemon + +Package: connman-dbg +Section: net +Architecture: any +Depends: connman (= ${Source-Version}) +Description: Debug symbols for connman + Debug symbols for connman + +Package: connman-doc +Section: net +Architecture: any +Description: Documentation for connman + This package contains the documentation for the connman + +Package: connman-dev +Section: net +Architecture: any +Depends: libglib2.0-dev +Description: Development files for connman + This package contains header and other development files for the connman + +Package: connman-test +Section: net +Architecture: any +Depends: python, connman +Description: Test scripts for connman + This package contains test files for the connman diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..73d3976 --- /dev/null +++ b/debian/rules @@ -0,0 +1,147 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +# FOR AUTOCONF 2.52 AND NEWER ONLY +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build $(DEB_HOST_GNU_TYPE) +else + confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + +# nostrip option +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +# use thumb mode if it's enabled +ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS))) + CFLAGS += -mthumb +endif + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + confflags += --enable-debug +endif + +ifneq (,$(findstring docs,$(DEB_BUILD_OPTIONS))) + confflags += --enable-gtk-doc +endif + +ifneq (,$(findstring dmalloc,$(DEB_BUILD_OPTIONS))) + CONFIG_DMALLOC=--enable-dmalloc + CFLAGS += -DDMALLOC_ENABLE +endif + +# default flags +CFLAGS += -g -O2 + +configure: configure.ac debian/changelog + ./bootstrap + +config.status: configure + dh_testdir +ifneq (,$(findstring docs,$(DEB_BUILD_OPTIONS))) + if [ ! -f doc/gtk-doc.make ]; then gtkdocize --copy --docdir doc; fi +endif + # Add here commands to configure the package. + CFLAGS="$(CFLAGS)" ./configure $(confflags) \ + --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --disable-fake \ + --enable-loopback \ + --enable-wifi \ + --enable-bluetooth \ + --enable-udhcp \ + --with-udhcpc=/sbin/udhcpc \ + --enable-dhclient \ + --enable-resolvconf \ + --enable-dnsproxy \ + $(CONFIG_DMALLOC) $* +# --enable-client +# --enable-ethernet +# --enable-ppp +# --enable-udev + +build: build-stamp + +build-stamp: config.status + dh_testdir + # Add here commands to compile the package. + $(MAKE) + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # Add here commands to clean up after the build process. + -if [ -f Makefile ] ; then $(MAKE) distclean ; fi + -test -r /usr/share/misc/config.sub && \ + cp -f /usr/share/misc/config.sub config.sub + -test -r /usr/share/misc/config.guess && \ + cp -f /usr/share/misc/config.guess config.guess + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + # Add here commands to install the package into debian/tmp + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + # Create document dir although it is only used if docs are built + -mkdir -p debian/tmp/usr/share/gtk-doc/html/connman + # Services file is copied separately + # the system-services dir is in use in Maemo Fremantle release + -mkdir -p debian/tmp/usr/share/dbus-1/system-services + -cp src/connman.service debian/tmp/usr/share/dbus-1/system-services/org.moblin.connman.service + + # the services dir is in use in Maemo Diablo release + #-mkdir -p debian/tmp/usr/share/dbus-1/services + #-cp src/connman.service debian/tmp/usr/share/dbus-1/services/ + + # test scripts to usr/bin + -mkdir -p debian/tmp/usr/bin + -cp -a test/*-* debian/tmp/usr/bin/ + + # connman temp dirs + -mkdir -p debian/tmp/var/lib/connman + -mkdir -p debian/tmp/var/run/connman + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installchangelogs + dh_install --sourcedir=debian/tmp --list-missing -v + dh_installinit -- start 59 2 3 4 . stop 15 0 1 5 6 . + dh_installupstart + dh_link + dh_strip --dbg-package=connman + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +.PHONY: build clean binary-indep binary-arch binary install -- 1.7.9.5