debian: use debconf to ask if the user accepts the MSK4W EULA
authorAntonio Ospite <ospite@studenti.unina.it>
Wed, 28 Dec 2011 12:47:23 +0000 (13:47 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Fri, 3 Feb 2012 11:16:54 +0000 (12:16 +0100)
debian/config [new file with mode: 0755]
debian/control
debian/po/POTFILES.in [new file with mode: 0644]
debian/po/templates.pot [new file with mode: 0644]
debian/postinst
debian/postrm
debian/templates [new file with mode: 0644]

diff --git a/debian/config b/debian/config
new file mode 100755 (executable)
index 0000000..06a4425
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input critical kinect-audio-setup/accept_eula || true
+db_go
index 46c2c45..e18b335 100644 (file)
@@ -2,7 +2,7 @@ Source: kinect-audio-setup
 Section: contrib/sound
 Priority: extra
 Maintainer: Antonio Ospite <ospite@studenti.unina.it>
-Build-Depends: debhelper (>= 8.0.0), libusb-1.0-0-dev, pkg-config
+Build-Depends: debhelper (>= 8.0.0), po-debconf, libusb-1.0-0-dev, pkg-config
 Standards-Version: 3.9.2
 Homepage: http://git.ao2.it/kinect-audio-setup.git/
 Vcs-Git: git://git.ao2.it/kinect-audio-setup.git
@@ -10,7 +10,7 @@ Vcs-Browser: http://git.ao2.it/kinect-audio-setup.git/
 
 Package: kinect-audio-setup
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, udev, wget, p7zip-full (>= 9.20)
+Depends: ${shlibs:Depends}, ${misc:Depends}, debconf, udev, wget, p7zip-full (>= 9.20)
 Description: enable audio input from the Microsoft Kinect sensor device
  When the Kinect is first plugged in the USB port it shows up as a
  generic USB device with a bulk endpoint; after uploading a certain
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644 (file)
index 0000000..cef83a3
--- /dev/null
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644 (file)
index 0000000..3c11944
--- /dev/null
@@ -0,0 +1,60 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: kinect-audio-setup\n"
+"Report-Msgid-Bugs-To: kinect-audio-setup@packages.debian.org\n"
+"POT-Creation-Date: 2012-02-03 11:51+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Do you accept the Microsoft KinectForWindows EULA?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"In order to fetch the binary firmware needed by this package you need to "
+"agree to the EULA of the Microsoft KinectForWindows SDK:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "http://www.kinectforwindows.org/download/EULA.htm"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../templates:2001
+msgid "EULA not accepted"
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../templates:2001
+msgid ""
+"You need to accept the EULA of Microsoft KinectForWindows SDK in order to "
+"fetch the binary firmware needed by this package."
+msgstr ""
+
+#. Type: note
+#. Description
+#: ../templates:2001
+msgid ""
+"You can do this later by calling:\n"
+"  dpkg-reconfigure kinect-audio-setup"
+msgstr ""
index 41a946a..b51bed0 100644 (file)
@@ -4,11 +4,19 @@
 # see: dh_installdeb(1)
 
 set -e
+        
+. /usr/share/debconf/confmodule 
 
 case "$1" in
     configure)
-        kinect_fetch_fw /lib/firmware/kinect /usr/sbin/kinect_upload_fw || true
-        udevadm control --reload-rules || true
+        db_get kinect-audio-setup/accept_eula
+        if [ "$RET" = "false" ]; then
+            db_input high kinect-audio-setup/eula_not_accepted || true
+            db_go
+        else
+          kinect_fetch_fw /lib/firmware/kinect /usr/sbin/kinect_upload_fw 1>&2 || true
+          udevadm control --reload-rules || true
+        fi
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
index 422cdde..ea092fa 100644 (file)
@@ -10,6 +10,12 @@ case "$1" in
         rm -rf /lib/firmware/kinect
         # Because piuparts complains about /lib/firmware still there
         rmdir --ignore-fail-on-non-empty -p /lib/firmware/
+
+        if [ -e /usr/share/debconf/confmodule ];
+        then
+            . /usr/share/debconf/confmodule
+            db_purge
+        fi
     ;;
 
     remove|upgrade|failed-upgrade|abort-upgrade|abort-install)
diff --git a/debian/templates b/debian/templates
new file mode 100644 (file)
index 0000000..d5cb6ab
--- /dev/null
@@ -0,0 +1,17 @@
+Template: kinect-audio-setup/accept_eula
+Type: boolean
+Default: false
+_Description: Do you accept the Microsoft KinectForWindows EULA?
+ In order to fetch the binary firmware needed by this package you need
+ to agree to the EULA of the Microsoft KinectForWindows SDK:
+ .
+ http://www.kinectforwindows.org/download/EULA.htm
+
+Template: kinect-audio-setup/eula_not_accepted
+Type: note
+_Description: EULA not accepted
+ You need to accept the EULA of Microsoft KinectForWindows SDK in order
+ to fetch the binary firmware needed by this package.
+ .
+ You can do this later by calling:
+   dpkg-reconfigure kinect-audio-setup