unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Connman
@ 2016-04-20 22:41 Efraim Flashner
  2016-04-21 13:07 ` Leo Famulari
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Efraim Flashner @ 2016-04-20 22:41 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]

I think I've finally gotten connman working, with a service. I haven't
added an entry to doc/guix.texi yet, and for some reason when I started
the patch I stuck it in wicd.scm. I've also attached the OS config I
used while testing.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-gnu-Add-connman.patch --]
[-- Type: text/plain, Size: 4211 bytes --]

From efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Thu, 19 Apr 2016 17:25:41 +0200
Subject: [PATCH 1/2] gnu: Add connman.

* gnu/packages/wicd.scm (connman): New variable.
---
 gnu/packages/wicd.scm | 70 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm
index f9aa657..8ceb4cf 100644
--- a/gnu/packages/wicd.scm
+++ b/gnu/packages/wicd.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,17 +23,24 @@
 (define-module (gnu packages wicd)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix licenses)
   #:use-module (guix utils)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages linux)
-  #:use-module (gnu packages admin)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages polkit)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages samba)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages vpn))
 
 (define-public wicd
   (package
@@ -190,3 +198,61 @@
 wireless networking.")
     (home-page "https://launchpad.net/wicd")
     (license gpl2+)))
+
+(define-public connman
+  (package
+    (name "connman")
+    (version "1.32")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://www.kernel.org/pub/linux/network/connman/"
+                            name "-" version ".tar.xz"))
+    (sha256
+     (base32
+      "0k4kw2j78gwxf0rq79a099qkzl6wi4v5i7rfs4rn0si0fd68d19i"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--enable-nmcompat"
+             "--sysconfdir=/etc"
+             "--localstatedir=/var"
+             "--enable-openconnect"
+             "--enable-openvpn"
+             "--enable-vpnc"
+             "--enable-pptp"
+             "--enable-l2tp"
+             (string-append
+              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
+             (string-append
+              "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share"))))
+    (native-inputs
+     `(("pkg-config", pkg-config)
+       ("python" ,python-2)))
+    (inputs
+     `(("dbus" ,dbus)
+       ("glib" ,glib)
+       ("gnutls" ,gnutls)
+       ("iptables" ,iptables)
+       ("polkit" ,polkit)
+       ("readline" ,readline)
+       ;; These inputs are needed for connman to include the interface to
+       ;; these technologies so IF they are installed they can be used.
+       ;; TODO: add neard, ofono
+       ("openconnect" ,openconnect)
+       ("openvpn" ,openvpn)
+       ("ppp", ppp)
+       ("vpnc" ,vpnc)
+       ("wpa-supplicant" ,wpa-supplicant)))
+    (home-page "https://01.org/connman")
+    (synopsis "Connection Manager daemon")
+    (description "The Linux Connection Manager project provides a daemon for
+managing Internet connections within embedded devices running the Linux
+operating system.  The Connection Manager is designed to be slim and to use as
+few resources as possible. It is fully modular system that can be extended
+through plug-ins.  The plug-in approach allows for easy adaption and
+modification for various use cases.  Connman implements DNS resolving and
+caching, DHCP clients for both IPv4 and IPv6, link-local IPv4 address handling
+and tethering (IP connection sharing) to clients via USB, ethernet, WiFi,
+cellular and Bluetooth.")
+    (license gpl2)))
-- 
2.8.1


[-- Attachment #1.3: 0002-services-Add-connman-service.patch --]
[-- Type: text/plain, Size: 3209 bytes --]

From 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Thu, 19 Apr 2016 22:10:11 +0200
Subject: [PATCH 2/2] services: Add connman-service.

* gnu/services/networking.scm (connman-service): New procedure.
(connman-service-type, %connman-activation): New variables.
(connman-shepherd-service): New procedure.
---
 gnu/services/networking.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5a0a211..5bb56a2 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -45,7 +46,8 @@
             tor-service
             bitlbee-service
             wicd-service
-            network-manager-service))
+            network-manager-service
+            connman-service))
 
 ;;; Commentary:
 ;;;
@@ -652,4 +654,47 @@ and @command{wicd-curses} user interfaces."
 that attempting to keep active network connectivity when available."
   (service network-manager-service-type network-manager))
 
+\f
+;;;
+;;; Connman
+;;;
+
+(define %connman-activation
+  ;; Activation gexp for Connman.
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/etc/connman/")
+      (mkdir-p "/var/lib/connman/")
+      (mkdir-p "/var/lib/connman-vpn/")))
+
+(define (connman-shepherd-service connman)
+  "Return a shepherd service for Connman"
+  (list (shepherd-service
+         (documentation "Run Connman")
+         (provision '(networking))
+         (requirement '(user-processes dbus-system loopback))
+         (start #~(make-forkexec-constructor
+                   (list (string-append #$connman
+                                        "/sbin/connmand")
+                         "-n" "-r")))
+         (stop #~(make-kill-destructor)))))
+
+(define connman-service-type
+  (service-type (name 'connman)
+                (extensions
+                 (list (service-extension shepherd-root-service-type
+                                          connman-shepherd-service)
+                       (service-extension dbus-root-service-type list)
+                       (service-extension activation-service-type
+                                          (const %connman-activation))
+                       ;; Add connman to the system profile.
+                       (service-extension profile-service-type list)))))
+
+(define* (connman-service #:key (connman connman))
+  "Return a service that runs Connman, a network connection manager.  This
+service adds the @var{connman} package to the global profile, providing
+several the @command{connmanctl} command to interact with the daemon and
+configure networking."
+  (service connman-service-type connman))
+
 ;;; networking.scm ends here
-- 
2.8.1


[-- Attachment #1.4: openbox.tmpl --]
[-- Type: text/plain, Size: 1685 bytes --]

;; This is an operating system configuration template
;; for a "desktop" setup without full-blown desktop
;; environments.

(use-modules (gnu) (gnu system nss))
(use-service-modules desktop networking)
(use-package-modules openbox certs wicd xorg)

(operating-system
  (host-name "antelope")
  (timezone "Europe/Paris")
  (locale "en_US.UTF-8")

  ;; Assuming /dev/sdX is the target hard disk, and "my-root"
  ;; is the label of the target root file system.
  (bootloader (grub-configuration (device "/dev/sdX")))

  (file-systems (cons (file-system
                        (device "my-root")
                        (title 'label)
                        (mount-point "/")
                        (type "ext4"))
                      %base-file-systems))

  (users (cons (user-account
                (name "alice")
                (comment "Bob's brother")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/alice"))
               %base-user-accounts))

  ;; Add a bunch of window managers; we can choose one at
  ;; the log-in screen with F1.
  (packages (cons* openbox                 ;window managers
                   nss-certs               ;for HTTPS access
                   connman xterm
                   %base-packages))

  ;; Use the "desktop" services, which include the X11
  ;; log-in service, networking with Wicd, and more.
  (services (cons* (connman-service)
                   (delete (wicd-service) %desktop-services)))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-04-20 22:41 [PATCH] Connman Efraim Flashner
@ 2016-04-21 13:07 ` Leo Famulari
  2016-04-25 22:04 ` Ludovic Courtès
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Leo Famulari @ 2016-04-21 13:07 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

On Thu, Apr 21, 2016 at 01:41:45AM +0300, Efraim Flashner wrote:
> I think I've finally gotten connman working, with a service. I haven't
> added an entry to doc/guix.texi yet, and for some reason when I started
> the patch I stuck it in wicd.scm. I've also attached the OS config I
> used while testing.

Awesome! I can't wait to try this out.

And thanks for including an example OS configuration. That will make it
a lot easier to test.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-04-20 22:41 [PATCH] Connman Efraim Flashner
  2016-04-21 13:07 ` Leo Famulari
@ 2016-04-25 22:04 ` Ludovic Courtès
  2016-05-05  6:31   ` Efraim Flashner
  2016-04-28 16:07 ` Leo Famulari
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Ludovic Courtès @ 2016-04-25 22:04 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Efraim Flashner <efraim@flashner.co.il> skribis:

> I think I've finally gotten connman working, with a service. I haven't
> added an entry to doc/guix.texi yet, and for some reason when I started
> the patch I stuck it in wicd.scm. I've also attached the OS config I
> used while testing.

Neat!

> From efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Thu, 19 Apr 2016 17:25:41 +0200
> Subject: [PATCH 1/2] gnu: Add connman.
>
> * gnu/packages/wicd.scm (connman): New variable.

I think it should go in some other file, possibly connman.scm—whatever
you deem appropriate, but probably not wicd.scm.  :-)

> +(define-public connman
> +  (package
> +    (name "connman")
> +    (version "1.32")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append "https://www.kernel.org/pub/linux/network/connman/"

Use mirror://kernel.org/…

> +             (string-append
> +              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
> +             (string-append
> +              "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share"))))

I suppose this populates $out/etc/dbus-1 and $out/share/dbus-1, which is
where our D-Bus service looks for its XML thingies?

> +    (synopsis "Connection Manager daemon")

“Connection management daemon”

> +    (description "The Linux Connection Manager project provides a daemon for

s/The Linux Connection Manager project/Connman/

> +managing Internet connections within embedded devices running the Linux
> +operating system.

s/within … system//

> +    (license gpl2)))

v2-only?

> From 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Thu, 19 Apr 2016 22:10:11 +0200
> Subject: [PATCH 2/2] services: Add connman-service.
>
> * gnu/services/networking.scm (connman-service): New procedure.
> (connman-service-type, %connman-activation): New variables.
> (connman-shepherd-service): New procedure.

[...]

> +(define %connman-activation
> +  ;; Activation gexp for Connman.
> +  #~(begin
> +      (use-modules (guix build utils))
> +      (mkdir-p "/etc/connman/")

Is an empty /etc/connman really needed?

> +(define* (connman-service #:key (connman connman))
> +  "Return a service that runs Connman, a network connection manager.  This

s/Connman/@uref{http://…, Connman}/

> +service adds the @var{connman} package to the global profile, providing
> +several the @command{connmanctl} command to interact with the daemon and
> +configure networking."

Could you add this documentation to guix.texi?

Otherwise LGTM!

How does Connman compare to Wicd, and to NetworkManager?

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-04-20 22:41 [PATCH] Connman Efraim Flashner
  2016-04-21 13:07 ` Leo Famulari
  2016-04-25 22:04 ` Ludovic Courtès
@ 2016-04-28 16:07 ` Leo Famulari
  2016-04-29 15:28   ` Ludovic Courtès
  2016-05-05  6:36 ` [PATCH 1/2] gnu: Add connman Efraim Flashner
  2016-05-05  6:36 ` [PATCH 2/2] services: Add connman-service Efraim Flashner
  4 siblings, 1 reply; 10+ messages in thread
From: Leo Famulari @ 2016-04-28 16:07 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

On Thu, Apr 21, 2016 at 01:41:45AM +0300, Efraim Flashner wrote:
> I think I've finally gotten connman working, with a service. I haven't
> added an entry to doc/guix.texi yet, and for some reason when I started
> the patch I stuck it in wicd.scm. I've also attached the OS config I
> used while testing.

I adapted openbox.tmpl and reconfigured with the patches.

I noticed during boot that the upower-daemon and networking services
were flapping very quickly. I'll try to provide the exact text later
today.

Once booted, the networking service was disabled! I re-enabled it, and
started it, and then connman was working :) I had some issues with
tethering, but I didn't have time to investigate very much yet.

I rebooted a few times and the experience repeated itself.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-04-28 16:07 ` Leo Famulari
@ 2016-04-29 15:28   ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2016-04-29 15:28 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> skribis:

> Once booted, the networking service was disabled! I re-enabled it, and
> started it, and then connman was working :) I had some issues with
> tethering, but I didn't have time to investigate very much yet.

If it was disabled, it’s probably because it respawned too fast, after
which the Shepherd disabled it; /var/log/shepherd.log should show this.

It if respawned too fast, it could be, for instance, because it failed
to connect to the D-Bus system bus, which itself could be because its
Shepherd service lacks 'dbus-daemon in its ’requirements’.

HTH!

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-04-25 22:04 ` Ludovic Courtès
@ 2016-05-05  6:31   ` Efraim Flashner
  2016-05-05 13:41     ` Ludovic Courtès
  0 siblings, 1 reply; 10+ messages in thread
From: Efraim Flashner @ 2016-05-05  6:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3939 bytes --]

On Tue, Apr 26, 2016 at 12:04:21AM +0200, Ludovic Courtès wrote:
> Efraim Flashner <efraim@flashner.co.il> skribis:
> 
> > I think I've finally gotten connman working, with a service. I haven't
> > added an entry to doc/guix.texi yet, and for some reason when I started
> > the patch I stuck it in wicd.scm. I've also attached the OS config I
> > used while testing.
> 
> Neat!
> 
> > From efe1f20ecb23fc4ba2da647152c9f2a2e96293be Mon Sep 17 00:00:00 2001
> > From: Efraim Flashner <efraim@flashner.co.il>
> > Date: Thu, 19 Apr 2016 17:25:41 +0200
> > Subject: [PATCH 1/2] gnu: Add connman.
> >
> > * gnu/packages/wicd.scm (connman): New variable.
> 
> I think it should go in some other file, possibly connman.scm—whatever
> you deem appropriate, but probably not wicd.scm.  :-)

agreed :)

> 
> > +(define-public connman
> > +  (package
> > +    (name "connman")
> > +    (version "1.32")
> > +    (source
> > +      (origin
> > +        (method url-fetch)
> > +        (uri (string-append "https://www.kernel.org/pub/linux/network/connman/"
> 
> Use mirror://kernel.org/…
> 
> > +             (string-append
> > +              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
> > +             (string-append
> > +              "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share"))))
> 
> I suppose this populates $out/etc/dbus-1 and $out/share/dbus-1, which is
> where our D-Bus service looks for its XML thingies?

it turns out it is

> 
> > +    (synopsis "Connection Manager daemon")
> 
> “Connection management daemon”
> 
> > +    (description "The Linux Connection Manager project provides a daemon for
> 
> s/The Linux Connection Manager project/Connman/
> 
> > +managing Internet connections within embedded devices running the Linux
> > +operating system.
> 
> s/within … system//
> 
> > +    (license gpl2)))
> 
> v2-only?

I thought this was strange and I took another look at the website and
the code and it turns out it is gpl2 only.

> 
> > From 2e99131f5b455ceb7c70c33eb4c89134caa755bb Mon Sep 17 00:00:00 2001
> > From: Efraim Flashner <efraim@flashner.co.il>
> > Date: Thu, 19 Apr 2016 22:10:11 +0200
> > Subject: [PATCH 2/2] services: Add connman-service.
> >
> > * gnu/services/networking.scm (connman-service): New procedure.
> > (connman-service-type, %connman-activation): New variables.
> > (connman-shepherd-service): New procedure.
> 
> [...]
> 
> > +(define %connman-activation
> > +  ;; Activation gexp for Connman.
> > +  #~(begin
> > +      (use-modules (guix build utils))
> > +      (mkdir-p "/etc/connman/")
> 
> Is an empty /etc/connman really needed?

It turns out no. I left /var/lib/connman-vpn because although I didn't
write a service for the vpn, the directory would be needed.

> 
> > +(define* (connman-service #:key (connman connman))
> > +  "Return a service that runs Connman, a network connection manager.  This
> 
> s/Connman/@uref{http://…, Connman}/

@uref or @url? wicd uses @url

> 
> > +service adds the @var{connman} package to the global profile, providing
> > +several the @command{connmanctl} command to interact with the daemon and
> > +configure networking."
> 
> Could you add this documentation to guix.texi?

Much less scary than I thought it was going to be

> 
> Otherwise LGTM!
> 
> How does Connman compare to Wicd, and to NetworkManager?

Its hard for me to say, Debian is stuck with 1.22 from forever ago, but
from playing around it seems almost as featureful as Network Manager
while being out of the way like wicd, and has better integration into
enlightenment than either one.

> 
> Thank you!
> 
> Ludo’.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] gnu: Add connman.
  2016-04-20 22:41 [PATCH] Connman Efraim Flashner
                   ` (2 preceding siblings ...)
  2016-04-28 16:07 ` Leo Famulari
@ 2016-05-05  6:36 ` Efraim Flashner
  2016-05-05  6:36 ` [PATCH 2/2] services: Add connman-service Efraim Flashner
  4 siblings, 0 replies; 10+ messages in thread
From: Efraim Flashner @ 2016-05-05  6:36 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/connman.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk             |  1 +
 gnu/packages/connman.scm | 89 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
 create mode 100644 gnu/packages/connman.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 0292b39..cea6a73 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -73,6 +73,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/compression.scm			\
   gnu/packages/conkeror.scm			\
   gnu/packages/conky.scm			\
+  gnu/packages/connman.scm			\
   gnu/packages/cook.scm				\
   gnu/packages/cpio.scm				\
   gnu/packages/cppi.scm				\
diff --git a/gnu/packages/connman.scm b/gnu/packages/connman.scm
new file mode 100644
index 0000000..2625ae8
--- /dev/null
+++ b/gnu/packages/connman.scm
@@ -0,0 +1,89 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix 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 General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages connman)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix licenses)
+  #:use-module (guix utils)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages samba)
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages vpn))
+
+(define-public connman
+  (package
+    (name "connman")
+    (version "1.32")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "mirror://kernel.org/pub/linux/network/connman/"
+                            name "-" version ".tar.xz"))
+    (sha256
+     (base32
+      "0k4kw2j78gwxf0rq79a099qkzl6wi4v5i7rfs4rn0si0fd68d19i"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--enable-nmcompat"
+             ;; "--enable-polkit"
+             "--enable-openconnect"
+             "--enable-openvpn"
+             "--enable-vpnc"
+             "--enable-pptp"
+             "--enable-l2tp"
+             (string-append
+              "--with-dbusconfdir=" (assoc-ref %outputs "out") "/etc")
+             (string-append
+              "--with-dbusdatadir=" (assoc-ref %outputs "out") "/share"))))
+    (native-inputs
+     `(("pkg-config", pkg-config)
+       ("python" ,python-2)))
+    (inputs
+     `(("dbus" ,dbus)
+       ("glib" ,glib)
+       ("gnutls" ,gnutls)
+       ("iptables" ,iptables)
+       ;; ("polkit" ,polkit) ; pkg-config cannot find polkit.pc
+       ("readline" ,readline)
+       ;; These inputs are needed for connman to include the interface to
+       ;; these technologies so IF they are installed they can be used.
+       ;; TODO: add neard, ofono
+       ("openconnect" ,openconnect)
+       ("openvpn" ,openvpn)
+       ("ppp", ppp)
+       ("vpnc" ,vpnc)
+       ("wpa-supplicant" ,wpa-supplicant)))
+    (home-page "https://01.org/connman")
+    (synopsis "Connection management daemon")
+    (description "Connman provides a daemon for managing Internet connections.
+The Connection Manager is designed to be slim and to use as few resources as
+possible. It is fully modular system that can be extended through plug-ins.
+The plug-in approach allows for easy adaption and modification for various use
+cases.  Connman implements DNS resolving and caching, DHCP clients for both
+IPv4 and IPv6, link-local IPv4 address handling and tethering (IP connection
+sharing) to clients via USB, ethernet, WiFi, cellular and Bluetooth.")
+    (license gpl2)))
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] services: Add connman-service.
  2016-04-20 22:41 [PATCH] Connman Efraim Flashner
                   ` (3 preceding siblings ...)
  2016-05-05  6:36 ` [PATCH 1/2] gnu: Add connman Efraim Flashner
@ 2016-05-05  6:36 ` Efraim Flashner
  2016-05-06  9:53   ` Ludovic Courtès
  4 siblings, 1 reply; 10+ messages in thread
From: Efraim Flashner @ 2016-05-05  6:36 UTC (permalink / raw)
  To: guix-devel

* gnu/services/networking.scm (connman-service): New procedure.
(connman-service-type, %connman-activation): New variables.
(connman-shepherd-service): New procedure.
* doc/guix.texi (Networking Services): Document it.
---
 doc/guix.texi               | 14 ++++++++++++-
 gnu/services/networking.scm | 49 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 0d72574..b575faf 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18,7 +18,8 @@ Copyright @copyright{} 2014 Pierre-Antoine Rault@*
 Copyright @copyright{} 2015 Taylan Ulrich Bayırlı/Kammer@*
 Copyright @copyright{} 2015, 2016 Leo Famulari@*
 Copyright @copyright{} 2016 Ben Woodcroft@*
-Copyright @copyright{} 2016 Chris Marusich
+Copyright @copyright{} 2016 Chris Marusich@*
+Copyright @copyright{} 2016 Efraim Flashner
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -7390,6 +7391,17 @@ Return a service that runs NetworkManager, a network connection manager
 attempting to keep network connectivity active when available.
 @end deffn
 
+@cindex Connman
+@deffn {Scheme Procedure} connman-service @
+       [#:connman @var{connman}]
+Return a service that runs @url{https://01.org/connman,Connman}, a network
+connection manager.
+
+This service adds the @var{connman} package to the global profile, providing
+several the @command{connmanctl} command to interact with the daemon and
+configure networking."
+@end deffn
+
 @deffn {Scheme Procedure} ntp-service [#:ntp @var{ntp}] @
   [#:name-service @var{%ntp-servers}]
 Return a service that runs the daemon from @var{ntp}, the
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5a0a211..af2a609 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
   #:use-module (gnu system shadow)
   #:use-module (gnu system pam)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages connman)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages tor)
   #:use-module (gnu packages messaging)
@@ -45,7 +47,8 @@
             tor-service
             bitlbee-service
             wicd-service
-            network-manager-service))
+            network-manager-service
+            connman-service))
 
 ;;; Commentary:
 ;;;
@@ -652,4 +655,48 @@ and @command{wicd-curses} user interfaces."
 that attempting to keep active network connectivity when available."
   (service network-manager-service-type network-manager))
 
+\f
+;;;
+;;; Connman
+;;;
+
+(define %connman-activation
+  ;; Activation gexp for Connman.
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/var/lib/connman/")
+      (mkdir-p "/var/lib/connman-vpn/")))
+
+(define (connman-shepherd-service connman)
+  "Return a shepherd service for Connman"
+  (list (shepherd-service
+         (documentation "Run Connman")
+         (provision '(networking))
+         (requirement '(user-processes dbus-system loopback))
+         (start #~(make-forkexec-constructor
+                   (list (string-append #$connman
+                                        "/sbin/connmand")
+                         "-n" "-r")))
+         (stop #~(make-kill-destructor)))))
+
+(define connman-service-type
+  (service-type (name 'connman)
+                (extensions
+                 (list (service-extension shepherd-root-service-type
+                                          connman-shepherd-service)
+                       (service-extension dbus-root-service-type list)
+                       (service-extension activation-service-type
+                                          (const %connman-activation))
+                       ;; Add connman to the system profile.
+                       (service-extension profile-service-type list)))))
+
+(define* (connman-service #:key (connman connman))
+  "Return a service that runs @url{https://01.org/connman,Connman}, a network
+connection manager.
+
+This service adds the @var{connman} package to the global profile, providing
+several the @command{connmanctl} command to interact with the daemon and
+configure networking."
+  (service connman-service-type connman))
+
 ;;; networking.scm ends here
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] Connman
  2016-05-05  6:31   ` Efraim Flashner
@ 2016-05-05 13:41     ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2016-05-05 13:41 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Tue, Apr 26, 2016 at 12:04:21AM +0200, Ludovic Courtès wrote:

[...]

>> > +    (license gpl2)))
>> 
>> v2-only?
>
> I thought this was strange and I took another look at the website and
> the code and it turns out it is gpl2 only.

Just to be clear, what matters to determine whether it’s v2-only is
whether license headers in the source files carry the “or any later
version” wording or not.

>> > +(define* (connman-service #:key (connman connman))
>> > +  "Return a service that runs Connman, a network connection manager.  This
>> 
>> s/Connman/@uref{http://…, Connman}/
>
> @uref or @url? wicd uses @url

They are synonymous.

>> > +service adds the @var{connman} package to the global profile, providing
>> > +several the @command{connmanctl} command to interact with the daemon and
>> > +configure networking."
>> 
>> Could you add this documentation to guix.texi?
>
> Much less scary than I thought it was going to be

:-)

>> How does Connman compare to Wicd, and to NetworkManager?
>
> Its hard for me to say, Debian is stuck with 1.22 from forever ago, but
> from playing around it seems almost as featureful as Network Manager
> while being out of the way like wicd, and has better integration into
> enlightenment than either one.

OK!

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] services: Add connman-service.
  2016-05-05  6:36 ` [PATCH 2/2] services: Add connman-service Efraim Flashner
@ 2016-05-06  9:53   ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2016-05-06  9:53 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: guix-devel

Efraim Flashner <efraim@flashner.co.il> skribis:

> * gnu/services/networking.scm (connman-service): New procedure.
> (connman-service-type, %connman-activation): New variables.
> (connman-shepherd-service): New procedure.
> * doc/guix.texi (Networking Services): Document it.

I see it’s committed, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-05-06  9:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-20 22:41 [PATCH] Connman Efraim Flashner
2016-04-21 13:07 ` Leo Famulari
2016-04-25 22:04 ` Ludovic Courtès
2016-05-05  6:31   ` Efraim Flashner
2016-05-05 13:41     ` Ludovic Courtès
2016-04-28 16:07 ` Leo Famulari
2016-04-29 15:28   ` Ludovic Courtès
2016-05-05  6:36 ` [PATCH 1/2] gnu: Add connman Efraim Flashner
2016-05-05  6:36 ` [PATCH 2/2] services: Add connman-service Efraim Flashner
2016-05-06  9:53   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).