]> git.etc.gen.nz Git - sapphire-remote.git/commitdiff
Many fixes to the packaging
authorAndrew Ruthven <andrew@etc.gen.nz>
Sat, 16 Feb 2019 09:48:24 +0000 (09:48 +0000)
committerAndrew Ruthven <andrew@etc.gen.nz>
Sat, 16 Feb 2019 09:48:24 +0000 (09:48 +0000)
debian/.gitignore
debian/compat
debian/control
debian/rules
debian/sapphire-remote.docs [new file with mode: 0644]
debian/sapphire-remote.install [new file with mode: 0644]
debian/sapphire-remote.postinst [new file with mode: 0644]
debian/sapphire-remote.service

index 033aa4a5cac199cc206c5090932a0b3c43d4f745..c5777870a11038798a110a212bec51b0a9f7e92f 100644 (file)
@@ -1,4 +1,5 @@
 *.log
 *.substvars
+*.debhelper
 sapphire-remote-dkms/
 sapphire-remote/
index 7f8f011eb73d6043d2e6db9d2c101195ae2801f2..ec635144f60048986bc560c5576355344005e6e7 100755 (executable)
@@ -1 +1 @@
-7
+9
index ac8ac30cc42fe24304a9e9e72d4c59616750e1d2..83afb51ea55a171453a0bd70a916c2c437c20d02 100755 (executable)
@@ -2,7 +2,7 @@ Source: sapphire-remote-dkms
 Section: misc
 Priority: optional
 Maintainer: Dynamic Kernel Modules Support Team <pkg-dkms-maint@lists.alioth.debian.org>
-Build-Depends: debhelper (>= 7), dkms, gawk
+Build-Depends: debhelper (>= 7), dkms, gawk, dh-exec
 Standards-Version: 3.8.1
 
 Package: sapphire-remote-dkms
@@ -12,5 +12,6 @@ Description: sapphire-remote driver in DKMS format.
 
 Package: sapphire-remote
 Architecture: all
-Depends: sapphire-remote-dkms, ${misc:Depends}
+Pre-Depends: sapphire-remote-dkms
+Depends: gawk, ${misc:Depends}
 Description: sapphire-remote tools
index 82e59b2fc65413049c554a326451a90307bc9928..f4639f4095590f29021c45ef26e6f82d43f2a888 100755 (executable)
@@ -33,6 +33,11 @@ install: build
        dh_testroot
        dh_prep
        dh_installdirs
+       dh_install
+       dh_installinit
+        dh_systemd_enable
+       dh_installdocs
+       dh_installchangelogs
        $(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-dkms NAME=$(NAME) VERSION=$(VERSION) install
 
 binary-arch: build install
diff --git a/debian/sapphire-remote.docs b/debian/sapphire-remote.docs
new file mode 100644 (file)
index 0000000..5586e4f
--- /dev/null
@@ -0,0 +1 @@
+sapphire-remote-7.1/README.txt 
diff --git a/debian/sapphire-remote.install b/debian/sapphire-remote.install
new file mode 100644 (file)
index 0000000..b7c1799
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/dh-exec
+sapphire-remote-7.1/extract_keydefs.sh => /usr/lib/sapphire-remote
+sapphire-remote-7.1/sapphire_keymap.sh.part1 => /usr/lib/sapphire-remote
+sapphire-remote-7.1/sapphire_keymap.sh.part3 => /usr/lib/sapphire-remote
+sapphire-remote-7.1/sapphire_startup.sh => /usr/lib/sapphire-remote
+sapphire-remote-7.1/keymap.default => /etc/sapphire.keymap
+
diff --git a/debian/sapphire-remote.postinst b/debian/sapphire-remote.postinst
new file mode 100644 (file)
index 0000000..d133f03
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh
+# postinst script for sapphire-remote
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+NAME=sapphire-remote
+PACKAGE_NAME=$NAME
+DEB_NAME=$(echo $PACKAGE_NAME | sed 's,_,-,')
+MODNAME=/usr/src/${NAME}-7.1/sapphire
+KEYMAP_SCRIPT=/usr/lib/${NAME}/sapphire_keymap.sh
+EXTRACT_KEYDEFS=extract_keydefs.sh
+
+pkg_configure () {
+    if [ -e /usr/include/linux/input-event-codes.h ]
+    then
+        INPUT_H=/usr/include/linux/input-event-codes.h
+    else
+        INPUT_H=/usr/include/linux/input.h
+    fi
+
+    /usr/lib/${NAME}/${EXTRACT_KEYDEFS} ${INPUT_H} ${MODNAME}.h | cat ${KEYMAP_SCRIPT}.part1 - ${KEYMAP_SCRIPT}.part3 > ${KEYMAP_SCRIPT}
+    chmod 0755 ${KEYMAP_SCRIPT}
+}
+
+
+case "$1" in
+    configure)
+        pkg_configure
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
index b528d7bc7e06427d0cfe22eb2d16ea77e51054e7..ed48ae0a2ae7409a009e12391c755a1038f8ede7 100644 (file)
@@ -2,7 +2,9 @@
 Description=Sapphire HID driver
 
 [Service]
+Type=oneshot
 ExecStartPre=/usr/lib/sapphire-remote/sapphire_keymap.sh
+ExecStart=/usr/lib/sapphire-remote/sapphire_startup.sh
 
 [Install]
 WantedBy=multi-user.target