From e21d3d387d6139424953a41140c3384945689829 Mon Sep 17 00:00:00 2001 From: Adrian Iain Lam Date: Tue, 19 Sep 2017 00:07:09 +0800 Subject: [PATCH] Create debian/* for .deb packaging --- debian/changelog | 5 +++++ debian/compat | 1 + debian/config | 9 +++++++++ debian/control | 21 +++++++++++++++++++++ debian/copyright | 27 +++++++++++++++++++++++++++ debian/install | 7 +++++++ debian/postinst | 21 +++++++++++++++++++++ debian/postrm | 6 ++++++ debian/prerm | 2 ++ debian/rules | 25 +++++++++++++++++++++++++ debian/source/format | 1 + debian/templates | 25 +++++++++++++++++++++++++ 12 files changed, 150 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100755 debian/config create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/postinst create mode 100755 debian/postrm create mode 100755 debian/prerm create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/templates diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..97e271d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +indicator-keyboard-led (1.1-1) unstable; urgency=medium + + * Initial release (Closes: #2) + + -- Adrian I Lam Mon, 18 Sep 2017 17:38:46 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/config b/debian/config new file mode 100755 index 0000000..269b471 --- /dev/null +++ b/debian/config @@ -0,0 +1,9 @@ +#!/bin/sh -e +. /usr/share/debconf/confmodule + +db_input high indicator-keyboard-led/short || true +db_go +db_input high indicator-keyboard-led/order || true +db_go +db_input high indicator-keyboard-led/xdotool || true +db_go diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..385dc6c --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: indicator-keyboard-led +Section: utils +Priority: optional +Maintainer: Adrian I Lam +Build-Depends: debhelper (>=9), python3 +Standards-Version: 3.9.7 +Homepage: https://github.com/adrianiainlam/indicator-keyboard-led +Vcs-Git: https://github.com/adrianiainlam/indicator-keyboard-led.git +Vcs-Browser: https://github.com/adrianiainlam/indicator-keyboard-led + +Package: indicator-keyboard-led +Architecture: all +Depends: python3, libgtk-3-0, libappindicator3-1, python3-gi, debconf (>= 0.2.17), ${misc:Depends} +Recommends: libgtk-3-0 (>= 3.18), xdotool +Description: simulate keyboard lock keys LED + This is a Unity application indicator designed for keyboards without lock + keys LED. It allows the user to check the state of the three locks (Caps + lock, Num lock and Scroll lock) without requiring any mouse or keyboard + action. It also allows the lock keys to be toggled with mouse clicks, which + could be useful for keyboards without Scroll lock keys or malfunctioning + keyboards. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..7429943 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,27 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: indicator-keyboard-led +Source: https://github.com/adrianiainlam/indicator-keyboard-led + +Files: * +Copyright: 2017 Adrian I Lam +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..a286132 --- /dev/null +++ b/debian/install @@ -0,0 +1,7 @@ +indicator-keyboard-led.py usr/bin +indicator-keyboard-led.desktop etc/xdg/autostart +indicator-keyboard-led.svg usr/share/icons/hicolor/scalable/apps +locale/en/LC_MESSAGES/indicator-keyboard-led.mo usr/share/locale/en/LC_MESSAGES +locale/fr/LC_MESSAGES/indicator-keyboard-led.mo usr/share/locale/fr/LC_MESSAGES +README.md usr/share/doc/indicator-keyboard-led +screenshots usr/share/doc/indicator-keyboard-led diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..cbc8039 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,21 @@ +#!/bin/sh -e +pkill indicator-keyboard-led.py || true + +# modify autostart .desktop file to include debconf results +. /usr/share/debconf/confmodule +args= +db_get indicator-keyboard-led/short +if [ "$RET" = "true" ]; then + args="$args --short" +fi +db_get indicator-keyboard-led/order +if [ -n "$RET" ]; then + args="$args --order $RET" +fi +db_get indicator-keyboard-led/xdotool +if [ -n "$RET" ]; then + args="$args --xdotool $RET" +fi +sed -i 's|^Exec=.*$|Exec=/usr/bin/indicator-keyboard-led.py'" $args"'|' /etc/xdg/autostart/indicator-keyboard-led.desktop + +sudo ln -s /etc/xdg/autostart/indicator-keyboard-led.desktop /usr/share/applications/indicator-keyboard-led.desktop diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 0000000..4827dad --- /dev/null +++ b/debian/postrm @@ -0,0 +1,6 @@ +#!/bin/sh -e + +if [ "$1" = "purge" -a -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi diff --git a/debian/prerm b/debian/prerm new file mode 100755 index 0000000..3b1f7fd --- /dev/null +++ b/debian/prerm @@ -0,0 +1,2 @@ +#!/bin/sh -e +pkill indicator-keyboard-led.py || true diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..c6b9330 --- /dev/null +++ b/debian/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ --with=python3 + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..3fc8404 --- /dev/null +++ b/debian/templates @@ -0,0 +1,25 @@ +Template: indicator-keyboard-led/short +Type: boolean +Default: false +Description: Enable short labels: + Short labels: e.g. ⚫N ⚫C ⚫S + Default labels: e.g. ⚫Num ⚫Caps ⚫Scroll + +Template: indicator-keyboard-led/order +Type: string +Default: NCS +Description: Locks display order [NCS]: + Use N for Num lock, C for Caps lock and S for Scroll lock. + Examples: + NCS gives ⚫Num ⚫Caps ⚫Scroll [default] + CNS gives ⚫Caps ⚫Num ⚫Scroll + NC gives ⚫Num ⚫Caps (Scroll hidden) + C gives ⚫Caps + +Template: indicator-keyboard-led/xdotool +Type: string +Default: +Description: Custom xdotool path [leave blank to search in $PATH]: + Give full path to xdotool (e.g. /usr/bin/xdotool), or + leave blank to let indicator-keyboard-led search for it + in your $PATH [default]. -- 2.7.4