summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/libusrp0c2a.dirs2
-rw-r--r--debian/libusrp0c2a.install3
-rw-r--r--debian/libusrp0c2a.postinst14
-rw-r--r--debian/libusrp0c2a.postrm11
-rw-r--r--debian/libusrp0c2a.udev1
-rwxr-xr-xdebian/rules9
6 files changed, 33 insertions, 7 deletions
diff --git a/debian/libusrp0c2a.dirs b/debian/libusrp0c2a.dirs
index cc85a6f23..c5a0290d0 100644
--- a/debian/libusrp0c2a.dirs
+++ b/debian/libusrp0c2a.dirs
@@ -1,3 +1,3 @@
usr/lib
usr/lib/pkgconfig
-etc/hotplug.d/usb
+etc/udev/rules.d
diff --git a/debian/libusrp0c2a.install b/debian/libusrp0c2a.install
index 4fedca772..42d895305 100644
--- a/debian/libusrp0c2a.install
+++ b/debian/libusrp0c2a.install
@@ -1,3 +1,4 @@
-usr/lib/pkgconfig/usrp.pc
usr/lib/libusrp.la
usr/lib/libusrp.so.*
+usr/lib/pkgconfig/usrp.pc
+etc/udev/rules.d/40-usrp.rules
diff --git a/debian/libusrp0c2a.postinst b/debian/libusrp0c2a.postinst
new file mode 100644
index 000000000..6ed2f9ebd
--- /dev/null
+++ b/debian/libusrp0c2a.postinst
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" != "configure" ]; then
+ exit 0
+fi
+
+# Create usrp group for udev access
+if ! getent group usrp >/dev/null; then
+ addgroup --system usrp
+fi
+
+exit 0
diff --git a/debian/libusrp0c2a.postrm b/debian/libusrp0c2a.postrm
new file mode 100644
index 000000000..4abb56186
--- /dev/null
+++ b/debian/libusrp0c2a.postrm
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+set -e
+
+if [ "$1" != "remove" ]; then
+ exit 0
+fi
+
+rm -f /etc/udev/rules.d/40-usrp.rules
+
+exit 0
diff --git a/debian/libusrp0c2a.udev b/debian/libusrp0c2a.udev
new file mode 100644
index 000000000..e45dc294a
--- /dev/null
+++ b/debian/libusrp0c2a.udev
@@ -0,0 +1 @@
+ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"
diff --git a/debian/rules b/debian/rules
index b9c8ac622..00348e26e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,12 +80,11 @@ install-stamp: build-stamp
fi; \
done
- dh_install --sourcedir=debian/tmp
-
-# FIXME: Ubuntu vs. Debian (below)
-# install -m 0755 debian/usrp.hotplug \
-# $(CURDIR)/debian/usrp/etc/hotplug.d/usb/
+ : # Deposit rule to allow group 'usrp' access to USRP hardware
+ install -m 0755 -D debian/libusrp0c2a.udev \
+ debian/tmp/etc/udev/rules.d/40-usrp.rules
+ dh_install --sourcedir=debian/tmp
touch $@