[arduino] Associate .ino files with the Arduino IDE.

mavit mavit at fedoraproject.org
Sun Dec 29 20:29:21 UTC 2013


commit 49d50b769d61e6fbf625e091678cd096b12400f4
Author: Peter Oliver <git at mavit.org.uk>
Date:   Sun Dec 29 20:29:01 2013 +0000

    Associate .ino files with the Arduino IDE.

 0001-Handle-new-.ino-file-extension-on-Linux.patch |   70 ++++++++++++++++++++
 arduino.spec                                       |   20 +++++-
 2 files changed, 88 insertions(+), 2 deletions(-)
---
diff --git a/0001-Handle-new-.ino-file-extension-on-Linux.patch b/0001-Handle-new-.ino-file-extension-on-Linux.patch
new file mode 100644
index 0000000..c8160c3
--- /dev/null
+++ b/0001-Handle-new-.ino-file-extension-on-Linux.patch
@@ -0,0 +1,70 @@
+From 0318fd7fd78c20d23bedfcce206e9e0a61ef7d7c Mon Sep 17 00:00:00 2001
+From: Peter Oliver <git at mavit.org.uk>
+Date: Fri, 12 Nov 2010 05:02:10 +0000
+Subject: [PATCH] Handle new .ino file extension on Linux.
+
+---
+ build/linux/arduino.desktop |  1 +
+ build/linux/arduino.xml     | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 43 insertions(+)
+ create mode 100644 build/linux/arduino.xml
+
+diff --git a/build/linux/arduino.desktop b/build/linux/arduino.desktop
+index 45ceaf9..0bef295 100644
+--- a/build/linux/arduino.desktop
++++ b/build/linux/arduino.desktop
+@@ -6,3 +6,4 @@ Exec=arduino
+ Icon=arduino
+ Terminal=false
+ Categories=Development;IDE;Electronics;
++MimeType=text/x-arduino
+diff --git a/build/linux/arduino.xml b/build/linux/arduino.xml
+new file mode 100644
+index 0000000..db21812
+--- /dev/null
++++ b/build/linux/arduino.xml
+@@ -0,0 +1,42 @@
++<?xml version='1.0' encoding='utf-8'?>
++<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
++    <mime-type type="text/x-arduino">
++        <comment>Arduino source code</comment>
++	<comment xml:lang="ara">شفرة مصدر Arduino</comment>
++	<comment xml:lang="be at latin">Kryničny kod Arduino</comment>
++	<comment xml:lang="bg">Изходен код на Arduino</comment>
++	<comment xml:lang="ca">codi font en Arduino</comment>
++	<comment xml:lang="da">Arduinokildekode</comment>
++	<comment xml:lang="de">Arduino-Quelltext</comment>
++	<comment xml:lang="el">πηγαίος κώδικας Arduino</comment>
++	<comment xml:lang="en_GB">Arduino source code</comment>
++	<comment xml:lang="eo">Arduino-fontkodo</comment>
++	<comment xml:lang="es">código fuente en Arduino</comment>
++	<comment xml:lang="eu">Arduino iturburu-kodea</comment>
++	<comment xml:lang="fi">Arduino-lähdekoodi</comment>
++	<comment xml:lang="fr">code source Arduino</comment>
++	<comment xml:lang="ga">cód foinseach Arduino</comment>
++	<comment xml:lang="hu">Arduino-forráskód</comment>
++	<comment xml:lang="id">Kode program Arduino</comment>
++	<comment xml:lang="it">Codice sorgente Arduino</comment>
++	<comment xml:lang="ja">Arduino ソースコード</comment>
++	<comment xml:lang="lt">Arduino pradinis kodas</comment>
++	<comment xml:lang="lv">Arduino pirmkods</comment>
++	<comment xml:lang="ms">Kod sumber Arduino</comment>
++	<comment xml:lang="nb">Arduino-kildekode</comment>
++	<comment xml:lang="nl">Arduino-broncode</comment>
++	<comment xml:lang="nn">Arduino-kjeldekode</comment>
++	<comment xml:lang="pl">Kod źródłowy Arduino</comment>
++	<comment xml:lang="pt">código fonte Arduino</comment>
++	<comment xml:lang="pt_BR">Código fonte Arduino</comment>
++	<comment xml:lang="ru">исходный код Arduino</comment>
++	<comment xml:lang="sq">Kod burues Arduino</comment>
++	<comment xml:lang="sv">Arduino-källkod</comment>
++	<comment xml:lang="uk">Вихідний код на мові Arduino</comment>
++	<comment xml:lang="vi">Mã nguồn Arduino</comment>
++	<comment xml:lang="zh_CN">Arduino 源代码</comment>
++	<comment xml:lang="zh_TW">Arduino 源代碼</comment>
++        <sub-class-of type="text/x-c++src"/>
++        <glob pattern="*.ino"/>
++    </mime-type>
++</mime-info>
+1.8.3.1
+
diff --git a/arduino.spec b/arduino.spec
index 0f2ba49..a820e3a 100644
--- a/arduino.spec
+++ b/arduino.spec
@@ -1,7 +1,7 @@
 Name:		arduino
 Epoch:		1
 Version:	1.0.5
-Release:	5%{?dist}
+Release:	6%{?dist}
 Summary:	An IDE for Arduino-compatible electronics prototyping platforms
 Group:		Development/Tools
 License:	GPLv2+ and LGPLv2+ and CC-BY-SA
@@ -32,6 +32,9 @@ Patch8:		arduino-build-platform.patch
 # Requested upstream in https://github.com/arduino/Arduino/pull/1572:
 Patch9:         arduino-appdata.patch
 
+# Accepted upstream for Arduino 1.5.
+Patch10:        0001-Handle-new-.ino-file-extension-on-Linux.patch
+
 BuildRequires:	java-devel >= 1:1.6.0 jpackage-utils ant ant-apache-regexp desktop-file-utils ecj jna rxtx git
 Requires:	%{name}-core = %{epoch}:%{version}-%{release}, %{name}-doc = %{epoch}:%{version}-%{release}
 Requires:	java >= 1:1.6.0 xorg-x11-fonts-Type1 ecj jna rxtx
@@ -102,6 +105,8 @@ cd /
 git apply --directory=$pwd %{PATCH4}
 cd $pwd
 
+%patch10 -p1
+
 build-jar-repository -p -s app/lib/ ecj jna RXTXcomm
 
 
@@ -153,6 +158,9 @@ cp -p ../linux/%{name}.1 $RPM_BUILD_ROOT/%{_mandir}/man1/
 
 desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications ../linux/%{name}.desktop
 
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mime/packages
+cp -a ../linux/%{name}.xml $RPM_BUILD_ROOT/%{_datadir}/mime/packages/
+
 for dir in ../linux/icons/*; do
     size=`basename $dir`
     mkdir -p $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/$size/apps
@@ -179,7 +187,8 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/%{name}/*.jar
 %{_datadir}/%{name}/lib/*
 %exclude %{_datadir}/%{name}/lib/version.txt
-%{_datadir}/applications/*
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/mime/packages/%{name}.xml
 %{_datadir}/icons/hicolor/*/apps/%{name}.png
 %{_datadir}/polkit-1/actions/cc.arduino.add-groups.policy
 %{_libexecdir}/%{name}-add-groups
@@ -189,9 +198,13 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %post
+/usr/bin/update-desktop-database &> /dev/null || :
+/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
 /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
 
 %postun
+/usr/bin/update-desktop-database &> /dev/null || :
+/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
 if [ $1 -eq 0 ] ; then
     /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
     /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
@@ -224,6 +237,9 @@ fi
 
 
 %changelog
+* Sun Dec 29 2013 Peter Oliver <rpm at mavit.org.uk> - 1:1.0.5-6
+- Associate .ino files with the Arduino IDE.
+
 * Thu Nov  7 2013 Peter Oliver <rpm at mavit.org.uk> - 1:1.0.5-5
 - Force update of icon cache so that icon appears straight away.
 - Add appdata.xml.


More information about the scm-commits mailing list