From: Antonio Ospite Date: Wed, 28 Dec 2011 12:47:23 +0000 (+0100) Subject: debian: use debconf to ask if the user accepts the MSK4W EULA X-Git-Tag: debian/0.2-2~1 X-Git-Url: https://git.ao2.it/kinect-audio-setup.git/commitdiff_plain/cb6e17746b0c57d0f97688a320448c0d3eb2936d debian: use debconf to ask if the user accepts the MSK4W EULA --- diff --git a/debian/config b/debian/config new file mode 100755 index 0000000..06a4425 --- /dev/null +++ b/debian/config @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule + +db_input critical kinect-audio-setup/accept_eula || true +db_go diff --git a/debian/control b/debian/control index 46c2c45..e18b335 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: kinect-audio-setup Section: contrib/sound Priority: extra Maintainer: Antonio Ospite -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 index 0000000..cef83a3 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates diff --git a/debian/po/templates.pot b/debian/po/templates.pot new file mode 100644 index 0000000..3c11944 --- /dev/null +++ b/debian/po/templates.pot @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 "" diff --git a/debian/postinst b/debian/postinst index 41a946a..b51bed0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -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) diff --git a/debian/postrm b/debian/postrm index 422cdde..ea092fa 100644 --- a/debian/postrm +++ b/debian/postrm @@ -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 index 0000000..d5cb6ab --- /dev/null +++ b/debian/templates @@ -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