summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/README.Debian9
-rw-r--r--debian/README.source7
-rw-r--r--debian/arduino.install1
-rw-r--r--debian/changelog9
-rw-r--r--debian/clean1
-rw-r--r--debian/control2
-rw-r--r--debian/patches/permission_fix.patch11
-rw-r--r--debian/permission-checker/arduinopc.java72
-rwxr-xr-xdebian/rules4
9 files changed, 99 insertions, 17 deletions
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..5464e07
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,9 @@
+User must be in the dialout group in order to write to USB/Serial ports.
+
+Fedora uses zenity to ask if a user wants to be added, but it is a big download.
+
+I wrote our own java code, in debian/permission-checker, which will ask if the
+user would like to be added, then runs a script with pkexec to add the user
+to the dialout group.
+
+--Scott Howard <showard@debian.org>, Dec 12, 2011
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index f292a9e..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,7 +0,0 @@
-This package gets its source from a combination of the upstream SVN and
-upstream released tarball, please inspect the rules file's get-orig-source
-target. Both are found at http://arduino.cc/en/Main/Software. This package
-follows what would happen in the make.sh and dist.sh scripts in a Debian
-compliant way.
-
-Patches are described in debian/patches directly.
diff --git a/debian/arduino.install b/debian/arduino.install
index 0ca4a82..f4b4fbe 100644
--- a/debian/arduino.install
+++ b/debian/arduino.install
@@ -5,3 +5,4 @@ debian/*.desktop usr/share/applications/
debian/icons/* usr/share/icons/hicolor
debian/dist/arduino-add-groups /usr/bin
debian/dist/cc.arduino.add-groups.policy /usr/share/polkit-1/actions
+arduinopc.jar usr/share/arduino/
diff --git a/debian/changelog b/debian/changelog
index d835026..c8c2b39 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,12 @@
arduino (1:1.0+dfsg-4) unstable; urgency=low
- * zenity and policykit moved to Recommends. Package can be configured
- and work without zenity and policykit (Closes: #653295)
+ * policykit moved to Recommends. Package can be configured
+ and work without policykit (Closes: #653295)
+ * Dependency on zenity removed (Closes: #653296). Uses Debian
+ specefic checker in debian/permission-checker instead (written in
+ java as to pull in no extra dependencies).
- -- Scott Howard <showard@debian.org> Mon, 26 Dec 2011 22:35:34 -0500
+ -- Scott Howard <showard@debian.org> Tue, 27 Dec 2011 12:21:24 -0500
arduino (1:1.0+dfsg-3) unstable; urgency=low
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..18b49a0
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1 @@
+arduinopc.jar
diff --git a/debian/control b/debian/control
index e040cfc..6a48e90 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Architecture: all
Depends: default-jre | java6-runtime, libjna-java,
librxtx-java (>= 2.2pre2-3), ${misc:Depends},
arduino-core (= ${binary:Version})
-Recommends: extra-xdg-menus, policykit-1, zenity
+Recommends: extra-xdg-menus, policykit-1
Description: AVR development board IDE and built-in libraries
Arduino is an open-source electronics prototyping platform based on
flexible, easy-to-use hardware and software. It's intended for artists,
diff --git a/debian/patches/permission_fix.patch b/debian/patches/permission_fix.patch
index c2282f9..8586cd8 100644
--- a/debian/patches/permission_fix.patch
+++ b/debian/patches/permission_fix.patch
@@ -4,9 +4,9 @@ Description: Uses pkexec to add user to groups dailout and tty
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652523
Index: arduino/build/linux/dist/arduino
===================================================================
---- arduino.orig/build/linux/dist/arduino 2011-12-23 10:52:18.581468273 -0500
-+++ arduino/build/linux/dist/arduino 2011-12-23 10:52:54.197469119 -0500
-@@ -1,4 +1,19 @@
+--- arduino.orig/build/linux/dist/arduino 2011-12-27 12:17:18.675536651 -0500
++++ arduino/build/linux/dist/arduino 2011-12-27 12:17:29.255536904 -0500
+@@ -1,4 +1,18 @@
-#!/bin/sh
+#!/bin/bash
+
@@ -18,9 +18,8 @@ Index: arduino/build/linux/dist/arduino
+ fi
+ done
+
-+ if [[ -n $missing_groups ]] && zenity --title=Arduino --window-icon=/usr/share/icons/hicolor/48x48/apps/arduino.png --question --text "You need to be a member of the following groups to upload code to an Arduino microcontroller over the USB or serial ports:\n$missing_groups" --ok-label='Add' --cancel-label='Ignore'; then
-+ pkexec /usr/bin/arduino-add-groups \
-+ && zenity --title=Arduino --window-icon=/usr/share/icons/hicolor/48x48/apps/arduino.png --info --text "You must log out and log in again before any changes will take effect."
++ if [[ -n $missing_groups ]] && ! java -jar /usr/share/arduino/arduinopc.jar; then
++ pkexec /usr/bin/arduino-add-groups
+ fi
+fi
+
diff --git a/debian/permission-checker/arduinopc.java b/debian/permission-checker/arduinopc.java
new file mode 100644
index 0000000..d37ebff
--- /dev/null
+++ b/debian/permission-checker/arduinopc.java
@@ -0,0 +1,72 @@
+//javac Example.java
+//jar cfe Example.jar Example *.class
+//java -jar Example.jar
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JLabel;
+import javax.swing.SwingUtilities;
+
+
+public class arduinopc extends JFrame {
+
+ public arduinopc() {
+ initUI();
+ }
+
+ public final void initUI() {
+
+ JPanel panel = new JPanel();
+ getContentPane().add(panel);
+
+// panel.setLayout(null);
+
+ JButton ignoreButton = new JButton("Ignore");
+ //ignoreButton.setBounds(50, 60, 80, 30);
+ ignoreButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ System.exit(0);
+ }
+ });
+
+ JButton addButton = new JButton("Add");
+ //addButton.setBounds(150, 60, 80, 30);
+ addButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ System.exit(1);
+ }
+ });
+
+ //JLabel label = new JLabel("<html>You need to be a member of the \"dailout\"<br>group to upload code to an Arduino<br>microcontroller over the USB or<br>serial ports.<br></html>");
+ //label.setBounds(10,10,300,100);
+ panel.add(new JLabel("<html>You need to be added to the \"dailout\"<br>group to upload code to an Arduino<br>microcontroller over the USB or<br>serial ports.<br><br>You must log out and log in again<br>before any group changes<br>will take effect.</html>", JLabel.CENTER));
+ //label.setFont(new Font("Georgia", Font.PLAIN, 14));
+ //label.setForeground(new Color(50, 50, 25));
+//label.setOpaque(true);
+
+
+ //panel.add(label);//, BorderLayout.CENTER);
+ panel.add(ignoreButton);
+ panel.add(addButton);
+
+
+
+ setTitle("Arduino Permission Checker");
+ setSize(300, 200);
+ setLocationRelativeTo(null);
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
+ }
+
+ public static void main(String[] args) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ arduinopc ex = new arduinopc();
+ ex.setVisible(true);
+ }
+ });
+ }
+}
diff --git a/debian/rules b/debian/rules
index 52a10c6..1200950 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,7 @@ override_dh_clean:
rm -rf build/linux/work/hardware/tools
cd core/methods && ant clean
cd build && ant clean
+ rm -f debian/permission-checker/*.class
dh_clean
override_jh_build:
@@ -23,6 +24,9 @@ override_jh_build:
cd core/methods && ant
cd build && ant
rm -f build/linux/work/lib/version.txt && echo $(SVNTAG) > build/linux/work/lib/version.txt #comment out after beta
+ javac debian/permission-checker/arduinopc.java
+ cd debian/permission-checker && jar cfe arduinopc.jar arduinopc *.class
+ mv debian/permission-checker/*.jar .
override_dh_installchangelogs: