%define longversion %(echo 0%version | tr -d .) Name: arduino Version: 1.0.1 Release: 1mamba Summary: The open-source Arduino environment Group: Graphical Desktop/Applications/Development Vendor: openmamba Distribution: openmamba Packager: Stefano Cotta Ramusino URL: http://www.arduino.cc/en/Main/software Source: http://arduino.googlecode.com/files/arduino-%{version}-src.tar.gz Source1: arduino-1.0.1-icons.tar.xz Patch0: arduino-1.0.1-script.patch # http://github.com/arduino/Arduino/pull/5 Patch1: arduino-1.0-use_system_rxtx.patch # http://github.com/arduino/Arduino/pull/6: Patch2: arduino-1.0-etc.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: ldconfig ## AUTOBUILDREQ-END BuildRequires: apache-ant BuildRequires: jpackage-utils Requires: cross-avr-gcc Requires: avr-libc Requires: avrdude Requires: java-rxtx BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-root %description The open-source Arduino environment makes it easy to write code and upload it to the Arduino i/o board. The environment is written in Java and based on Processing, avr-gcc, and other open source software. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 ( mkdir -p build/linux/icons cd build/linux/icons tar xf %{SOURCE1} ) find -name '*.class' -exec rm -f '{}' \; find -name '*.jar' -exec rm -f '{}' \; build-jar-repository -p -s app/lib/ ecj jna RXTXcomm %build (cd core/methods; ant) (cd core; ant) (cd build; ant dist < /dev/null; tar -xf linux/arduino-%{longversion}-linux.tgz) %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" cd build/arduino-%{longversion} install -d %{buildroot}%{_bindir} cp -a arduino %{buildroot}%{_bindir}/ install -d %{buildroot}%{_datadir}/arduino cp -a hardware lib libraries examples %{buildroot}%{_datadir}/arduino/ rm %{buildroot}%{_datadir}/arduino/lib/*.jar rm -r %{buildroot}%{_datadir}/arduino/hardware/tools mkdir -p %{buildroot}%{_defaultdocdir}/arduino-%{version} cp -a reference %{buildroot}%{_defaultdocdir}/arduino-%{version}/ ln -s %{_defaultdocdir}/arduino-%{version}/reference %{buildroot}%{_datadir}/arduino/reference # Requested upstream in http://github.com/arduino/Arduino/pull/4: find %{buildroot} -type f -iname '*.jpg' -or -iname '*.java' -or -iname '*.pde' -or -iname '*.h' -or -iname '*.cpp' -or -iname '*.c' -or -iname '*.txt' -or -iname 'makefile' -or -iname 'key*.txt' -or -iname 'pref*.txt' | xargs chmod -x; cp -a lib/core.jar lib/pde.jar %{buildroot}%{_datadir}/%{name}/ install -D -m 0644 ../linux/arduino.1 \ %{buildroot}%{_mandir}/man1/arduino.1 install -D -m 0644 ../linux/arduino.desktop \ %{buildroot}%{_datadir}/applications/arduino.desktop for dir in ../linux/icons/*; do size=`basename $dir` install -D -m 0644 $dir/apps/arduino.png \ %{buildroot}%{_datadir}/icons/hicolor/$size/apps/arduino.png done %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files %defattr(-,root,root) %{_bindir}/%{name} %{_datadir}/%{name} %{_datadir}/applications/* %{_datadir}/icons/hicolor/*/apps/*.png %{_mandir}/man1/arduino.* %doc %{_defaultdocdir}/arduino-%{version}/reference %changelog * Wed May 23 2012 Stefano Cotta Ramusino 1.0.1-1mamba - update to 1.0.1 * Fri Feb 03 2012 Stefano Cotta Ramusino 1.0-1mamba - package created by autospec